2011-07-07, 15:16:01
(2011-07-07, 14:46:32)Mikael Gustafsson Wrote: Please show us the code that configures the uart1 pins to be digital.
Mikael
I tried nuerous things to try and make it work. Like turning off comparators etc. The final code below probably has stuff that can be removed
;------------------------------------------------------------------------------
; User specific entry code go here
;------------------------------------------------------------------------------
;----------------------------------------------------------------------
; Make uart pins digital
;----------------------------------------------------------------------
ifdef ADCON1
;error Do you need to configura uart pins to be digital? If not, remove this line
endif
;movlw b'01100000' ;xxx disable
;movwf ADCON1 ;xxx analog on tx/rx
movlw b'00000000' ;xxx disable
movwf ADCON0 ;xxx analog on tx/rx
movlw b'00000000'
movwf CM1CON0; ; Comparators off
movlw b'00000000'
movwf CM2CON0; ; Comparators off
; Set internal oscillator to 16MHz
movlw b'01110000'
movwf OSCCON
movlw b'00000000'
movwf ANSELA ; DIGITAL
movlw b'00000000'
movwf ANSELB ; DIGITAL
movlw b'00000000'
movwf ANSELC ; DIGITAL
movlw b'10111111'
movwf TRISB ; USART2 - TX Out RX In
movlw b'10111111'
movwf TRISC ; USART1 - TX Out RX In