Tool/software: TI C/C++ Compiler
Hello,
I'm trying to read data using an Arduino with this chipset, and can't seem to get clean data from SPI & SPI1 using the same SCK. I have no MOSI wired only MISO on SPI and SPI1 and I'm only using one SCK and SS for both. I'm following the diagram bit can't seem to get data from the chip, I'm not sure what address I need to send to get back the values, and then convert them to useable numbers. Here is my code:
byte ssPin = D5; byte ADCA; byte ADCB; byte addressToRead = 0x00; // Not sure what this shoudl be from datasheet void setup(){ Serial.begin(115000); pinMode (ssPin, OUTPUT); SPI.setBitOrder(LSBFIRST); SPI1.setBitOrder(LSBFIRST); SPI.setClockSpeed(24, MHZ); SPI1.setClockSpeed(24, MHZ); digitalWrite (ssPin, HIGH); SPI.begin(); SPI1.begin(); } void loop(){ digitalWrite (ssPin, LOW); // select the device SPI.transfer (addressToRead); SPI1.transfer (addressToRead); ADCA = SPI.transfer(0x0); ADCB = SPI1.transfer(0x0); digitalWrite (ssPin, HIGH); Serial.print(ADCA); Serial.print(ADCB); }