Interfacing parallel DAC IC to arduino UNO

Hi

I need help regarding my project in which I have to interface 12 bit parallel DAC IC (AD767 DATA SHEET ATTACHED) to my arduino uno.

it use atleast 13 pins from arduino UNO to write data on DAC IC. The data is from sensor and uno reads it Using its 10 bit ADC. the data is then processed and will be written on 12 digital pins connected with DAC.

Now the main issue is how i can write and integer value or float value (data after processing) to 12 digital pins ?

also if i use spi interface (mosi, miso, sck) pins to program my arduino then can i use these pins for writing data on dac because uno only have 13 diigital pins?

AD767.pdf (622 KB)

because uno only have 13 diigital pins?

No all the analogue pins can also be used so your Uno has 20 digital pins. You forgot pin zero.

how i can write and integer value or float value

Forget floating point, that is meaningless in this context. To write an integer you need to use direct port addressing, and split the integer into two parts because the ports are only 8 bits wide. You split it up using and operations as well as shift operations.

On the ATmega328 based Arduinos like the Uno, the port-pin map is:

D0..D7 = port D
D8..D13 = port B[0:5]
A0..A5 = port C[0:5]

Putting a 12 bit value onto digital pins 2 to 13 would be done thus:

void DACout (int val)
{
  PORTB = (val >> 6) & 0x3F ;
  PORTD = ((val << 2) & 0xFC) | (PORTD & 0x03) ;
}

(Having first made them all outputs).

BTW: why a parallel DAC?

1 Like

Hi,
My question is the same as @MarkT , why parallel DAC, have you though about a port expander to interface the DAC?

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom.. :slight_smile:

thanks @Grumpy_Mike @MarkT @TomGeorge for ur replies

@MarkT @TomGeorge. the idea to use parallel DAC was based on availbility (short time for project completion), and its speed and onchip buffer.

I can also use DAC with SPI , I2C but then have to work on that to figure out the the one we require. In the next step will work on that .

do you have any good suggestion ?

"electronics, programming, arduino, hardware experience" not that much

can also use DAC with SPI , I2C but then have to work on that to figure out the the one we require.

That will actually depend on what you are trying to do with it, that is how fast it needs to work.
Direct connection in parallel is the fastest, followed by SPI and finally I2C plods on behind.
But that chip you posted the data sheet to can’t work with SPI or I2C.