Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top