Arduino provides a USART driver for treating the data as a stream, basically a never ending sequence of bytes. This follows along a tradition of sorts, basically popularized by UNIX in the 1970’s. However traditional (at the time) computers did I/O by records, blocks or packets, of data. And this is the basic operating method …
I received an email from a purchaser of the PDP-8 Class Project book, Doug Gilliland, who took my design and did an implementation using an Altera FPGA instead of the Xilinx FPGA used in my classes. He also made a custom front panel! Very nice! You can read all about his project here https://hackaday.io/project/179357-pdp-8-fpga. This …
I recently received a request from a reader of my Far Inside The Arduino: Nano Every Supplement. He needed to create a 38kHz carrier modulated at 1kHz for a project he was building with the Arduino Nano Every and was thwarted by available code for the Uno which would not compile on the Nano Every. …
The traditional Harris 1-Wire® bus has a protocol that works well for interfacing using timer interrupts. Every bit transferred is in a single time slot that is always initiated by the microcontroller “master”. And the spacing between bits can be as long as desired, in this case the time between timer interrupts, about 1ms. As …
While writing a chapter on packet data transfer over the USARTs I realized that I could easily aim it more toward a future chapter on MODBUS with a little rewrite, so I did so. It now has timeouts and still works using callback functions, if desired. It makes for really slick demonstration programs! And while …
I’ve been writing about the USARTs and one might first think that all AVR based Arduino boards can be treated the same. However that is not the case. And since some of the example programs in the (future) book involve two boards communicating with each other, there are a large number of combinations I need …
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 …
In the new book I’m writing I’ve implemented a dice game in multiple ways, starting with all the code in-line, with blocking routines and no interrupts. This is the typical Arduino approach. I’ve just completed an interrupt driven version. In this version, the function loop is: Because everything happens in interrupts! Many people think that …