2017-10-24 09:56 PM
2017-10-24 10:53 PM
When I set update rate to 500ksps, I get triangular wave which has uneven slope. Can anyone tell me what should I do to resolve this and what should I do to get my code running as desired?
Reduce output rate. You ignored the settling time of the DAC, i.e. it's bandwidth.
The F405/407 for example specifies 3 .. 6us.
2017-10-24 11:01 PM
Check for the DAC maximum slew rate, activate the output buffer and remember to check the output signal without loading the output too much (a follower op-amp would simplify things before optimizing).
On my side, I usually use a Timer output compare pin and feed it through the DAC trigger input pin. This way, I can manually play with a jumper wire and debug the DAC manually. If later using ADC, they too uses a different input trigger pin, so it is possible to tune ADC/DAC sampling skew.
2017-10-25 01:19 AM
By output rate, do you mean update rate of DAC? Actually I need DAC running at 1MSPS. Reducing speed of DAC is not an option unfortunately.
Besides, it is mentioned that DAC speed can be as kept as high as 1 MSPS for my board.
2017-10-25 01:21 AM
I already have output buffer activated. So it should not be a problem,right?
2017-10-25 01:41 AM
So it should not be a problem,right?
It is.
Surely you can stuff words faster into the DR register, but the actual DA converter electronics is the slowest element in this chain.
The L476 has a typical settling time of 2us - check the datasheet.
You cannot beat Nyquist.
2017-10-25 02:51 AM
Okay. Got it. So my DAC cannot run at a speed more than 1/settling time which gives 500ksps. Is that right?
2017-10-25 03:06 AM
At least you cannot go faster than the DAC is able to.
I think older datasheets specified in more detail which settling time. E.g. for 1 LSB and for a full-swing change.
For the L476, I have seen just the 2us typical / 5us worst case (always assume the worst ...).
If you need a 1Msps rate, I would consider an external DAC.
But it could become troublesome to achieve the required peripheral data rates.
2017-10-27 09:26 PM
On my side, I usually use a Timer output compare pin and feed it through the DAC trigger input pin. This way, I can manually play with a jumper wire and debug the DAC manually. If later using ADC, they too uses a different input trigger pin, so it is possible to tune ADC/DAC sampling skew.
Very clever! Thanks!