Dear Friends,
I am new to this Forum. I have been trying to interface a TI ADC chip ( 12 bit ) via SPI. The data format is I have to send a 16 bit command followed by a 16 bit response from the ADC chip.
This is a simple code I have written in the indefinite loop :
Serial.println("Chan-0");
digitalWrite(ADC_CS, LOW);
//Send in command byte
result[0]=SPI.transfer(0x18);
result[1] =SPI.transfer(0x4F);
result[2] =SPI.transfer(0x00);
//Disable device
digitalWrite(ADC_CS, HIGH);
Serial.println(result[0],HEX);
Serial.println(result[1],HEX);
Serial.println(result[2],HEX);
Can anybody please let me know if the format of sending the SPI data is correct for a 16 bit data command from the master as well to receive the 16 bit data from the slave.
Any help is appreciated.