Go Down

Topic: Due : High frequency waveform (up too 500kHz) (Read 461 times) previous topic - next topic

Frodon

Hello,

Does someone know what is the best to provide a waveform up to 500 kHz (DAC or PWM)? If is it possible?

If yes... How ? For example, AnalogWrite is too slow for the DAC...

Thanks for helping

ard_newbie


Hello Frodon,


The best output frequency of DUE DACs is given by the datasheet :

DACC uses its own clock, which is Mck (master clock = 84 Mhz) divided by 2, and needs 25 DACC clock cycles to perform a conversion. Therefore the maximum output frequency is somewhere around 84/2/25 = 1.68 Mhz

See Sam3x datasheet chap. 44.6.1 and 44.6.3


You will find multiple examples of DACC programming on this forum, e.g. :
http://forum.arduino.cc/index.php?topic=205096.0

antodom

Hi there @Frodon,

You can generate a 500 kHz PWM signal using ATSAM3X8E PWM outputs. You can do it easily using library pwm_lib available at:

 https://github.com/antodom/pwm_lib

Have a look to the exampes that come with the library, and if in doubt just ask me.

I hope it helps.
------------
antodom

Go Up