Martha MigliacioAlex Wong
Published © GPL3+

Using the Pmod DA2 with Arduino Uno

Application notes for Pmod DA2 and Arduino Uno. In this app, the output voltage of the Pmod is chosen by the user from the serial monitor.

BeginnerShowcase (no instructions)1 hour1,348
Using the Pmod DA2 with Arduino Uno

Things used in this project

Hardware components

Pmod DA2
Digilent Pmod DA2
Arduino UNO
Arduino UNO

Software apps and online services

Arduino IDE
Arduino IDE


Read more


Pmod DA2and Arduino Uno Fritzing file

Fritzing file displaying the connection of the Pmod DA2 to the Arduino Uno.

Pmod DA2 and Arduino Uno Fritzing Image

Fritzing image displaying the connection between the Pmod DA2 and Arduino Uno.


Pmod DA2 and Arduino Uno Code

Using this code will enable the the user to choose the output voltage from the serial monitor.
* Test of the Pmod 
* Description: Pmod_DA2
* The output voltage of the Pmod is chosen by the user from the
* Serial monitor
* Material
* 1. Arduino Uno
* 2. Pmod DA2

#define CS 10 // affectation of CS pin
#include <SPI.h> // Include library
char tableau[4] = {0,0,0,0};
int i = 0;
long valeur;
long consigne;
int consigne_basse;
int consigne_haute;
int val=0;
float tension;

void setup()
 Serial.begin(115200); // initialization of serial communication
 SPI.begin(); // initialization of SPI port
 SPI.setDataMode(SPI_MODE3); // configuration of SPI communication in mode 3
 SPI.setClockDivider(SPI_CLOCK_DIV16); // configuration of clock at 1MHz
 pinMode(CS, OUTPUT);

void loop()
 Serial.println("Enter the voltage in mV on 4 digits then Send");
 while (Serial.available()==0); // wait for data
 for(i = 0;i<4;i++) // Loop to write data in a table
// recomposition du nombre tension
 consigne_haute=consigne>>8; // order high get 4 high bits order
 consigne_basse=consigne&0XFF; // order low get 8 low bits order
 digitalWrite(CS, LOW); // activation of the CS line
 SPI.transfer(consigne_haute); // Send order
 digitalWrite(CS, HIGH); // deactivation of CS line
 Serial.print("La tension de consigne est : ");
 Serial.println(" mV");


Martha Migliacio

Martha Migliacio

5 projects • 16 followers
Alex Wong

Alex Wong

14 projects • 37 followers
I work in Digilent and like creating projects
Thanks to Lextronics.


Add projectSign up / Login