Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
18F25K22 and 18F26K22 [solved]
#6
(2012-04-27, 15:57:39)brid0030 Wrote: Would you be willing to share this code? I'm using a 18F25k22 and would not mind losing the MAX232 IC.

Find this bit of the DS30LOADER.ASM and add the two BSFs shown to the bottom, the same changes would apply to many modern PICS;

;----------------------------------------------------------------------
; Init
;----------------------------------------------------------------------
clrf doerase
; Uart, this part of code assembles if USE_CAN is not defined
ifndef USE_CAN
;not using BRG
ifdef USE_BRG16
bsf BAUDCON_, BRG16
movlw (UBRG>>8)
movwf SPBRGH_
endif
movlw b'00100100' ;enable transmit and
movwf TXSTA_ ; high speed mode
movlw (UBRG&0xff) ;use only SPBRG_ (8 bit mode default) not using BAUDCON
movwf SPBRG_ ;set the baud rate ?
movlw b'10010000' ;enable serial port
movwf RCSTA_ ; and receive
bsf BAUDCON_,5 ;set inverted receive data
bsf BAUDCON_,4 ;set inverted transmit
endif




Reply


Messages In This Thread
18F25K22 and 18F26K22 [solved] - by srnet - 2011-05-13, 13:38:32
RE: 18F25K22 and 18F26K22 - by Mikael Gustavsson - 2011-05-13, 18:40:58
RE: 18F25K22 and 18F26K22 - by srnet - 2011-05-13, 21:23:56
RE: 18F25K22 and 18F26K22 - by Mikael Gustavsson - 2011-05-13, 23:31:12
RE: 18F25K22 and 18F26K22 - by brid0030 - 2012-04-27, 15:57:39
RE: 18F25K22 and 18F26K22 - by srnet - 2012-05-01, 07:42:04

Forum Jump:


Users browsing this thread: 1 Guest(s)