Posts

How to read codes from (many) IR remote controls with as little code as possible

Image
Background Inexpensive infrared (IR) remote controls have been ubiquitous in our lives for many many years. This is because the technology is inexpensive and works so well that it fades into the background. The IR signal gets 'sprayed' (transmitted/reflected/received) so effectively in most indoor environments that you rarely have to care in which direction the LED is pointing and it somehow 'just works'. The clever inventors of the technology discovered that by modulating the digital data on a 36 to 40KHz carrier wave, it would have a high signal to noise ratio (be detectable with a relatively weak transmitter in very noisy conditions). The wavelength of IR chosen (940nm) was useful because it is just beyond visible light, but not too far beyond the properties of light that it still reflects well off of ordinary surfaces. The reason for this article, and the software project I created, is to harness these ubiquitous controls to restore functionality to my MacBook that ...

Really really fast GPIO on Linux

Image
Introduction I started down this latest rabbit hole when looking for a way to get high speed data from the "low speed" GPIO header of a Raspberry Pi. I wanted to see if I could drive a parallel Eink display directly from the RPI's GPIO header instead of using an external controller like the IT8951. This would allow for the creation of a very low cost, high speed Eink display adapter. Spoiler - my idea worked and I created a working board with the help of my friend Martin : I've also used this direct GPIO idea to drive QSPI LCDs from the RPI header (RPI doesn't have native QSPI support): Back to GPIO... The "digital pins" of most MCUs/SoCs are usually controlled from a few memory mapped ports. These exist in a similar form on simple Microcontrollers like the AVR 8-bit series (e.g. Arduino UNO) and on more complex SoCs like the Allwinner A733 (e.g. OrangePi Zero 3W). There are groups of bits to control each pin's function (e.g. simple input/output or s...

ESP32-P4 SIMD Explained

Image
Introduction N.B. - This article is for programmers who are familiar with SIMD. Like the ESP32-S3 before it, the ESP32-P4 includes SIMD instructions - Espressif calls them 'PIE' - processor instruction extensions. Before getting into the details of the P4, it's necessary to go over the history of the ESP32 family. The original ESP32, ESP32-S2 and ESP32-S3 all use Cadence's Xtensa LX CPUs. The release of the ESP32-C3 marked a turning point for Espressif with the use of RISC-V CPUs (no license fee). The ESP32-S3 is the last MCU in their lineup to use an Xtensa CPU. Espressif decided to add SIMD instructions (PIE) to the S3 to support more advanced imaging and machine learning tasks. The PIE instructions on the ESP32-S3 look a lot like Cadence's other SIMD instruction sets on their other CPUs. The ESP32-P4 however, has two 32-bit RISC-V CPUs inside. The RISC-V is an open source CPU design that is unrelated to Cadence's Xtensa CPUs. RISC-V's instruction set has ...