The above xkcd comic, which is titled Debugger, alludes to the concern that when you try to apply a particular method to itself, you might not get what you asked for. Turing’s Halting problem is a very famous example of this, i.e., you cannot algorithmically decide whether an algorithm terminates on an input. So, does that issue apply to debuggers as well? In particular, I asked myself whether it makes sense to debug the hardware debugger I am developing with itself.
Continue readingTag: logic analyzer
One Line Only
A new Arduino library has seen the light of day: SingleWireSerial. It supports single-wire, asynchronous serial, half-duplex communication. By using the input capture feature of the AVR MCUs, it is extremely accurate and supports bit rates up to 250 kbps robustly. And contrary to its title, one can even use it in a two-wire setting.
Communicating Asynchronously
Serial asynchronous communication is one of the most common forms of communication between two electronic devices. Let us see, what Arduino libraries are there to support it, and let us check, how well they perform.
Continue reading
Is any Input Available?
The SoftwareSerial class has the available() method, which returns the number of characters that have been already received but not yet read. This is very similar to what the standard Serial.available() method offers. There is an interesting difference, though. A call to SoftwareSerial.available() is significantly slower than a call to Serial.available(). We will look for the deeper reason for this strange behavior and I will show you three ways how to fix it.
EDIT: The problem will vanish with Arduino version 1.8.17
Continue reading
Timing the Timekeeper
What is the overhead imposed by the millis() interrupt? And can we get rid of it?
Real Programmers Write Assembly Code
Although the typical Arduino programmer is probably not interested in writing assembly code, in some situations assembly programming is essential. Let’s have a look at these situations and see what one can do.
Continue reading
Doing it the Logical Way
When things go wrong, although your program logic appears to be correct, it is time to look at the signals going into the MCU and coming out of the MCU. The best tool for that is a logic analyzer.
Continue reading