I am setting a a RPI3 with Nerves and want to read a thermocouple Type K using the MAX6675 chip. I am a bit confused whether I should hookup the MAX6675 to the PI’s SPI master pins, or??
Ultimately what I want to do is read 4 different temperature probes using 4 unique MAX6675 and using GPIO pins to switch between them. For now, if I could get some traction in just reading input from one of the devices, I could build from there.
Look at the datasheet, it has a figure for a typical SPI connection.
This should get one unit working. Seems you could connect each «CS» pin to a GPIO then connect the SPI in parallel. But the «SO» pin is not stated to be tri-state, so you cant assume that it can be connected in parallel. I guess either some transistor connection or buffer circuits may be necessary to achieve that. Or maybe do some tests with the oscilloscope, because the timing diagram does hint that «SO» is tri-state, even though there is no explicit mention of it.
You may use bit banging for this chip, as the data rate seems pretty low
Thanks for the input. Almost a complete noob, but I think I understand what you are saying. Seems like a good start would be to get one of the chips working. I was originally planning on toggling CS with GPIO, so what you are saying makes sense. I guess I need to just start playing with it to learn more. There are Arduino examples out there that do similar things, so I can always translate. I was hoping that someone had already walked down this path and would have some code to ‘share’.