3

I have a 3d printer that has the ability to read the gcode from the sd card so it knows what to print.

I have added to this a MAX6675 thermocouple driver. I believe the sd card shares the same spi bus. I am getting major problems with temperature readings shouting up and down when I'm printing.

since they both have to in real-time i.e. ideally no delay could my woes be because the arduino (mega 2560) is simply struggling to do both at the same time hence the temperature goes down then shoots up when the SPI is available again?

The max6675 is meant to be support by the marlin firmware. Am guessing they didn't mean it to be used in conjunction with the sd card reader.

[moderator note
The original title of this question was: "Two slave devices on the same SPI bus. What are the limitations?"
On closer examination, however, this turned out to be an analog thermocouple problem, rather than a digital SPI problem.]

Nick Alexeev
  • 37,739
  • 17
  • 97
  • 230
Ageis
  • 3,311
  • 13
  • 44
  • 67
  • 1
    There shouldn't be any problem sharing an SPI bus as long as you make sure that only one chip select line is active at a time. And if there were a logic problem like that, then I would expect everything to just completely fail (since both devices would be seeing invalid data). I agree with @NickAlexeev that this is probably a thermocouple problem. Possibly interference from the motor being picked up by the thermocouple amplifier? – Evan Dec 10 '16 at 00:59
  • 1
    An exchange on the SPI bus typically takes a few tens of microseconds. I doubt the temperature has the time to drop significantly with that. – dim Dec 10 '16 at 04:11
  • I have a heater block which where is the pla material gets melted. Its essential a block of aluminium i believe. Is it ok for me to stick the bare ended themocouple into the hole where the thermistor used to be ? The ones i have seen have a metal cap over the hot junction – Ageis Dec 10 '16 at 09:27
  • Thermocouples are constructed from conductive materials. Sometimes they are insulated, and sometimes not. Does yours look like a tiny melted bead where two wires were fused together? – user57037 Dec 10 '16 at 09:56
  • Yes. The junction is exposed. So it looks like someone has soldered them together but badly – Ageis Dec 10 '16 at 17:41

1 Answers1

1

Chances are that this is a thermocouple issue. I doubt that this is an SPI bus issue.

MAX6657 is intended for a a floating thermocouple. When you connect the tip of the thermocouple to the aluminium block, it's no longer floating.

We have a thread about floating vs grounded thermocouple. See this answer and the discussion in the comments under it.

Nick Alexeev
  • 37,739
  • 17
  • 97
  • 230