Posts

Orange Pi Zero 3 - exploring GPIO

Image
GPIO (General-Purpose Input/Output, or General-Purpose Pins) is a fundamental concept that came into the world of powerful SoCs (System-on-a-Chip) directly from the realm of microcontrollers. It is the main bridge for your single-board computer to interact with simple external devices, in addition to more complex hardware interfaces (such as I2C, SPI, UART, or I2S). While specialized protocols transmit data streams, GPIO allows you to work at the lowest level -controlling individual digital signals. With each pin you can: Read the state (input): For example, check if a button is pressed, or if the signal is “1” or “0”. Control the state (output): For example, turn on an LED, activate a relay, or send a signal to another component. In this article, I want to provide a quick overview of the methods for working with GPIO on the Orange Pi Zero 3 (which is based on the Allwinner H618 SoC ). Of course, these methods are not unique and can be applied to other single-board computers a...

Building a Custom USB HID Device with RP2040 and TinyUSB

Image
Let’s start from afar and go back 30 years to the time of the first Pentium processors. Back then, every device on a PC had its own separate interface: DIN — for the keyboard. A narrow COM port — for the mouse. A wide COM port — for the modem. Branded computers also had PS/2 ports — separate for the keyboard and mouse. A parallel port (LPT) — for a printer, scanner, or external CD-ROM. External SCSI — for storage drives, CD-ROMs, or scanners. MIDI/Game port — for musical equipment and gamepads. And these were just the standard interfaces. In addition to them, many manufacturers created their own proprietary interfaces for their equipment. This was inconvenient for users and also created problems for manufacturers. To solve this problem, the USB consortium of hardware and software manufacturers was created. Its goal was to implement a single universal bus for connecting wide range of external devices. Of course, no one expected the transition to be quick. Users still had a ...

ESP32-C3 WiFi signal issue

Image
In one of my projects, I decided to use a board that was new to me - the ESP32-C3. Previously, I had used the standard dual-core ESP32s, but I needed something compact, and the C3 Supermini was a perfect fit. I took a new module and immediately soldered it onto a breadboard. Then I started porting my code—some issues came up, but fixing them didn’t take much time. And only after all this, I noticed a significant issue: the Wi-Fi access point (AP) wouldn’t start. The code executed without any errors, but no device could see the network from the ESP Supermini.   “Okay,” I thought, “maybe the module is damaged.” I took a new one out of the package - and it worked as expected.   Well, I figured I must have killed the first module with static electricity or overheated it while soldering. I desoldered it from the breadboard and, just in case, powered it on one more time. And surprisingly, it also worked! Just like the new one.   I investigated various factors that could...

ESP8266 module with OLED screen (HW-364A)

Image
I received a few of these modules. They come with the older ESP8266. No problem, there’s always a use for it. A major plus is that the module has a built-in 0.91” 128x64 pixel OLED screen, which is connected via an SSD1306 controller. You can also find ESP32s with OLEDs, though they are pricier. Out of the box, the test firmware demonstrated its OLED display working perfectly. But when I tried the samples from the seller, I just got a black screen. According to the documentation, the display is connected via software I2C with SDA on D6 and SCL on D5. However, when I uploaded a test project with these specified display settings, I got nothing. No signs of life on screen. I started looking for something similar and found many analogous modules from Wemos or with the ESP32. But they all had completely different I2C display connections. At some moment, while trying different libraries for the SSD1306, I made a mistake in the configuration. I set the pins in reverse: SDA - D5, SCL - D...

YD-RP2040 Module

Image
I want to tell you about the rather inexpensive YD-RP2040 module and show some examples of working with it. Photos and Schematics Top view: Bottom view: The module’s electrical schematic can be found here https://github.com/initdc/YD-RP2040/blob/master/YD-2040-2022-V1.1-SCH.pdf Differences from the original Raspberry Pi Pico This board has several key hardware differences from the standard Raspberry Pi Pico module. Key changes:  - Flash memory : The module can be fitted with a larger Flash memory capacity — 4MB (32Mbit) or even 16MB (128Mbit) instead of the 2MB in the original.  - Voltage regulator : The DC-DC step-down converter is replaced with a cheaper and less efficient linear regulator. This has freed up pin GPIO23, which was used to control the DC-DC converter in the original Pico.  - RGB LED : A WS2812 addressable LED (Neo-pixel) is connected to the freed GPIO23 pin. Unlike the original Pico, this board has two additional buttons:  - RESET — for a ...

Chromecast: What You Can Do With It

Image
Chromecast is both a small media player from Google and a protocol for building media applications. Many TVs (Sony, Philips, TCL) and other players (Mi Box) support this protocol. Let’s look at the basics of this architectural solution: Device Discovery — Implemented via mDNS, using the _googlecast._tcp namespace. $ avahi-browse -r _googlecast._tcp = wlp0s20f3 IPv6 Chromecast-8483c593f9fe704813a5fd6d1e330e19 _googlecast._tcp local hostname = [8483c593-f9fe-7048-13a5-fd6d1e330e19.local] address = [fe80::e9e6:e06:54b5:ad52] port = [8009] txt = ["rs=CpuLoad" "ct=243D5A" "nf=1" "bs=FA8FCA5A3BCC" "st=1" "ca=463365" "fn=Chromecast" "ic=/setup/icon.png" "md=Chromecast" "ve=05" "rm=63F5EA264E7C9F1B" "cd=34D0CB70278B5433B344012D67742914" "id=8483c593f9fe704813a5fd6d1e330e19"] Sender — Chromecast uses a standard client-server architecture...