When considering communication between or among microcontrollers, I’ve discouraged use of the SPI interface because of its lack of a buffered interface in all but the ATmega4809 Ardruino AVR-based boards. However the handshaking protocol built into the I2C standard interface makes I2C communication a safe, reliable choice. (The I2C interface is called TWI in the …
Most I/O in a microcontroller (like in an Arduino board) consists of transactions. The microcontroller sends a command or a command plus data to a peripheral device and then, perhaps after a short delay, the device sends a response of status and data back to the microcontroller. The Arduino library tends to have only blocking …
My final dice game example for the new book uses FreeRTOS. There are three independent (non communicating) tasks, to keep things simple, rather than breaking down the game itself into multiple communicating tasks. There is the game task, a flashing light (“blinky”) task, and a background task used to measure performance, like I did with …
This book will be a catch-all for a number of topics on my mind. The family of Arduino boards. As basically revealed in previous posts, I want to address all of the AVR-based boards that are general purpose. Example programs will work on all boards (328P, 2560, 4809, or 32U4 based) even though programmed at …
Before considering the code, we need to consider what we are trying to accomplish. Commands for the TM1638 consist of a command byte followed by zero or more data bytes. Sometimes the microcontroller sends the data, other times it receives data, and in either case there is a single data wire used (MOSI and MISO …
For my next book I wanted an example program that had the need for lots of 7-segment display digits, buttons, and LEDs. I found what I wanted, at a low cost, in one of these: This has 8 7-segment (plus decimal point) digits, 8 LEDs, and 8 push buttons, and used a three-wire SPI interface. …
For those people unfamiliar with Pins.h, presumable those people who haven’t purchased Far Inside The Arduino or Far Inside The Arduino: Nano Every Supplement, this file describes a structure over the GPIO pin interface that is much more efficient than using pinMode, digitalRead, and digitalWrite. For instance, we can execute ddr.digital_2 = 1 to change …
This post was intended to compare the different general purpose Arduino boards. However I’ve been slowed down by the week of fires and hazardous air here in Oregon. I haven’t completed my investigation of the ATmega32U4 yet, and, in fact, my sample Arduino Micro, which uses this microcontroller, was delayed over a week in arrival. …
Basically, “General Purpose” means those consisting of little more than the microcontroller, USB interface, and voltage regulator. In my last post I mentioned the Uno as the base-line board, with the historical lineage from the original Arduino board. But today you can get many different boards differing in size and microcontroller. In my next book …
In looking at the different general purpose Arduino boards available today, I’ve been thinking of how to tie them all together. So I’ve delved as well as I can into the history of Arduino boards. Frankly, it isn’t particularly easy to do. But I did find what appears to be the starting point — the …