I want to interface the PIC18F2520 with external 16 bit DAC (Example: DAC80501ZDQFR). Please can you support how to send data to the external DAC. Any code snippets to understand.
Internal Voltage reference: +2.5V
uC PIN SDO is connected to SDA
uC PIN SCK is connected to SCLK
uC PIN B1 is connected to SYNC/A0
Earlier I posted a topic for different DAC, but now would like to use this finally.
Thanks in advance.
dyeatman
Joined: 06 Sep 2003 Posts: 1912 Location: Norman, OK
Posted: Fri Apr 05, 2024 12:25 pm
Are you going to keep changing DACs then asking us for help with each one?
If you got the other one going, the same basic code should work for this one with changes to the command byte.
Starting out:
Read the datasheet...the interface is very similar to the earlier DAC.
Next:
For SPI you must tie SPI2C Low
Power on device
Set SYNC High
Then:
If needed, set/change bits in 8 bit command byte (0x08 for DAC output)
set SYNC Low
Output 8 bit command byte
Output 8 bit MSB SPI data
Output 8 bit LSB SPI data
Set SYNC High
Rinse and repeat... _________________ Google and Forum Search are some of your best tools!!!!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum