Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slower SPI speed for MAX31855 #3888

Merged
merged 1 commit into from
Jun 1, 2016

Conversation

thinkyhead
Copy link
Member

Background: According to investigation by @Grogyan at #3548 the SPI speed is just a little too fast to read the MAX31855 thermocouple reliably. This might also apply to the MAX6675, but we haven't had any reports to that effect. So this PR supplies a patch for the MAX31855 only.

Solution: For the MAX31855 the SPI clock divider is set to 64. The MAX6675 still uses an SPI clock divider of 16.

@@ -1161,7 +1163,7 @@ void Temperature::disable_all_heaters() {
PRR0
#endif
, PRSPI);
SPCR = _BV(MSTR) | _BV(SPE) | _BV(SPR0);
SPCR = _BV(MSTR) | _BV(SPE) | MAX6675_SPEED_BITS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure the sd-library initialises SPCR for every use (read/write) or does it make sense to store it here and restore later

Copy link
Member Author

@thinkyhead thinkyhead May 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering something similar. Would this be moved to the Temperature::init method (to only be initialized once)? Or… is there another approach you have in mind?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't yet know the answer to this, I will merge for now.

@jbrazio jbrazio added this to the 1.1.0 milestone May 30, 2016
@thinkyhead thinkyhead merged commit c6c01ea into MarlinFirmware:RCBugFix Jun 1, 2016
@thinkyhead thinkyhead deleted the rc_slower_max31855 branch June 1, 2016 01:40
@thinkyhead thinkyhead mentioned this pull request Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants