I'm running a servo with a PBP routine which use the pulseout funtion to generate the required servo pulse width, followed by a pause to fill out the normal 20 ms servo time frame. A loop keeps the servo running continuously. I keep track of time by counting the number of 50 hz frames. The servo is quiet and moves smoothly in response to changes in pulse width.
In an effort to increase the accuracy of timekeeping, I recently added an Elapsed Timer using DT interrupts. It's a 100 hz timer set up to accumulate seconds and tenths of seconds. It works well. However, the servo is now twitching while the the interrupt routine is running. Why is this? Does PBP use the same Timer1 that the interrupt counter is using? Is there a possible interaction that accounts for the servo's jumpiness? Is there a fix?
BTW, pic is 16F690.
Bookmarks