mramos1
Active Member
This is sort of a repeat. I have a simple circuit (attached sorry such a poor drawing). I wanted to play with the ICD2, MPLABs, MikcroBASIC and the new to me 16F88. Last weekend was a waste. I had the ADC work fine. Now that stopped working. Any mikcrobasic folks on electro-tech?
If I can get a sample of the 16F88 ADC I will probably go assember. Mike K8LH
I think I am tring to many new things, but I would have to think the PIC is not configured right.
I import the raw .hex file and all works well. Just something is not configured correct I guess. Also, running 8Mhz now and on 3V (2 AA batteries)
If I can get a sample of the 16F88 ADC I will probably go assember. Mike K8LH
I import the raw .hex file and all works well. Just something is not configured correct I guess. Also, running 8Mhz now and on 3V (2 AA batteries)
Code:
program P16f88
' 8 Mhz internal OSC
Symbol LED = 0
Symbol POT = 0
dim count as word
main:
intcon=0 'interupt are disabled
ansel=%00000001 'an0 port is analog mode others are in digital mode. page 113
trisa=1 'port a0 is input others are output
trisb=0 'all port b are output
adcon0=%11000001 ' page 114
adcon1=%10000000 ' page 115
DO
count=adc_read(POT)
count=count
ClearBit(PORTB,LED)
VDelay_MS(count)
count=adc_read(POT)
count=count
SETBIT(PORTB,LED)
VDelay_MS(count)
LOOP until 1 = 0
end.