Pongo
Senior Member
I've been tearing my hair out trying to catch an elusive bug in a large 20x2 program. Seems like I have a misunderstanding of single mode hpwm. The issue is that "something" is taking C.2 low after it has been set high. Chipping away at the code I've reduced it to this snippet that demonstrates the problem.
Unless the hpwmout line is commented out, C.2 goes low when the readtemp12 C.4 happens. I thought a setting of %0001 would leave all pwm pins except A (C.5) unaffected. I've been using this code a long time but now need to add an LED on C.2 and came across this issue.
To add to the mystery if there is no DS18B20 connected to C.4, C.2 stays high.
Unless the hpwmout line is commented out, C.2 goes low when the readtemp12 C.4 happens. I thought a setting of %0001 would leave all pwm pins except A (C.5) unaffected. I've been using this code a long time but now need to add an LED on C.2 and came across this issue.
To add to the mystery if there is no DS18B20 connected to C.4, C.2 stays high.
Code:
#picaxe 20x2
#Terminal 9600
#No_Table
#No_Data
Symbol Heat = w8
w8 = 0
hpwmout pwmdiv4,0,0,%0001,207,Heat ' setup for the pwm output (drives FET)
High C.2
Main:
readtemp12 C.4,w1
SerTxd (#w1)
SerTxd( CR, LF )
Pause 500
goto main