How to use a DAC on a PWM input generated by timer interrupts?

658 views Asked by At

I'm using a 12-bit Linear LTC2631 DAC, and wish to convert my PWM signal to an analog one via I2C. I am currently not able to come up with an algorithm, and how would the the DAC need to programmed to take in the PWM input and then generate an output. I'm using a Pro Micro 3.3V board.

Any help would be appreciated, including stuff over the internet which I could read up?

Thanks!

2

There are 2 answers

0
prt On

Yes, if you have PWM signals then you don't need to have a DAC at all.just attach a low pass filter after PWM and you will have analog signals. But if you want to use any I2C DAC you can just provide it binary numbers and it will automatically convert into analog signals. PWM and DAC both are different method of generating analog signals you don't need to combine it.

0
German On

If you're going to use an I2C DAC IC like the LTC2631 you don't need PWM at all. You just pass a binary value to the IC via I2C and it will be converted to an analog voltage. If you want to use PWM to generate an analog signal you might want to filter the output so it doesn't look all square. Take a look at: http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/ and: http://www.avdweb.nl/arduino/hardware-interfacing/super-simple-dac.html

Best.