Hi,
I'm puzzled (nothing new there!)
20x2 rev c.3
Simple ADC input read.
10K resistor from pin to Gnd
1K resistor from source to pin
Voltage measured at pin C.3 is variable from 0 to supply (as expected)
Running this code:
Just returns 0 all the time, as I see the voltage at pin c.3 vary.
If I change the input to c.1, i.e change the ButtonRead symbol to C.1 it works as expected.
I've tried another 20x2 and got the same result
I've double checked the circuit but can't see any errors, and I'm getting the expected voltages at the pin.
Searching the forum there was a post about silicon error on the base pic but I can't decypher the datasheet to confirm this.
Is my ADC setup wrong, I've checked and double checked but could be going blind.
Help
I'm puzzled (nothing new there!)
20x2 rev c.3
Simple ADC input read.
10K resistor from pin to Gnd
1K resistor from source to pin
Voltage measured at pin C.3 is variable from 0 to supply (as expected)
Running this code:
Code:
[color=Blue]symbol [/color][color=Black]ButtonRead [/color][color=DarkCyan]= [/color][color=Blue]c.3
Let [/color][color=Purple]DirsC [/color][color=DarkCyan]= [/color][color=Navy]%10110100[/color]
[color=Blue]let [/color][color=Purple]adcsetup [/color][color=DarkCyan]= [/color][color=Navy]%0000001010000000[/color]
[color=Blue]symbol [/color][color=Black]ButtonValue [/color][color=DarkCyan]= [/color][color=Purple]b1[/color]
[color=Blue]symbol [/color][color=Black]Hundreds [/color][color=DarkCyan]= [/color][color=Purple]b15[/color]
[color=Blue]symbol [/color][color=Black]Tens [/color][color=DarkCyan]= [/color][color=Purple]b16[/color]
[color=Blue]symbol [/color][color=Black]Units [/color][color=DarkCyan]= [/color][color=Purple]b17[/color]
[color=Blue]ReadADC[/color][color=Black]:[/color]
[color=Blue]readadc [/color][color=Black]ButtonRead,buttonvalue[/color]
[color=Blue]bintoascii [/color][color=Black]buttonvalue,hundreds,tens,units[/color]
[color=Blue]serout [/color][color=Black]lcdserial, baudlcd, [/color][color=Blue]([/color][color=Red]"TT"[/color][color=Black],[/color][color=Red]"Val = "[/color][color=Black],hundreds,tens,units,[/color][color=Navy]0[/color][color=Blue])
pause [/color][color=Navy]500[/color]
[color=Blue]goto readadc[/color]
If I change the input to c.1, i.e change the ButtonRead symbol to C.1 it works as expected.
I've tried another 20x2 and got the same result
I've double checked the circuit but can't see any errors, and I'm getting the expected voltages at the pin.
Searching the forum there was a post about silicon error on the base pic but I can't decypher the datasheet to confirm this.
Is my ADC setup wrong, I've checked and double checked but could be going blind.
Help