Latching the input of a DAC - Page 1
Forum section: electronics / beginners

author: raff5184
author_rank: Regular Contributor
timestamp: April 08, 2020, 10:55:55 pm
content: Hi all,I have a DAC AD5300 that I can control via SPI (using an FPGA or a microcontroller) without any problem.I was wondering if the DAC has some form of latching or "memory" where I can somehow store one ore more samples so that the DAC can produce a periodic waveform and I don't need to keep the FPGA on.

author: ogden
author_rank: Super Contributor
timestamp: April 08, 2020, 11:19:35 pm
content: Don't wonder, read datasheet instead. It states that particular DAC have single register meaning it can't produce a periodic waveform

author: raff5184
author_rank: Regular Contributor
timestamp: April 09, 2020, 01:03:37 pm
content: I read it, I'm just not familiar with DACs, indeed my question was in beginner. Thank you though

author: ogden
author_rank: Super Contributor
timestamp: April 09, 2020, 05:59:39 pm
content: Quote from: raff5184 on April 09, 2020, 01:03:37 pmRest assured - when IC have memory, it definitely will be mentioned in the datasheet and shown in the functional block diagram. Example: AD9102. BTW it is what you are looking for, just gigantic overkill (180MSPS, 14bit) compared to AD5300. Better stick with AD5300, put waveform memory in FPGA and consider it done.

author: MarkF
author_rank: Super Contributor
timestamp: April 09, 2020, 06:48:16 pm
content: Quote from: raff5184 on April 08, 2020, 10:55:55 pmShort answer: No. It only has one 16-bit register.If you want to generate a waveform, you need to continuously clock in each sample at a periodic rate.The highest clock rate is 30MHz.Divided by 16 bits per sample is 1.8MHz.Divided by 2 (nyquist freq.) is 937KHz.I would not expect to generate frequencies above 200KHz.A better solution would be to use a DDS chip like the AD9834.

author: ogden
author_rank: Super Contributor
timestamp: April 09, 2020, 07:15:49 pm
content: Quote from: MarkF on April 09, 2020, 06:48:16 pmBetter solution for what exactly? Note that OP did not provide ANY info about frequency range. Not every application require high frequency waveform generation. Sometimes 1KHz or 10KHz is all what's needed. In such case mentioned DAC is fine.

author: raff5184
author_rank: Regular Contributor
timestamp: April 09, 2020, 09:01:14 pm
content: I need to generate a PWM at 100Hz and 60us of pulse. So most of the time the DAC is mostly outputting a 0V

author: ejeffrey
author_rank: Super Contributor
timestamp: April 10, 2020, 01:29:12 am
content: Generally you wouldn't use a dac to emulate pwm. Any FPGA or microcontroller can do that natively. An external level shifter if needed is a lot simpler than a DAC.

author: MarkF
author_rank: Super Contributor
timestamp: April 10, 2020, 08:13:46 am
content: Quote from: raff5184 on April 09, 2020, 09:01:14 pmI did something close to that for a model railroad throttle using a pic16f876a. It is at 200Hz with 128 steps (40us) using a timer interrupt. The reason I didn't use the built-in PWM is because I also wanted adjustable amplitude. For certain conditions, I turn off the PWM and have a pure DC output level.This gives me better speed control of the locomotive based on its motor and loco weight.

author: Ian.M
author_rank: Super Contributor
timestamp: April 10, 2020, 10:28:50 am
content: Quote from: MarkF on April 10, 2020, 08:13:46 amAlternatively, kick up the PWM frequency to the max your device can generate with the required resolution and switch in a low-pass filter, e.g. by switching an IO pin connected to the 'earthy' side of the filter capacitor between tri-state and output low, to get a nearly pure DC variable output.However if you *REALLY* need full control of *ALL* PWM output parameters, it may be worth considering two buffered DACs and a PWM controlled analog switch to let you set both the ON and OFF state levels.

author: MarkF
author_rank: Super Contributor
timestamp: April 10, 2020, 01:54:26 pm
content: Quote from: Ian.M on April 10, 2020, 10:28:50 amAll of which requires more hardware to maintain. Which adds up when you have 40 outputs.I now have full software control of the waveform shape for two track blocks with:- A PIC16F276A driving a dual D/A (MCP4802) and a dual op-amp (LM358).- Ending with two comparators (LM393) for occupancy detection.During my initial design, I wasn't sure what kind of waveform would be best.At the time (prior to DCC control), HO railroads were using DC, rectified AC or PWM.My design allows me the flexibility to generate any waveform I want. Even non-linear scaling of the output.The switch from PWM for low speeds to pure DC at high speeds is to reduce motor heating.I'm still playing around with the constant brightness lighting for the locomotive.I could up the PWM frequency and that may be something to experiment with.However, I don't want to hijack this thread.