Unused bits in a program counter should be zero. However, sometimes they are not. And in fact, since the bits are unused, their value does not matter, as long as nobody from the outside, such as a debugger, reads them. So, can such bits cause problems for AVR microcontrollers?
Continue readingCategory: Insight
Something you have not known before
Avoiding Mysterious, Silent Failures of Your Arduino Sketch: Push PROGMEM to the far end
Have you ever used an Arduino Mega 2560 (or a similar board) and, at some point in the development process, experienced the LED mysteriously stopping to blink, garbled text being printed, or funny artifacts appearing in pictures? And all that without any apparent reason or any error or warning message? If you want to know what is behind it and how to solve this problem, read on.
Continue reading
Stop-and-Go
One typical debugging activity is setting breakpoints and then running the program from breakpoint to breakpoint, inspecting the program’s internal state at each breakpoint. While this sounds simple, it gets complicated when one looks behind the curtain, which we will do in this blog post.
Continue reading
Interrupted and Very Long Single-Steps
It often happens in embedded debugging that you suddenly end up in the interrupt dispatch table while single-stepping through your code. Another unrelated problem is that sometimes, single steps can take an eternity. In this blog post, I address both issues and describe how to circumvent them in a gdbserver implementation.
Continue reading
Volatility, Race Conditions, And Heisenbugs
What is the purpose of the C++ qualifier volatile? What does it have to do with race conditions, and what are Heisenbugs?
Arduino IDE 2 Meets dw-link
Debugging classic AVRs in the Arduino IDE 2 is finally possible! It took a while to implement this feature, but now it is just a piece of cake to enable debugging and start using the debugger.
Continue reading
The New ATtinys
Microchip launched a new generation of ATtinys. Is it worthwhile to consider them for your next DIY project?
Continue reading
Spontaneous MCU Restarts: Why Do They Happen?
AVR MCUs sometimes appear to restart without you having pressed the RESET button or any other obvious reason. Is that a sign of resilience or of looming danger? How can you find the root cause?
Continue reading
Drifting in the Flow of Time
What happens if you take a dozen clocks and throw them into the flow of time?
Continue reading
ATmega328P: Fake or Real?
Recently, I bought some ATmega328P-PU (DIP packages) chips in China and was concerned that they might be counterfeit, given that three years ago some ATmega328P clones, which did not support nano-power, had been found on Pro Mini boards. The first check looked as if they were fake chips, but apparently, they were the real thing. but they seem to work fine.