{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/3548","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/3548/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/3548/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/3548/events","html_url":"https://github.com/MarlinFirmware/Marlin/issues/3548","id":149057530,"number":3548,"title":"Marlin Communication Crash RC5 + MAX31855","user":{"login":"Grogyan","id":6621978,"avatar_url":"https://avatars.githubusercontent.com/u/6621978?v=3","gravatar_id":"","url":"https://api.github.com/users/Grogyan","html_url":"https://github.com/Grogyan","followers_url":"https://api.github.com/users/Grogyan/followers","following_url":"https://api.github.com/users/Grogyan/following{/other_user}","gists_url":"https://api.github.com/users/Grogyan/gists{/gist_id}","starred_url":"https://api.github.com/users/Grogyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grogyan/subscriptions","organizations_url":"https://api.github.com/users/Grogyan/orgs","repos_url":"https://api.github.com/users/Grogyan/repos","events_url":"https://api.github.com/users/Grogyan/events{/privacy}","received_events_url":"https://api.github.com/users/Grogyan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Bug:%20Invalid","name":"Bug: Invalid","color":"eeeeee"},{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Support:%20Question","name":"Support: Question","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":35,"created_at":"2016-04-18T06:43:29Z","updated_at":"2016-05-03T02:22:47Z","closed_at":null,"body":"RAMPS 1.4\r\nFull Graphic Display\r\nMAX31855\r\n\r\nNow that my printer is up and going, I have tried several ties to do a rather longish print, which should take about 1 hour.\r\nWith every try the print abruptly stops, randomly, then giving the error below;\r\n```\r\nError: MAXTEMP triggered, system stopped! Heater_ID: 0\r\n```\r\nI don't know if any changes from RC5 to RC6 would affect this, but does seem like the temperature monitoring gets prematurely interrupted, so I don't know if it is related to the ISR."},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/216418752","html_url":"https://github.com/MarlinFirmware/Marlin/issues/3548#issuecomment-216418752","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/3548","id":216418752,"user":{"login":"thinkyhead","id":698003,"avatar_url":"https://avatars.githubusercontent.com/u/698003?v=3","gravatar_id":"","url":"https://api.github.com/users/thinkyhead","html_url":"https://github.com/thinkyhead","followers_url":"https://api.github.com/users/thinkyhead/followers","following_url":"https://api.github.com/users/thinkyhead/following{/other_user}","gists_url":"https://api.github.com/users/thinkyhead/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkyhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkyhead/subscriptions","organizations_url":"https://api.github.com/users/thinkyhead/orgs","repos_url":"https://api.github.com/users/thinkyhead/repos","events_url":"https://api.github.com/users/thinkyhead/events{/privacy}","received_events_url":"https://api.github.com/users/thinkyhead/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T02:22:47Z","updated_at":"2016-05-03T02:22:47Z","body":"Another report I've gotten says that the problem only manifests when the E axis is moving. So here's an idea. Let's try turning off interrupts while reading the sensor in the `read_max6675` function:\r\n```cpp\r\n    CRITICAL_SECTION_START;\r\n\r\n    WRITE(MAX6675_SS, 0); // enable TT_MAX6675\r\n\r\n    // ensure 100ns delay - a bit extra is fine\r\n    asm(\"nop\");//50ns on 20Mhz, 62.5ns on 16Mhz\r\n    asm(\"nop\");//50ns on 20Mhz, 62.5ns on 16Mhz\r\n\r\n    // Read a big-endian temperature value\r\n    max6675_temp = 0;\r\n    for (uint8_t i = sizeof(max6675_temp); i--;) {\r\n      SPDR = 0;\r\n      for (;!TEST(SPSR, SPIF););\r\n      max6675_temp |= SPDR;\r\n      if (i > 0) max6675_temp <<= 8; // shift left if not the last byte\r\n    }\r\n\r\n    CRITICAL_SECTION_END;\r\n```"}}