Hi forum. I have been trying to enable the internal pullups on a 14M without success so far. I read the PIC data sheet which references the COMCON0, ANSEL, TRISA and WPUA registers in connection with WPU control. I wrote a simple test program to initialise these registers but it failed to deliver the goods. Out of curiosity I then wrote another program which simply reads these registers as initialised by the PICAXE interpreter.
The results I get are as follows:
COMCON0 = %00000111, ANSEL = %00000000, TRISA = %00111000, WPU = %00110111
My reading of the 16F684 data sheet is that this should enable the pullups but clearly it doesn't (and shouldn't). What am I missing?
Roy
Code:
#picaxe 14M
#no_table
#no_data
setfreq m8
pause 100
aa:
peek $19,b1 'COMCON0
peek $91,b2 'ANSEL
peek $85,b3 'TRISA
peek $95,b4 'WPUA
sertxd("COMCON0 ",#b1," ANSEL ",#b2," TRISA ",#b3," WPUA ",#b4,13,10)
pause 2000
goto aa
The results I get are as follows:
COMCON0 = %00000111, ANSEL = %00000000, TRISA = %00111000, WPU = %00110111
My reading of the 16F684 data sheet is that this should enable the pullups but clearly it doesn't (and shouldn't). What am I missing?
Roy