Jump to content
43oh

Multiple SPI in "parallel" ?


Recommended Posts

Hello everybody,

 

I'm totally new to microcontroller programming, so please excuse my question ;-) I am planning to build up a thermocouple reader for 4 thermoelements.

The stellaris datasheet states, that there are four SPIs available. I would like to use these, to connect four MAX31855 thermocouple ICs on seperate "lines", so that the four MAX31855 do not have to share a single channel. According to some reading in the net, a single temperature reading needs about 100ms of time, so I could make 10 readings a second. Is it possible to make 10 readings a second on all four MAX in parallel, so that I get 4 x 10 readings a second? I would like to use Energia for programming, but I'm not sure how to achive the "parallism" - my guess is, that if one reading needs 100ms, I could only get 2,5 reading per second per MAX31855 if I use four of them, since the temperature reading functions have to be called from inside the loop()-Function and the code examples I saw used delay(100)-calls!?

 

Kind regards,

yosh

Link to post
Share on other sites

Hi bluehash,

 

thanks for your reply. The problem is not, that the readings of the four thermocouples could "be off by a few ms". The problem is, that I want 10 readings/sec on each thermocouple, so 40 readings total per second. So from my understanding this could only be done, if I use four seperate SPI ports - or am I wrong? The 100ms delay in the code examples confuses me ;-) Or do you think it would be sufficent to make the 4 "readTemperature"-calls and then wait the suggested 100ms?

 

Kind regards,

yosh

Link to post
Share on other sites

Thanks for the replies,

 

@bluehash: ok, I'll try it this way - I think I was on the false track regarding the 100ms. Your suggestion makes sense, since the 100ms are only needed for the MAX to "settle down", but a single reading of course will be shorter than this time. So after four polls all sensors have the mentioned 100ms until next reading.

 

@hvontres: Thanks for the hint, I will keep this in mind, e.g. when wiring a SPI-LCD.

 

Kind regards

yosh

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.

×
×
  • Create New...