Tag Archives: ti

ads7813

ADS7813 ADS7812 Arduino Code

Hi, Today I am sharing ADS7813 ADS7812 Arduino Code. <Download>

1. ADS7813 ADS7812: Low-Power, Serial 16/12-Bit Sampling ANALOG-TO-DIGITAL CONVERTER

ADS7813/ADS7812 is a general purpose ADC made by Texas Instrument, and it is pretty easy to operate through SPI. You can see the datasheet from here.

2. Connections

This is the electric connection diagram that I used for my setup. I have used ADS7813 but all configurations are same with ADS7812. Just only difference is that the resolution of ADS7812 is 12bit .

ads7813

 

This electric connection is actually a reference connection provided by TI datasheet. With this connection, I made the Arduino code like this.

3. Arduino code

#include <SPI.h>

const int i_conv = 8;
const int i_busy = 9;

void setup() {
  Serial.begin(9600);

  // start the SPI library:
  SPI.begin();

  pinMode(i_conv, OUTPUT);
  pinMode(i_busy, INPUT);

  delay(100);
}

void loop(){

  bool i_busy_status=1;
  byte data1;
  byte data2;
  digitalWrite(i_conv,HIGH);
  delay(1);
  digitalWrite(i_conv,LOW);
  while ( digitalRead(i_busy) == LOW ){
  }
  data1 = SPI.transfer(0x00);
  data2 = SPI.transfer(0x00);
  digitalWrite(i_conv,HIGH);
  Serial.print(data1);
  Serial.print(" ");
  Serial.print(data2);
  Serial.print("\n");
 
}

I included only very essential part so that you might be easily able to understand the code. I am also attaching the code. <Download>

4. Operation video

This is the video showing the operation.

 

Nowadays I am playing with an Arduino, and I got many helps from communities. I hope this ADS7813 ADS7812 Arduino Code can help your project.