Jump to content
  • 0

RPi and Digilent PmodDA2


Matthias

Question

Hi,

As a part of a project in university, i have to send Data from the Raspberry Pi 2 to the Digilent PmodDA2 using C/C++. For that, i tried to use the bcm2835 library, which can only send 8 bit at a time. The PmodDA2 is a 12 bit device (integer values form 0 to 4095), so how can I transfer alle the bits? In the DACSPI2 Library Reference Manual (functions for Arduino) it even says "this function writes the 12 bits value to the DA converter, by writing 16 bits to SPI..." - so do I have to send 16bits? What do the missing 4 Bits look like then?

What's more, I need information about the clock polarity, the clock phase and if the chip is active at HIGH or at LOW.

Thank's a lot!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Hi Matthias,

The bitstream that the PmodDA2 expects to receive is nicely outlined in it's reference manual here, with the first two bits as 'don't cares', the next two bits as values to set some features of the on-board chip, and the remaining 12 bits as the datastream (MSB first). Likely you will want the first four bits to all be 0's for normal operation, which is why the library doesn't seem to have anything significant about transferring data to the PmodDA2.

The TI chip (DAC121S101) is active LOW, and looking at it's datasheet on page 9, it looks like to me that it follows (using the PIC and ARM convention) SPI Mode 1 (CPOL = 0, CPHA = 1).

Let me know if you have any more questions.

Thanks,
JColvin

Link to comment
Share on other sites

As a part of a project in university, i have to send Data from the Raspberry Pi 2 to the Digilent PmodDA2 using C/C++. For that, i tried to use the bcm2835 library, which can only send 8 bit at a time. The PmodDA2 is a 12 bit device (integer values form 0 to 4095), so how can I transfer alle the bits? In the DACSPI2 Library Reference Manual (functions for Arduino) it even says "this function writes the 12 bits value to the DA converter, by writing 16 bits to SPI..." - so do I have to send 16bits? What do the missing 4 Bits look like then?

Link to comment
Share on other sites

Hi @athman8,

According to the reference manual for the Pmod DA2 in the Interfacing with the Pmod section, the first 4 bits will consist of two don't care bits followed by two bits that specify the power-down mode. Most likely you will want to keep the power down bits as both 0's as this will keep the Pmod in Normal operation mode.

Let me know if you have any other questions.

Thanks,
JColvin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...