Micro generated clock jitter

Status
Not open for further replies.

col_implant

New Member
Hi,

I'm generating a clock signal with my ADuC842 microcontroller. I am using timer0 overflow and interrupts to toggle an output bit.

I am getting a jitter in my signal of 180ns (or 3 core cycles). In my simulations it appears that the timer overflows always at the same moment. Is there a randomness in the interrupt in terms of core clock? anything i can do to generate a solid clock signal???

Cheers

C
 
Depends on the code you're using, you could easily be using a compare and jump on result instruction that use a different number of instructions depending on the data it's fed. It's easy to correct for, simply and NOP instructions to the portion of the code that is executed too fast. Determining exactly where this needs to happen can be found by single instruction cycling through your code during the interupt where the jitter is present and when it is not.

If I'm not mistaken generally speaking the portion of the code where a compare instruction 'falls through' will be the shorter portion of code compared to when it has to jump to a label, 3 instructions sounds about right, so you just have to put a few nops immediately after the compare falls through to make it the same length as if the code jumps.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…