ATSAMD21J18A Issue - SPI returns 0 when running on board, different results when debugging

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I am reading from the MAX31855K IC. I am using SPI to read data from a thermocouple. I am having an issue reading from it, though.

 

Whenever I read from it I either get 0 or 0xffffffff depending on whether or not I am debugging or just running the code on the board. I guess my main question is: Why are my results returning this way? Is the debugger at fault or my code?

im a penguin

Last Edited: Sat. Dec 29, 2018 - 11:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Add a delay between driving the chip select low and doing the SPI transaction, then add a delay before driving chip select high.