Controlling internal DAC AT90PWM3 using microcontroller

Part list

1x AT90PWM3-16SQ
2x SLO2016 LED display
1x 22uF/25V elco SMD
2x 0.1uF/16V tant. 1206
2x 10 kOhm 1206
3x 100n multilayer 1206
1x coil 10uH SMD
1x rotary encoder (Sharp)

Digital voltage control unit
his is how a value is stored into the DAC registers. First you have to set the voltage reference (REFS0=1 and REFS1=0 means internal reference), which is the same as the ADC reference, and then enable the DAC and the DAC output.

at 90 pwm3 dac
ldi temp, (1<<REFS0) sts ADMUX, temp
ldi temp, (1<<DAEN)|(1<<DAOE)
sts DACON, temp
Now you can set a 10-bit value in e.g. the Y registers and output on pin D2A of the AT90PWM3.
sts DACL, YL

sts DACH, YH
For more detail: Controlling internal DAC AT90PWM3 using microcontroller

About The Author

Ibrar Ayyub

Ibrar Ayyub is an experienced technical writer with a Master's degree in computer science from BZU Multan University. He has written for various industries, mainly home automation, and engineering. He has a clear and simple writing style and is skilled in using infographics and diagrams. He is a great researcher and is able to present information in a well-organized and logical manner.

Follow Us:
Scroll to Top