Jump to content
Sign in to follow this  
leahy268

Tiva C and Max31865

Recommended Posts

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...

Share this post


Link to post
Share on other sites

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
}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...