Can I borrow your eyes please? Porting some assembly code to a =20 18F23K22 and getting not getting results I expect. Specifically, I =20 can't seem to get RA2 to work as a digital input. Yeah, I know, I =20 should be ashamed of myself. So I've whittled down the code as much as I can and now realize that =20 RA0, RA1, etc are also not working as digital inputs. At this point, =20 either I'm missing something simple, or it may be a hardware issue. =20 But RA0/AN0 & RA1/AN1 work as analog inputs, so I'm reluctant to =20 accept that. And I'm also seeing the same problem with RE3/Mclr as a =20 digital input. Hardware issue requires ordering another part and then =20 swapping it (SMD), so thought I'd post here first to be sure. FWIW, =20 I've verified that the external voltage applied to the RA2 etc pins =20 are changing as required. This is the whittled-down code... LIST P=3DPIC18F23K22 INCLUDE "p18f23k22.inc" ERRORLEVEL -302 CONFIG FOSC=3DINTIO67 CONFIG PLLCFG=3DOFF CONFIG PRICLKEN=3DON CONFIG FCMEN=3DOFF CONFIG IESO=3DON CONFIG PWRTEN=3DON CONFIG BOREN=3DON CONFIG BORV=3D285 CONFIG WDTEN=3DOFF CONFIG PBADEN=3DOFF CONFIG MCLRE=3DINTMCLR CONFIG STVREN=3DOFF CONFIG XINST=3DOFF CONFIG DEBUG=3DOFF CONFIG CP0=3DOFF CONFIG CP1=3DOFF CONFIG CPB=3DOFF CONFIG CPD=3DOFF CONFIG WRT0=3DOFF CONFIG WRT1=3DOFF CONFIG WRTC=3DOFF CONFIG WRTB=3DOFF CONFIG WRTD=3DOFF CONFIG EBTR0=3DOFF CONFIG EBTR1=3DOFF CONFIG EBTRB=3DOFF ;----- Veriables ----- ;----- Code section ----- ORG 0x0000 goto Init ORG 0x0008 ORG 0x0018 ;--------------------------------------------------------------------- ; Initialization section... ;--------------------------------------------------------------------- Init: clrf BSR clrf INTCON clrf RCON ; IPEN =3D 0 ;----- Setup oscillator ----- movlw B'01100011' ; 8 Mhz, internal osc. movwf OSCCON ;----- Setup ports ----- movlw B'11011111' ; RA5 =3D column output movwf TRISA movlw B'00000000' movwf TRISB ; All outputs (display 1 segments) movlw B'00000000' movwf TRISC ; All outputs (display 2 segments) movlw B'00001000' movwf TRISE ; Should not need this clrf ANSELA ; All digital clrf ANSELB ; ... clrf ANSELC ; ... movlw B'00000100' movwf CM1CON0 ; Comparators off movwf CM2CON ; ... clrf CM2CON1 ; ... clrf VREFCON1 ; Turn off DAC clrf ADCON0 clrf ADCON1 clrf ADCON2 movlw B'10101010' ; Testing movwf PORTB InitDone: ;--------------------------------------------------------------------- ; Main code loop... ;--------------------------------------------------------------------- MainLoop: movlw B'00100000' movwf PORTA ; LED column on movf PORTA,W ; Read all port-A inputs movwf PORTC ; Show on LED segments. MainLoopDone: goto MainLoop end --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .