leahy268 0 Posted May 27, 2016 Share Posted May 27, 2016 Hi everyone, Long time reader rare poster. So anyway long story short. I have been trying to get my SSI module working with this for about 2 weeks with the Max31865. On my logic analyser I am definitely getting signal. I have been trying every code sample that I can find both energia\arduino samples and any others that I can find. However as all that I get back from it is 0x00's or 0xff's I think I'm missing something. Does anyone have any sample code that definitely works on Tiva? I own a tm4c123 launchpad. Nothing I can do seems to work. I don't know if it's the max31865 or my Tiva is broken or what the problem is. I am planning on borrowing a raspberry Pi which I do have working code for to test the max31865 board. Thanks in advance for anyones help... Quote Link to post Share on other sites
spirilis 1,265 Posted May 27, 2016 Share Posted May 27, 2016 Maybe the wiring is wrong? I have no issues talking to a MAX31855 with my Tiva LP fwiw. I don't know anything about the MAX31865 but I'd be shocked if it worked much different... Be sure the Chip Select line is left in a HIGH state when inactive and pulled low before any SPI comms. e.g. if the MAX31865 CS line is connected to pin 4, void setup() { pinMode(4, OUTPUT); digitalWrite(4, HIGH); // set INACTIVE SPI.begin(); Serial.begin(115200); } void loop() { // Read from the chip digitalWrite(4, LOW); // MAX31865 is now ACTIVE and will clock out bytes uint8_t fourbyte[4]; fourbyte[0] = SPI.transfer(0); fourbyte[1] = SPI.transfer(0); fourbyte[2] = SPI.transfer(0); fourbyte[3] = SPI.transfer(0); digitalWrite(4, HIGH); // Deactivate MAX31865 so it releases MISO line for other SPI devices. Serial.print("Output: "); int i; for (i=0; i < 4; i++) { Serial.print(fourbyte[i], HEX); Serial.print(' '); } Serial.println(); delay(1000); // wait 1 second then do it again } yyrkoon 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.