??? 04/10/09 20:00 Read: times |
#164524 - I suspect that your ISR is longer than 1msec! Responding to: ???'s previous message |
Add a CPL x,p instruction to your timer ISR to toggle a free port pin (Port x,y) and check pin x,y by the help of scope, frequency counter or even an ear phone driver. If the timer ISR really ticks every 1msec, then you must be able to detect a crystal clear 500Hz square at pin x,y.
As Per already asked, why is your timer ISR lasting so long - "close to 1msec" as you mentioned - if you only move the stepper by one phase? When in the ISR do you clear the TF2 flag? If at the end and the ISR is lasting longer than 1msec you will miss timer ticks. Check it by the above scheme! Kai |