DAC interfacing with Atmega128

adcatmegaavr

Hope you are doing well and solving all your problems!!!

I am new to hardware programming, facing some difficulties to work with DAC interfacing with Atmega128 board. After searching on internet, could not find any any good tutorial or explanation about ADC interfacing with AVR or Atmega. I have Atmega128 connected to DAC8532 through PD4(ICP1), PD5(XCK1), PD6(T1) and PD7(T2) pins of Atmega. I have no idea how to deal with it.

Please, can anyone help or give some suggestions how to programming it.

Thank you very much.

Best Answer

Software Bit bang is possible. Or, Go for SPI with little changes:
Use only MOSI and SCLK of SPI to connect to DAC.
SYNC pin of DAC can be driven low by a GPIO of MCU, while SPI can be configured to transmit data to DAC.
MOSI pin sends out the data in three consecutive writes along with 24 clocks from SCLK.
Assuming CPHASE, CPOL, and LSB First requirements are taken care of in software before initiating the write. Figure 38 in http://www.ti.com/lit/ds/symlink/dac8532.pdf may help.