Marlin
Marlin copied to clipboard
STM32 HAL software SPI bug revisited
Did you test the latest bugfix-2.1.x
code?
Yes, and the problem still exists.
Bug Description
Board is Fysetc spider v2.2 with MAX6675 connected to M8. https://wiki.fysetc.com/PT100_STICK/ is similar to how one would connect MAX6675 or MAX31855. It is the same module with big terminals that comes up with web search. I added
SERIAL_ECHOLNPGM("tc ", max_tc_temp);
to read_max_tc function and turned _temp_error into a no-op so I could debug little easier. Anyway, with the thermocouple disconnected I get values 32764 or 16382 in a random pattern
(gdb) print /t 32764
$1 = 111111111111100
(gdb) print /t 16382
$2 = 11111111111110
(gdb)
MAX6675 datasheet states
it D2 is normally low and
goes high when the thermocouple input is open.
At room temperature I get values like
Recv: tc 920
Recv: tc 452
So it seems that the software SPI just shifts one bit at random.
Bug Timeline
No response
Expected behavior
No response
Actual behavior
No response
Steps to Reproduce
No response
Version of Marlin Firmware
Marlin bugfix-2.1.x
Printer model
Fysetc spider v2.2
Electronics
No response
Add-ons
max6675
Bed Leveling
ABL 3-point
Your Slicer
No response
Host Software
OctoPrint
Don't forget to include
- [X] A ZIP file containing your
Configuration.h
andConfiguration_adv.h
.
Additional information & file uploads
Tried a bunch of things at HAL/STM32/HAL_SPI.cpp SOFTWARE_SPI with no improvement and then just implemented MAX_SUPERSAMPLES with a value of 5 which just reads the thermocouple multiple times and tests shift error against highest of the 5, finally returning the average value. Checked against multimeter thermocouple and it is spot on and super smooth.
This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.
I have not been able to acquire MAX31855 for testing. Random "nop;"'s at softspi.h:receiveBit did not help.
This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.
Also occurs on max31855. I could check the timing with a logic analyzer however...
closing
This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.