I am having trouble getting my 16F690 pin AN4 working as a digital output. No matter what I try the pin seems to float between high and low and creates an approx 2.6 volts using a multimeter.
I think I have all the typical items covered like the ANSEL and ANSELH registers and the comparator registers.
Here is the code, any thoughts are appreciated:
[/code]
'defines
OSCCON=%01110101
define OSC 8
DEFINE SHIFT_PAUSEUS 100
'end defines
data 0,0
'includes
'end includes
' Config Fuses
@ __config _INTRC_OSC_NOCLKOUT & _CPD_ON & _CP_ON & _BOR_ON & _MCLRE_ON & _PWRTE_ON & _WDT_ON & _IESO_OFF & _FCMEN_OFF
' PICBASIC PRO program to show button press on LED
ANSEL = %00000000 ' Set all pins digital
ANSELH = %00000000
WPUA = %00000011 ' Enable pullups for buttons
WPUB = %00000000
OPTION_REG.7 = 0
CM1CON0.0=0
CM2CON0.0=0
TRISA = %11001111 ' Set PORTA.4,5 (LEDs) to output
loop:
PORTA.4 = 1 ' Turn on 1st LED
pause 1000
goto loop
[code/]
Bookmarks