RETURN should only be used when you GOSUB to get there.Code:inp: if but=1 then mem1=mem1+1 endif if mem1>12 then mem1=1 endif write eep1,mem1 return <<--- return to where? Maybe GOTO Init?
Also this;
May also lead to trouble. It can cause read-modify-write. Sometime it's best to write to the whole port at once instead of multiple high low statements together.Code:high stops low turnsign low bottom
What happens if you place a PAUSE 500 after each line where you try to set or clear turnsign?
Sometimes there may be a little more capacitance on one output than others, and setting of clearing port bits one-after-another will cause read-modify-write. The value you expect on an output may not be what you expect since the 2nd bsf or bcf operation causes the previous pin to be read back (before it has changed) and written back to the pin.




Bookmarks