K22F DAC glitches when crossing midpoint

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K22F DAC glitches when crossing midpoint

580 Views
scottm
Senior Contributor II

I'm using the MK22FN1M0AVLH12's 12-bit DAC for audio output and I'm seeing a consistent glitch in the DAC's output.  Every time the signal crosses the midpoint of the DAC's range I get a brief (~0.7 us) excursion of about +60 mV.

I've got it sending samples via DMA, and the DAC's buffer is enabled.  To rule out a problem in my reconstruction filter I've removed it completely; I'm just measuring straight from the DAC.  I set it up to do a slow ramp across the full range and the problem is consistent.

0.7 us is consistent with the code-to-code settling time given in the datasheet but I'm surprised by the amplitude of the glitch.  Is there a way to reduce this?

Thanks,

Scott

Labels (1)
Tags (2)
2 Replies

468 Views
mjbcswitzerland
Specialist V

Scott

I believe that there was a similar discussion about 2..3 years ago and I also could reproduce a similar effect when I tested at the time (not sure on which part but possible a KL processor). Unfortunately I haven't been able to locate the thread anymore.
Try avoiding the mid-point value (round up or down to next possible) since if I remember correctly not using the value that causes the jump meant that it was then more or less worked around.

Regards

Mark

468 Views
scottm
Senior Contributor II

Yeah, I was going to give that a try and see if it's the code itself or if it's the transition across the midpoint that's causing the glitch.  Fortunately the way my code is set up, the audio is all run through a lookup table anyway to handle volume level adjustment so avoiding a code won't cause a performance hit.

Now, what I'd really like is a lookup table function built into the DMA controller, even if it was limited to a small block of dedicated RAM.  That would make some of this stuff way more efficient...

Scott

0 Kudos