Arduino UNO locking up

Hello there!

See my code below. I compiled it with IDE 1.8.0.
The problem is, that it likes to lock up/freeze the microcontroller. I could not find the specific circumstances when it happens, but generally it happens when cruiseOn is true, and the difference between speed and seedSet is greater then 10 (so the PID would have to correct the the difference).

What I’ve tried up to this point:

  • Not using Strings - Doesn’t make a difference
  • Not using Serial and Strings - doesn’t make a difference
  • qualifying as Volatile those variables which are modified inside the interrupt routines - Doens’t work
  • using the watchdog to reset - works, still not a solution
  • using IDE 1.6.9 to compile - works

Any ideas what might be causing the problem with 1.8.0?

Thanks!

jan-7.ino (6.83 KB)

I never work on the latest release of anything unless there is some specific feature I need that doesn't exist. You realize that by using the latest version of Arduino you are going to be the first to encounter a problem like this. If it works with 1.6.9 then there is absolutely no sin in compiling it with 1.6.9.

I have a couple of projects on my computer right now that require the ancient 0.23 version of Arduino to compile. But they work that way and would be too much trouble to bring up to anything more recent so I keep a version of the old software around to compile them.

So the simplest answer is that if it works with 1.6.9 then use 1.6.9.