Magnus, This will certainly give an improvement, but even the shortest possible loop will have a built-in jitter that cannot be removed, particularly if you take into account the additional cycles needed to access the timer peripheral. Unfortunately, I don't have figures for this, as they've long since been discarded (we analysed the o/p signal for noise in various frequency bands), but from memory even a couple of clock cycles jitter had a significant effect. Of course, a lot depends on what your trying to achieve: just reduce some annoying hiss in a self-build project it might be fine. Brendan -- In lpc2000@yahoogroups.com, "Magnus Lundin" <lundin@m...> wrote: > > Hi > > Another way to remove jitter is to read the timer in the interrupt > routine and loop on this until a predefined value, the number of > clock ticks when there is maximal latency at this point in the > interrupt routine, has passed since the timer rollover. > This can be done just before outputing the samples or at the beginning. > > This uses the interrupt to place the clock at almost the right time > and the a wait loop on the timer counter for precise adjustment. > > Magnus > > --- In lpc2000@yahoogroups.com, "brendanmurphy37" > <brendan.murphy@i...> wrote: > > To get rid of jitter, you should code your o/p interrupt so that the > > code from the start of the interrupt through to where the sample is > > o/p has no "if" statements or similar (i.e. it must execute the same > > number of instructions for each interrupt). You then have to try and > > ensure that the program being interrupted is always on an instruction > > that takes the same number of cycles to execute. One way of doing > > this is to set up a timer interrupt to happen just before the o/p > > time. We use this approach, and jump to a (lot of "nops"). Karrl's > > suggestion (go to idle mode) is probably better than this, as it > > saves code space). The "real" interrupt can then be used to knock you > > out of this to o/p the sample. This will not remove jitter entireley, > > but it makes a significant difference. > > >
Message
Re: D/A noise
2006-01-20 by brendanmurphy37
Attachments
- No local attachments were found for this message.