Hi,
I have this code for the 12F683 pic (4mhz int clock):
Code:
TRISIO = %00000000
conta var byte
ciclos var byte
pasos var byte
red var gpio.1
green var gpio.2
blue var gpio.4
ciclos=10
pasos=16
high red 'this goes to low unexpectedly when the following for-next is executed
low blue
low green
for conta=0 to 255 step pasos 'blue rise
pwm blue, conta, ciclos
next conta
high blue 'this goes to low unexpectedly when the following for-next is executed
for conta=0 to 255 step pasos 'red fall
pwm red, 255-conta, ciclos
next conta
low red
'rest of the program removed
end
I expect:
1st loop
red remain high while 1st for-next is executed
blue increase till high
2nd loop
blue remains high from last loop
red decrease till low
what happens
no matter the previous state of the port, when it enters a loop only the port being incremented/decremented is high, the other is low.
what can be wrong?
Thanks in advance
Bookmarks