AndyGadget
Senior Member
I've just spent 2 hours debugging a circuit on the 08m prototyping board, vassilating between suspecting the hardware , the software and the firmware (and the cat's ancestry). I was reading an ADC value, indicating it with TUNE and then setting position of a servo. Very Strange things were happening.
I finally nailed it when I noticed the direction register changing when it shouldn't.
Using the TUNE command (pin 2) sets pin 4 to an output. Demonstrated here :-
Also, READADC does not configure pin :-
Manual entry for READADC states that 'configuration is automatic' but it does not happen in this case. (OK, READADC would only work as an input, but I would read 'automatic' to mean it defines the pin direction as well as enabling it for ADC.)
Both happen on the sim and the chip.
Workaround is to issue an 'input 4' after using 'tune'.
Prog edit 5.2.10
Firmware version 9.2
PicAxe 08m Firmware version 2
Andy.
I finally nailed it when I noticed the direction register changing when it shouldn't.
Using the TUNE command (pin 2) sets pin 4 to an output. Demonstrated here :-
Code:
#picaxe 08m
do
input 4
debug
wait 4
tune 2,2,(0)
debug
wait 4
loop
Code:
#picaxe 08m
output 4
wait 4
do
readadc 4,b0
debug
wait 2
loop
Both happen on the sim and the chip.
Workaround is to issue an 'input 4' after using 'tune'.
Prog edit 5.2.10
Firmware version 9.2
PicAxe 08m Firmware version 2
Andy.
Last edited: