Traumflug / Teacup_Firmware

Firmware for RepRap and other 3D printers
http://forums.reprap.org/read.php?147
GNU General Public License v2.0
312 stars 199 forks source link

temp_sensor_tick() has unnecessary MAX6675 call to delay(1). #22

Closed JTrantow closed 12 years ago

JTrantow commented 12 years ago

temp_sensor_tick() does not need to call delay(1) to ensure a 100nsec delay. I debugged an issue with the Marlin firmware where the MAX6675 was read during an interrupt and this one msec delay would eventually cause Marlin to lock up when using the MAX6675. I scoped the SCLK and SS lines and the Atmel master is holding off SCLK 610nsec all by itself which satisfies the MAX6675 timing without any additional delay.

I highly recommend dropping the delay(1) line from temp_sensor_tick().

Traumflug commented 12 years ago

Thanks a lot for the suggestion, JTrantow. See https://github.com/triffid/Teacup_Firmware/commit/886bacdbe483059f1926382a28edd4cd53c95a77

Traumflug commented 12 years ago

Apparently resolved. If not, feel free to reopen the issue.

JTrantow commented 12 years ago

Resolved is correct. I have been printing with this fix for about two months and this corrected the stop while printing problems. It might make sense in the issue tracking to fill in some blanks as to the options in use. This problem would only occur with the max6675.

Do you have any influence on Marlin code? I submitted this issue and one for the toshiba drivers, but I don't think either have been adopted into the trunk which is a shame. On Jul 15, 2012 8:16 AM, "Traumflug" < reply@reply.github.com> wrote:

Apparently resolved. If not, feel free to reopen the issue.


Reply to this email directly or view it on GitHub: https://github.com/triffid/Teacup_Firmware/issues/22#issuecomment-6991585

Traumflug commented 12 years ago

Do you have any influence on Marlin code?

Only as far as I continue to maintain Teacup, so people see how things can be done better :-)

JTrantow commented 12 years ago

Yes, I think the TeaCup code is a little easier to understand. Initially, I had some print problems with Teacup so I switched to Marlin and I have been too lazy to switch back. In hindsight, I think my print problem was just the acceleration setting.

I noticed in your TeaCup code that you check the MAX6675 diagnostic bits and set some flags. However, It didn't look like you used the flags and I didn't trace the code to see if you shut down the heater if the MAX6675 fails? Seems like you should return a large temp value to shut down heaters using the failed TC.

On Thu, Jul 19, 2012 at 10:04 AM, Traumflug < reply@reply.github.com

wrote:

Do you have any influence on Marlin code?

Only as far as I continue to maintain Teacup, so people see how things can be done better :-)


Reply to this email directly or view it on GitHub: https://github.com/triffid/Teacup_Firmware/issues/22#issuecomment-7100743