Hello everyone!
I recently bought a TDC7200 EVM with the MSP430F5529 to make it work. I downloaded the GUI and everything works fine.
Now I'm trying to implement a code to make the TDC7200 work with the MSP but without the GUI, just to send the final value to the serial port.
However all I read is ´0x00´or ´0xFF´. I checked the electrical connections, everything is correct. What I'm doing wrong?
#include <SPI.h> /*
PIN DEFINITIONS ARE HERE
*/ void setup(){ Serial.begin(9600); /// delay(1000); Serial.println("Hello"); Serial.println("Starting Setup..."); Serial.println("Defining Pins..."); pinMode (gCS, OUTPUT); pinMode (INTN, INPUT); pinMode (ENABLE, OUTPUT); pinMode (LED, OUTPUT); digitalWrite(gCS,HIGH); SPI.begin(); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV8); SPI.setDataMode(SPI_MODE1); Serial.println(F("Enabling TDC7200")); digitalWrite(ENABLE,HIGH); delay(100); } void loop(){ byte x=0x00; Serial.println("TEST"); //write process digitalWrite(gCS, LOW); // Select device SPI.transfer(0x41); SPI.transfer(0x10); digitalWrite(gCS, HIGH); // Deselect the device delayMicroseconds(10); //small delay to see better the signals in the oscilloscope. //read process digitalWrite(gCS, LOW); SPI.transfer(0x01); // Send read command x = SPI.transfer(0x00); // Read back 8 bits digitalWrite(gCS, HIGH); // Deselect the device Serial.println(x,HEX); delay(100); }