Shop OBEX P1 Docs P2 Docs Learn Events
Will the function COUNT, continue counting where it left off, after an interrup — Parallax Forums

Will the function COUNT, continue counting where it left off, after an interrup

Capt. QuirkCapt. Quirk Posts: 872
edited 2007-03-19 00:48 in General Discussion
I was thinking about JonnyMac's interrupt servo control routine. Since I know almost nothing about interrupts, I was wondering if data collected by COUNT (COUNT RC.0, 1000, rps),·is stored temporarily in "rps" and then restarted at where it left off when the·ISR reverts back to the main program loop?
·
I want to watch engine RPM and control a servo at the same time. Most of the other subs I believe can operate faster than the interrupt calls. But if an interrupt occurs during a SHIFTIN from the ADC, that information would be lost? or not. I wouldn't think missing a couple·SHIFTIN's would matter. But I should·be able to schedule those SHIFTIN's to occur immediately after an ISR return?··

Comments

  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-19 00:48
    Since pulses will continue coming while the ISR is running the count could be off. If you're going to have an ISR, just create a count routine for it. SHIFTIN and SHIFTOUT are not harmed by an ISR, because they are synchronous, not time based.
Sign In or Register to comment.