Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
18F26K22 [solved]
#3
(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
Reply


Messages In This Thread
18F26K22 [solved] - by hobbytronics - 2011-07-07, 14:14:52
RE: 18F26K22 - by Mikael Gustavsson - 2011-07-07, 14:46:32
RE: 18F26K22 - by hobbytronics - 2011-07-07, 15:16:01
RE: 18F26K22 - by Mikael Gustavsson - 2011-07-07, 22:17:26
RE: 18F26K22 - by hobbytronics - 2011-07-08, 11:08:53
RE: 18F26K22 - by Mikael Gustavsson - 2011-07-08, 11:16:16
RE: 18F26K22 - by hobbytronics - 2011-07-08, 14:27:39
RE: 18F26K22 - by Mikael Gustavsson - 2011-07-08, 15:51:10
RE: 18F26K22 - by hobbytronics - 2011-07-08, 16:31:40
RE: 18F26K22 - by Mikael Gustavsson - 2011-07-08, 23:22:36
RE: 18F26K22 - by Mikael Gustavsson - 2011-07-15, 16:46:18
RE: 18F26K22 - by strud - 2012-02-19, 20:37:45
RE: 18F26K22 - by Mikael Gustavsson - 2012-02-20, 22:33:07
RE: 18F26K22 - by ghu - 2012-03-25, 21:26:04
RE: 18F26K22 - by Tom-H-PIC - 2012-04-01, 23:23:07

Forum Jump:


Users browsing this thread: 1 Guest(s)