Hey, folks!
Has anyone seen such an output for a ramp coming out of a DAC?
This is produced by a simple counter counting from 0 to 4095 and then wrapping.
The sharp dips are absolutely stable and deterministic. They occur at bit switches but I don't seem to get my head around why.
Identical curves on two different DAC peripherals on the same μC and even across different chips/boards (I'm almost certain it's a software problem).

Follow

@cweickhmann

Looks like a digital issue, but to rule out analog issues try inserting SW delays in the loop to really slow it down and varying the speed. Also, check the load on the ouput to make sure it's not pulling too much current (you can also vary the load to see if that effects the shape). It's running pretty slow already so it's probably not a capacitance/inductance issue and if there are no changes in the shape when you vary those things then that would rule that out.

On the digital side, that chip has a 2000-page data sheet and I'm not familiar with it, but a quick glance shows that it has two DACs that can be used together in differential mode, so make sure you set it up to use only one of them.

And make sure you're using it in 12-bit mode, not 16-bit mode, to eliminate that as a cause.

Also make sure your VREFA is a well conditioned DC without spikes or dips.

Also, it can use interrupts, so make sure it isn't periodically interrupting.

And of course as others have mentioned make sure the scope sample rate is quick enough (probably not the issue).

@Pat
On the analogue side, I varied the base frequency of the sawtooth and even double-wrote the DAC values in SW to make sure it's not some memory glitch.
Timing (i did not mention that, sorry) is IRQ driven. No other IRQs interfere, that's made sure.
Current-wise, the output is loaded with the oscilloscope directly, which I thought may cause capacitance issues or not allow a high enough current. I've got to verify that. Thanks for that hint!

The DAC is in single-ended mode, actually the two curves are the two DAC channels each in SE. I wonder if that problem would just cancel out in diff-mode. But, wow, that would be useless hardware nevertheless 😅

It's in 12bit mode, dithering and oversampling are explicitly deactivated. And I'm using the internal bandgap VRef. Using a rather unstable external voltage (from USB) as ext. VREF causes fancy psycodelic warping of the curve, but the pattern stays intact.

Scope is >100 MS/s, the signal is ~100kHz.

Thanks again for the brainstorming. I know it's fishing in murky waters, but I just needed input.

I'll check the load and see if that helps.
I still suspect the framework to do something weird in software. My hopes were that maybe someone struggled with a similar chip already and would tell me: Look, there's that one setting/bug and that solved it. So I hope I can be that one in the future 😉

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.