I am using PIC 18 series(8 BIT) micro controller in my project. We are interfacing this microcontroller with DAC-AD5781(18 BIT). I don't know how to write the coding for this (in C language). Can you please help me
with coding.
Simply look at the datasheet. The PIC has an SPI interface, as has the AD5781. The AD5781 wants 24 bits of data so simply send it as three bytes from the PIC. Don't use framed mode on the PIC - you need to keep the SYNC signal low until you have sent all three bytes so control it with an I/O pin driven by software.
I tried in the same manner what you said.I had separated 18 BIT's of data in to 2Byte + 2 BIT data ,I am having doubt that how to convert that 2 BIT data to 8 BIT data .Is there is any appending formulae or procedures for particular PIC 18 series.Can you please help me with coding or tutorial web links like that??