Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ds30Loader with pic18F87J50 on UART2 [solved]
#1
Dear Mikael,
ds30Loader version 1.0.4 January 2011 worked on pic18F87J50 UART1 at 115200 baud with 4MHz crystal.
But with USE_UART2 defined, loader could not be found.
I tried now version 3.0.0 April 2011 with settings changed:
processor 18F87J50 ; @4MHz no PLL
#define OSCF 4000000
CONFIG DEBUG = OFF ; 1 Background debugger disabled *
CONFIG XINST = OFF ; 0 extended instruction set disabled
CONFIG PLLDIV = 1 ; 111 No prescale 4 MHz oscillator drives PLL *
CONFIG WDTEN = OFF ; 0 wathcdog timer
CONFIG CPUDIV = OSC1 ; No CPU System clock divide
CONFIG FOSC = HSPLL ;
-- config copied from previous version.
now unfortunately ds30Loader could not be found on any port.
It seems i miss some new setting that was not in a previous version.
Dmitri
Reply
#2
it seems i solved the problem,
inspired my post "USART2 Problem - Solved" by joeausro, in functions
;------------------------------------------------------------------------------
; Send()
;------------------------------------------------------------------------------
Send ; Enable tx
ifdef USE_TXENABLE
bsf LATR_TXE, LATB_TXE
nop ;needed?
nop
nop
endif
;Send byte
movwf TXREG
; Wait for transmit shift register to get empty
txwait btfss TXSTA, TRMT
bra txwait
; Disable tx
ifdef USE_TXENABLE
bcf LATR_TXE, LATB_TXE
endif
; Send complete
return


;------------------------------------------------------------------------------
; Receive()
;------------------------------------------------------------------------------
Receive movlw BLDELAY
RcvIni movwf cnt1 ;
rpt2 movlw BL10MS ;
movwf cnt2 ;
rpt3 clrf cnt3
rptc clrwdt
btfss PIRRCIF_, RCIF_ ;test RX
bra notrcv
movf RCREG, w ;return read data in W
addwf crc, f ;compute crc
return
notrcv decfsz cnt3
bra rptc
decfsz cnt2
bra rpt3
decfsz cnt1
bra rpt2
; Receive timed out if we get here
bra exit
;------------------------------------------------------------------------------
i replaced
TXREG with UTXREG -- line 554
TXSTA with UTXSTA -- line 556
RCREG with URCREG -- line 577

now it works with UART2
Reply
#3
What changes did you make?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)