I am new to PICAXE and have run into a problem using the debug feature with my 08M. To do my testing/programming, I am using the AXE021. I am trying to read the voltage off a Li-ion battery which outputs about 4.2V in its current charged state. To power my 08M I am using an old cell phone charger that outputs a very constant 5.142V. From what I understand, when using the readadc/readadc10 command, the chip scales the bit value from 0=0V and 255 or 1023 equal to the voltage of the power supply, in this case 5.142V. After doing the math, I come out that the chip should read either ~210 bits for 8-bit or ~860 bits for 10-bit. Now starts the problem.
1. After programming the 08M using the PICAXE Programming Editor, the debug screen opens and the variable I assigned for the input value fluctuates wildly from about 50-200 bits when reading in 8-bit, and between about 300-700 bits when reading in 10-bit. This is when the Li-ion is DISCONNECTED. When connected, the value maxes out at 255/1023. This is still with the AXE021 jumper in program mode.
2. When I switch the AXE021 jumper to out mode, I cannot establish a connection with my PC to run in debug mode, so I cannot vouch for the values in this mode.
I cannot tell if my problem is rooted with my inability to debug when the board is in "out" mode, or if it is something else. Any help with this matter will be greatly appreciated. Thanks!
1. After programming the 08M using the PICAXE Programming Editor, the debug screen opens and the variable I assigned for the input value fluctuates wildly from about 50-200 bits when reading in 8-bit, and between about 300-700 bits when reading in 10-bit. This is when the Li-ion is DISCONNECTED. When connected, the value maxes out at 255/1023. This is still with the AXE021 jumper in program mode.
2. When I switch the AXE021 jumper to out mode, I cannot establish a connection with my PC to run in debug mode, so I cannot vouch for the values in this mode.
I cannot tell if my problem is rooted with my inability to debug when the board is in "out" mode, or if it is something else. Any help with this matter will be greatly appreciated. Thanks!