Multiple SPI Devices #765
Replies: 8 comments
-
Posted at 2015-07-05 by DrAzzy Hum, that should definitely work.... Try digitalWrite()ing the cs Pins high before initializing the spi devices? In case they're floating and that's confusing the parts... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-05 by Cale Tried a few combinations including writing cs to 0.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-06 by @gfwilliams Hmm, not sure what to suggest - it's not that it's intermittent? The SD card just refuses to work if the MAX31855 is connected? Are you using the MAX31855 on some kind of module? I'm wondering if maybe the module has level shifting circuitry that doesn't respect the value of CS - so it's always trying to put a voltage on the data line. I guess one way to check would be to leave the MAX31855 connected, but to disconnect just the data out line. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-07 by Cale Attached is a picture of the unit. It is for two thermocouples. I disconnected the cs line and it still sends back data.Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-07 by @gfwilliams What if you disconnect |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-07 by Cale Yes it does!?.......
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-07 by @gfwilliams Ok, I think I know your problem. You've connected CS0 to B10, but have left CS1 disconnected? From the board it looks like there is no pull-up, so if you leave it disconnected it could be any value at all, which means that the second chip is probably trying to use the data pin occasionally - which might also explain your occasional bad readings. Try connecting CS1 to 3.3v. And if it still fails try disconnecting CS0 from B10 and connect it to 3.3v as well. That will stop the sensor working, but it'd be interesting to see if the SD card started working. Just so you know though:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-07 by Cale Alrighty then....that worked! Thank you. Good to know. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-04 by Cale
Should we not be able to have multiple spi devices on the same channel and separately called (CS) ? I have a temperature sensor MAX32855 and a sd card on a Pico. The intent is to have a few temperature sensors recording data to the sd card. Anyways here is the code:
The problem is that the temps usually read fine (though sometimes they give random really high readings?) but when I access the sd card it errors
As soon as I disconnect the MAX31855 then the sd card works fine.........??
Beta Was this translation helpful? Give feedback.
All reactions