GadgetAngel / MAX6675-V1.1.0-Mod-M

This is Adafruit MAX6675 library version 1.1.0 but Modified to work with LPC176x and Marlin firmware
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

[BUG] (error in max6675.cpp) #1

Open sendel opened 3 years ago

sendel commented 3 years ago

why DELAY_US(1000); when Ardafruit use DELAY_US(10); ?

GadgetAngel commented 3 years ago

why DELAY_US(1000); when Ardafruit use DELAY_US(10); ?

The DELAY_US(number); is dependent on #include "../../../../Marlin/src/HAL/shared/Delay.h" file. This header file has a MACRO definition for DELAY_US on the systick for the MCU it is running on. For the MCUs that Marlin Firmware run on, the DELAY_US(1000) allowed the MAX6675 to run properly without error.

This library "MAX6675-V1.1.0-Mod-M" was written for the use of 3D printers running Marlin code. It was not optimized for speed but reliability so that the 3D printer would not burn up or cause a fire.

If you want to use this library for reading temperatures at a very high rate or speed please feel free to adjust it as you want. But for 3D printers, a temperature change does not occur instantaneously. You are talking about 10 microseconds compared to 1 millisecond. Temperature changes on a 3D printer occur slower than every 1 millisecond,

sendel commented 3 years ago

Thank for your answerd. But I say about only SPI comunication, there are DELAY when read, datas may be distorted. And Its not about how often read temperature MarlinFW.

GadgetAngel commented 3 years ago

Thank for your answerd. But I say about only SPI comunication, there are DELAY when read, datas may be distorted. And Its not about how often read temperature MarlinFW.

If you are getting bad temperature reading then it is not due to the SPI protocol but due to noise on the data line. Try using a capacitor to filter out the noise

GadgetAngel commented 3 years ago

@sendel Here is additional information on how to prevent a noise Thermocouple:


To Prevent a noisy Thermocouple temperature sensor:

G_Thermocouple_Prevent_a_Noisy_Thermocouple_MAX31855 board

URL1: https://learn.adafruit.com/thermocouple/f-a-q#faq-2958381 URL2: https://3dprinting.stackexchange.com/questions/204/how-to-get-consistent-and-accurate-readings-from-thermocouples/355#355