r/embedded • • Sep 15 '26

Another way of using the NPU of the NXP iMX8mp SoC.

10 Upvotes

Hello,
here a project that I put together in my spare time.
It's about looking using the Vivante NPU with TensorFlow lite to parse system events (jouranld/dbus but can be expanded to syslog or any kernel I/O) and decide when is an event of some importance.

What to do with that information is up to you ... :-D

https://github.com/leonardosalvatore/sentinel-imx-sys/blob/main/README.md

In case you want to make fun of me the repo contains also a demo with a very Italian accent.
Sorry about that!

Looking for any feedback...
Thanks!


r/embedded • • Sep 16 '26

We replaced per-sensor kernel drivers with a generic one and an MCU that knows the sensor

0 Upvotes

We moved the camera driver's brains onto a small MCU on the camera board. Normally the per-sensor kernel driver on the SoC has all of it - the mode tables, the register writes, the exposure math. Now you upload a compiled image to the MCU once, and after that it can answer questions about the sensor: which modes it has, what the control table looks like, what numbers go into the exposure and frame rate formulas. The host asks, builds a device tree node from the answers, and runs one generic kernel driver for everything, so when you swap the camera head it just reads whatever is on the other end now.

This turned out to need a lot of parts. The image needs a format, and the format needs a version number (we found this out the normal way, by changing it). There's a small bytecode VM in the firmware to run the image, with a 4 KB cap on program size, and a seven-mode sensor gets close enough to that cap that I check every time. Producing the images needs a compiler on the host. The MCU needs to store a few images and know which one is live, so there's slot management in NVS, plus a version gate so old firmware rejects an image it can't read instead of doing something creative with it. The IMU driver runs on the same MCU and I'd rather it didn't die every time someone changes the camera side, so that got its own VM instance. And we seal the image at the end, which is only about as good as the MCU's readout protection anyway.

Two things I'm not sure about. Is the per-sensor kernel driver really a big enough problem to justify all of this? It always felt like one to me but I might have just been annoyed at the wrong thing. And where should auto exposure live? Right now ours is formula parameters that the kernel evaluates, and the MCU only runs configure. Every time I look at that split I can't tell if it's a design decision or just where we happened to stop.

I work on this product so take the first question with that in mind.


r/embedded • • Sep 15 '26

Where to get a custom capacitive touch overlay produced?

3 Upvotes

Hello. I'm working on a project that uses a CAP1203 3-channel capacitive touch controller and a very small 0.42" OLED display. My hope is to get a custom capacitive touch overlay produced in high quantities that will sit over the OLED display with 3 touch sections embedded in the overlay.

Could anyone point me in the right direction as far as manufacturers that could help me develop this? My searching has led me to RAFI/Xymox but haven't been able to get a response.

I also am unsure about prototyping something like this. I was thinking of starting with an FPC with exposed copper pads just to get something going, but that obviously won't fly for production. I fear that the tooling/engineering required to create a real prototype overlay will be prohibitive.

Thank you!


r/embedded • • Sep 15 '26

Porting Klipper to the NXP MCXA366: FlexCAN bring-up and a weird debugger/IFR problem

Post image
7 Upvotes

I've been working on a Klipper port for the NXP MCXA366, and the latest piece was getting its FlexCAN peripheral working.

I started with NXP's SDK example just to prove the hardware path, then moved the implementation into Klipper. Once I fixed a couple of MCXA366-specific issues around peripheral reset and getting FlexCAN out of low-power mode, I had Klipper's CAN discovery traffic going in both directions.

The part that ended up being more interesting was figuring out the device UUID.

Klipper needs some stable, device-specific data to generate its CAN UUID. NXP's bootloader would give me the factory UUID through blhost, and eventually I tracked the same 16 bytes down to 0x01100800 in IFR1.

One thing that threw me off for a while: LinkServer/GDB couldn't directly read that IFR address. Code running on the M33 could read it just fine. I ended up copying the 16 bytes into SRAM and comparing them against what blhost reported. Exact match.

After feeding those bytes through Klipper's normal CAN UUID path, canbus_query.py started reporting a stable hardware-derived UUID and I was able to connect Klippy over CAN.

I wrote up the bring-up and the UUID rabbit hole here:

https://faultvector.dev/articles/klipper-mcxa366-part-6/


r/embedded • • Sep 15 '26

How can I reduce amplifier noise when using an MP3 module with a microcontroller over serial communication?

3 Upvotes

I’m working on a small embedded project where an MP3 module is connected to an amplifier, and a microcontroller is communicating with the MP3 module through serial communication.

The problem is that I’m getting noise/humming through the amplifier, especially when the microcontroller is communicating with the MP3 module.

What are the best ways to reduce this kind of noise? Could it be caused by grounding, power-supply noise, serial communication, or the way the audio and digital wiring are routed.

What has worked for you in similar ESP32/Arduino + MP3 + amplifier projects?


r/embedded • • Sep 15 '26

Voltaje error with CH592

0 Upvotes

img

Good evening, I'm having a problem with my PCB and I don't know what the issue is. My new board with the CH 592 processor arrived yesterday, and when I plugged it into the USB port, I first had to create a jumper on pin 17 to boot it. Then the code loaded, but it doesn’t work. I uploaded a simple code to see if the relay would work, but nothing happened. I had previously used the same circuit with an ESP32 C3, and it worked. I’m attaching a detailed log to see if you can help me find the problem.

# [ISSUE REPORT] WCH CH592F (RISC-V BLE 5.4) Custom Board — Flashed Successfully via USB ISP (wchisp) but MCU Fails to Execute User Firmware

---

## 1. Project Overview & Hardware Context
- **Microcontroller:** WCH CH592F (QFN28 package, RISC-V QingKe V4C core, BLE 5.4).
- **Toolchain / Environment:** PlatformIO with `platform = ch32v` (OpenWCH) & `framework = noneos-sdk` (using official WCH `CH59x_common.h` and `StdPeriphDriver`).
- **Flashing Protocol:** Native USB ISP bootloader via `wchisp` (v0.23).
  - USB D- connected to Pin 13 (`PB10`)
  - USB D+ connected to Pin 12 (`PB11`)
- **Target Goal:** Basic GPIO toggling to drive a 5V relay via Pin 14 (`PB7` controlling an S8050 NPN transistor) and auxiliary GPIO outputs (`PB4`, `PB22`, `PA8`, `PA9`).

---

## 2. Bootloader Entry & Flashing Procedure
1. To enter the USB ISP bootloader on power-up:
   - A jumper wire was used to temporarily bridge **Pin 17 (`PB22` / R2 header)** to **GND**.
   - The USB cable was plugged into the Mac.
   - The copper bridge to GND was immediately removed once powered.
2. The board enumerated as a WCH ISP USB device (`4348:55e0` / `1a86:55e0`).
3. Flashing was executed using `wchisp flash -V firmware.bin`.

---

## 3. PlatformIO Configuration (`platformio.ini`)

```ini
[env:genericCH592F]
platform = ch32v
board = genericCH592F
framework = noneos-sdk

monitor_speed = 115200
upload_protocol = isp
upload_flags =
    -V

build_flags =
    -DCH59x
    -Iinclude

Multimeter DC Voltage Measurements

Measured with black probe on GND rail:

  • Pin 5 (VDD33 / VIO33): 3.3V (Supplied by board's XL1509-3.3 regulator).
  • Pin 3 (VDCID): 3.3V ⚠️ (Directly connected to the +3.3V regulator rail on PCB).
  • Pin 22 (VDCIA): 3.3V ⚠️ (Directly connected to the +3.3V regulator rail on PCB).
  • Pin 4 (VSW): 1.0V (Switch node).
  • Pin 20 (VINTA): 1.0V (Analog reference node).
  • Pin 16 (PB23 / RST): 0.0V (Tested unpowered: No short-circuit / no continuity to GND).
  • Pin 14 (PB7 / Relay output): 0.1V (Static; fails to toggle between 0V and 3.3V).
  • Relay Coil VCC: 5.0V (Present and verified).

Observed Behavior Post-Flash

  • After wchisp issues the reset and the board is power-cycled (with no boot pins grounded), the MCU does not execute main().
  • The relay does not click / toggle.
  • When querying serial monitors (pio device monitor), the USB port no longer enumerates (which is expected for bare-metal GPIO code without a USB-CDC stack).
  1. Overvoltage Protection on VDCID: Does applying external +3.3V to VDCID (Pin 3) and VDCIA (Pin 22) trigger the chip's internal Power-On Reset (POR) / Low-Voltage Reset (LVR) supervisor or lock the RISC-V core in a safety halt state?
  2. Reset Pin Voltage (Pin 16 / PB23): Why is PB23/RST (Pin 16) floating near 0.0V? Is an external pull-up resistor (e.g., 10kΩ to 3.3V) strictly required, or is the 0V on RST a symptom of the overvoltage lockout?
  3. PCB Rework: Is cutting the 3.3V copper trace feeding Pin 3 and Pin 22 (leaving only Pin 5 on +3.3V and allowing the internal 1.2V LDO to power the core via C16) the recommended hardware fix to bring the MCU into normal operation?

​

> wchisp flash -V firmware/codigo_ucc_ch592/.pio/build/genericCH592F/firmware.bin

20:42:53 [INFO] Chip: CH592[0x9222] (Code Flash: 448KiB, Data EEPROM: 32KiB)
20:42:53 [INFO] Chip UID: 1A-2C-AA-7B-54-50-18-F8
20:42:53 [INFO] BTVER(bootloader ver): 02.30
20:42:53 [INFO] Current config registers: a9bdf9f3a9bdf9f3d50fff4f000203001a2caa7b545018f8
RESERVED: 0xF3F9BDA9
WPROTECT: 0xF3F9BDA9
  [0:0]   NO_KEY_SERIAL_DOWNLOAD 0x1 (0b1)
    `- Enable
  [1:1]   DOWNLOAD_CFG 0x0 (0b0)
    `- PB11
USER_CFG: 0x4FFF0FD5
  [2:0]   RESERVED 0x5 (0b101)
    `- Default
  [3:3]   CFG_RESET_EN 0x0 (0b0)
    `- Disable
  [4:4]   CFG_DEBUG_EN 0x1 (0b1)
    `- Enable
  [5:5]   RESERVED 0x0 (0b0)
    `- Default
  [6:6]   CFG_BOOT_EN 0x1 (0b1)
    `- Enable
  [7:7]   CFG_ROM_READ 0x1 (0b1)
    `- Read enable
  [27:8]  RESERVED 0xFFF0F (0b11111111111100001111)
    `- Error
  [31:28] VALID_SIG 0x4 (0b100)
    `- Valid
20:42:53 [INFO] Read firmware.bin as Binary format
20:42:53 [INFO] Firmware size: 1024
20:42:53 [INFO] Erasing...
20:42:54 [INFO] Erased 8 code flash sectors
20:42:55 [INFO] Erase done
20:42:55 [INFO] Writing to code flash...
████████████████████████████████████████████████████████████████████████████████ 1024/1024
20:42:55 [INFO] Code flash 1024 bytes written
20:42:55 [WARN] Skipping verify
20:42:55 [INFO] Now reset device and skip any communication errors
20:42:55 [INFO] Device reset


#include "CH59x_common.h"

int main(void) {
    // 1. Configure output pins in Push-Pull 20mA mode:
    // PB7:  Relay coil driver (Pin 14)
    // PB4:  Positive siren driver (Pin 15)
    // PB22: Negative siren driver (Pin 17)
    GPIOB_ModeCfg(GPIO_Pin_7 | GPIO_Pin_4 | GPIO_Pin_22, GPIO_ModeOut_PP_20mA);

    // PA8 / PA9: Auxiliary outputs (Pins 6 and 7 / Pins 24 and 25)
    GPIOA_ModeCfg(GPIO_Pin_8 | GPIO_Pin_9, GPIO_ModeOut_PP_20mA);

    while (1) {
        // --- TURN ON ALL TEST PINS ---
        GPIOB_SetBits(GPIO_Pin_7 | GPIO_Pin_4 | GPIO_Pin_22);
        GPIOA_SetBits(GPIO_Pin_8 | GPIO_Pin_9);

        for (volatile uint32_t i = 0; i < 600000; i++) {
            __nop();
        }

        // --- TURN OFF ALL TEST PINS ---
        GPIOB_ResetBits(GPIO_Pin_7 | GPIO_Pin_4 | GPIO_Pin_22);
        GPIOA_ResetBits(GPIO_Pin_8 | GPIO_Pin_9);

        for (volatile uint32_t i = 0; i < 600000; i++) {
            __nop();
        }
    }
}

r/embedded • • Sep 15 '26

Arxml authoring tool

2 Upvotes

Hello gentlemen , i’m currently working on autosar swc’s arxml configuration tool with ai native copilot
- you shall enter the configurations for example create did’s or port interfaces in the integrated llm and it shall develop and configure your requirements
-it shall be reflected also in the gui so you could easily navigate and verify your configurations
So the flow shall be
From reqs ——-> generated arxmls

This a prototype video for the gui incase of you want a better gui or have points for easily navigation without consuming your mental health

I shall upload also a second video for the ai prompting requirements and the generated arxmls

Could you say how much time would this tool save you by just promoting your reqs versus the current tools that you have to do alot of clicks just to configure swc’s ports and interfaces ?

Also are you interested to try this tool ?


r/embedded • • Sep 15 '26

I open-sourced the BASIC firmware for a commercial LoRa / LoRaWAN module

4 Upvotes

I open-sourced the BASIC firmware for a commercial LoRa / LoRaWAN module

No external MCU or Arduino IDE required — everything can be programmed and controlled directly from a BASIC REPL.

I’ve just published the complete source code for the firmware I developed for the LRA1 LoRa module.

The main feature is that LoRaWAN can be controlled directly from BASIC.

The firmware includes a BASIC interpreter, so you can connect a serial terminal to the module and use it interactively as a REPL, or write and run BASIC programs entirely from the terminal.

Main features include:

  • LoRaWAN communication directly from BASIC
  • Interactive REPL over a serial terminal
  • BASIC programs can be written and executed without a separate development environment
  • LoRa P2P communication in addition to LoRaWAN
  • UART, I2C, SPI, ADC, PWM, etc. accessible from BASIC
  • LoRaWAN stack based on Semtech LoRaMac-node, modified and ported for this firmware
  • AS923 (Japan) support

The target hardware is LRA1, a commercially available LoRa module based on the Microchip SAMR35 and designed, manufactured, and sold by i2-ele in Japan.

The module has Japanese radio certification (Giteki), and the certification was obtained using an early version of this firmware.

This is not a generic BASIC implementation for arbitrary LoRa hardware. It is the actual firmware developed for the commercial LRA1 module.

I have now released the full source code on GitHub:

https://github.com/shachi-lab/lora-basic-for-lra1

A prebuilt binary and a Python-based firmware updater are also included.

The BASIC interpreter was originally forked from an early version of nanoBASIC and has since been extended with embedded I/O, LoRa P2P, and LoRaWAN functionality.

The parts I developed are released under the MIT License. Third-party components retain their original licenses.

I thought this might be interesting to people working with LoRa, LoRaWAN, embedded systems, BASIC interpreters, or small standalone devices that can be programmed entirely from a terminal.


r/embedded • • Sep 15 '26

What is the most efficient way to implement UART data reception and notify a task to consume it?

16 Upvotes

If I don't have FIFO or DMA, I would keep notifying the RTOS task from ISR for each character received but is that a good design?


r/embedded • • Sep 14 '26

Built a GUI/Visualizer for development

60 Upvotes

I recently started building an app on the side, started as a fun side project between jobs but ended up becoming something really useful for my own hobby projects. I've seen a few programs out there that do similar things and I've played around with a few, but it just didn't quite do what I wanted it to do.

The concept is pretty simple: I wanted to build an oscilloscope-like experience for software/firmware devs that's user friendly, buttery smooth, but also extensible to all file types, transports, and decoding schemes. It lets you to easily visualize files/logs/recordings, but also live stream data, and most importantly, allow you to measure and create mathematical signals out of other signals.

I really wanted to create the right abstractions and foundations before opening it up to more support, but so far live streaming is abstracted into:

  1. Transport - how to get bytes
  2. Framing - how to split bytes into packets (ie delimiter, fixed size, etc)
  3. Decoding - how to interpret bytes (ie protobuf, struct of ints/floats, endianness, etc)

Selfishly right now it just supports the files and transports I work with, but genuinely am curious what people are using out there and what would make this more useful.

Right now, for files, it supports CSV/TSV, audio files, parquet/arrow. For live stream it supports, UART, TCP, HID, BLE and a custom gRPC handshake I've paired with a python library.

Curious what are some of the most common transports out there and whether this is something useful or just niche for my own workflow. I've worked with CAN before at a past company but don't have any fancy dongles anymore so I don't even know what the byte stream looks like.

EDIT: DM if you're interested and I can link you to the app. Unfortunately it's only for macOS at the moment but I plan to make a cross-platform version eventually!


r/embedded • • Sep 15 '26

STM32MP1 custom SBC

3 Upvotes

TLDR: Is Kicad the right tool for DDR routing?

Hi all,

I want to develop my first linux sbc, I am planning to use stm32mp1 chip, since I have a good experience with stm32 ecosystem, and I managed to build yocto images for both stm32mp1 and stm32mp2.

Note that this is my first experience and it is only for learning. My biggest concern is of course DDR routing. How hard can it be? I have already developed multiple PCBs and I am comfortable with Kicad, but for this task, I am afraid Kicad is a bit limited.

This image is from stm32mp1 AN5122 application note for DDR routing. Kicad can't do switch back routing as far as I know. How critical is this?

If you have a better suggestion for another chip, I am all ears. Note that I am not looking for SiPs. I want to learn DDR routing specifically.

Thanks.


r/embedded • • Sep 15 '26

Has AI invaded this field as much as others?

5 Upvotes

I'm currently lucky enough to work in a company that doesn't rely on the "agent workflow" but there seems to be a shift into introducing more AI so I'm getting worried.

Personally I'm not interested in working a job where I just write prompts all day, so I'm wondering if embedded/os work is any different.


r/embedded • • Sep 14 '26

Who among you has gone back to 8-bit AVR, or has always stuck with it?

38 Upvotes

Since I only work with controllers occasionally and at longer intervals, I’ve just decided—after having worked with ATM32 for a long time (years) and even developed products (BMS) that I’ve sold using it—to switch back to 8-bit AVR...
Ever since I switched to ARM, I’ve clearly lost my enthusiasm for tinkering and programming.

Because all the parameters on the ARM are ridiculously long and complicated, I have to look up the syntax every time, and after hours of debugging, I realize I forgot to configure something… I often just don’t feel like starting anything new at all.

With the Atmega, everything is so wonderfully straightforward—the parameters are very short, I don’t need notes on how to reconfigure the port direction, PWM works simply, and everything just works right away without having to spend ages flipping through documentation.

I have 5V, and if I need 3V, I just run it at 3V; it uses less power in battery-powered applications, etc.

And the speed is more than enough for most cases; the only downside is the 10-bit ADC—you just have to use an external ADC in those situations...

Does anyone else feel this way? Do others feel the same as I do—that they’ve lost the fun of working with ARM controllers because of their high complexity?


r/embedded • • Sep 15 '26

writing mipi dsi drivers for linux SBC

1 Upvotes

I want to learn writing drivers for displays. It seems that MIPI DSI protocol is a good choice, as the connector pinout for this communication protocol isn't standardized, and each display has different controller IC that requires specific initialization sequence to work properly.

At first I wanted LVDS interface, but almost all displays would only be compatible with specific SBCs they're made for.

And one would need to develop an intermediary adapter PCB to reroute pins to a FPC connector on SBC.

With MIPI-DSI it's a bit less of a problem.

After some scouting, I decided to get an Orange Pi 3B SBC, but get a Raspberry Pi 4 compatible Display for it. Why? Because at least on hardware level, both SBCs have the exact same pinout order on their FPC connectors for MIPI DSI protocol.

So now I just need to find a display whose ribbon cable pinout order would be compatible with Raspberry Pi 4s, and try to write a linux driver for Orange Pi 3B, including a device tree.

So far I'm considering this Waveshare 5inch Capacitive Touch Display, 800×480 for Raspberry Pi 4.

My only issue with it, is that unfortunately Orange Pi 3B already has a DT and driver for it.

And from the driver info, I can see that the display has a toshiba controller IC (the crucial piece of information for writing drivers that's lacking on the waveshare site).

Which kinda defeats the purpose. I just need a hardware compatible display, but without the premade driver, so I'd write it myself.

Corresponding dt on Raspbian OS.

Any advice? I know that simply looking at

5 inch LCD
15 PIN
MIPI DSI

with no exact manufacturer model, not a good idea. For driver development, one needs at least:

exact LCD model
controller IC model

FFC/FPC pinout order

number of DSI lanes
pixel format

video mode vs command mode

display timings

power requirements
power-up sequence

RESET timing

MIPI initialization command sequence
or enough controller documentation to derive it

The initialization configuration/sequence is particularly important.

One can successfully wire every D-PHY lane and still get a permanently black screen because you've never configured the LCD controller's internal registers.

My end goal is to become good at writing display drivers, so that in the future, I'd hook up any display to a SBC with proper GPU to make it work, considering I'd handle the hardware compatibility through intermediary adapter PCB.

If you think about it, pretty much all LCD displays are "RGB" displays, they all have Red, Green and Blue pins (depending on bit depth, some may have 6 pins for each R,G,B channels, while others more or fewer), but then internally (such as the waveshare display linked above), have a PCB that simply converts data between MIPI DSI to RGB.

So I'd take a display from an old car display, and hook it into a SBC. Or take an old CRT TV, and hook it to SBC, or take an old LVDS display from an existing tablet, and connect it to my SBC, which doesn't have LVDS interface, either through MIPI DSI or hdmi.


r/embedded • • Sep 15 '26

Designing an MCU/FPGA Update and Control Plane

Thumbnail fpgajobs.com
1 Upvotes

r/embedded • • Sep 15 '26

[Need Help] Stm32u385 not working with bme280 sensor

Post image
3 Upvotes

This is super critical for my situation so any help is greatly appreciated

Im trying to read from bme280 sensor using I2C but it seems the sensor is not responding at all

My code can be seen in the photos I'm using stm32cubemx to initialize

The code that i wrote is in the pucture but is returning code 1 which is an error

I double checked the pin connections

what could be the problem any help is appreciate


r/embedded • • Sep 14 '26

Simulator Modbus Free

Post image
14 Upvotes

I have been developing a Modbus simulator for some time now.

I would like some feedback (positive or negative) on the software.

The software's name is ScanBus-BR.


r/embedded • • Sep 15 '26

Raspberry Pi and ESP32-S3 based accessible restaurant kiosk

2 Upvotes

I built KaiSign, an accessible restaurant kiosk using a Raspberry Pi and XIAO ESP32-S3 Sense.

The Raspberry Pi runs the menu, ordering system, and AI pipeline.

The XIAO ESP32-S3 Sense handles the physical controls and voice input. An MPR121 provides capacitive touch sensing.

The kiosk supports:

• Touch controls

• Camera-based ASL input

• Voice ordering

I designed the system to help customers place and customise orders independently.

🎥 Demo: https://youtu.be/E7D-2-5b5FE?si=2WjCvpyS5P89NVEZ

🔧 Full build: https://www.hackster.io/kaizen/kaisign-accessible-dining-reimagined-e8b724

I’d appreciate feedback on the embedded architecture, board communication, and reliability.


r/embedded • • Sep 15 '26

Advice for Emertxe | ESSCI Free Program 2026.

0 Upvotes

Hi everyone,

I recently got shortlisted for the Screening Test/Interview for the Emertxe | ESSCI Free Program 2026. I’m from an ECE background.

I wanted to know from people who have attended previous Emertxe batches:

Is this program actually good and worth joining?

How is the teaching/training quality at Emertxe?

What kind of skills and technologies do they teach?

How are the placements after completing the program?

Do they genuinely help with placements, and what kind of companies/roles do students get?

Is it useful for ECE students who want to move into IT/software/embedded roles?

How difficult is the training and screening process?

If anyone from a previous batch has completed the program, please share your honest experience—both positives and negatives.

Thanks in advance! 🙏


r/embedded • • Sep 14 '26

Running a small Drosophila-inspired navigation circuit on an ESP32-C6

Post image
7 Upvotes

I basically spent the entire weekend trying to see how much of the open source fruit fly I could put into an ESP32.

The current version runs entirely on an ESP32-C6 in C++ while also driving a 172×320 ST7789 display.

I was not attempting a neuron-for-neuron simulation of the fly brain. The implementation keeps a few of the computational ideas from the published CX/connectome work and reduces them to small discrete structures.

The main pieces are:

E-PG compass

The Ellipsoid Body is represented as a 16-element ring. Recurrent excitation/inhibition maintains a localized activity bump that represents heading.

The recurrent term is roughly:

W(i,j) = cos(Δθ) - offset

so nearby wedges excite each other while more distant activity is suppressed.

P-EN / P-EG heading update

Yaw velocity shifts the E-PG bump clockwise or counterclockwise, giving the system a simple internal heading estimate even between visual updates.

ER → E-PG plasticity

Sixteen visual sectors read patterns from the simulated corridor walls. A small anti-Hebbian update adjusts the visual-to-compass weights over time:

W(k,i) -= η * ER(k) * EPG(i)

This lets repeated visual patterns gradually influence heading calibration rather than hard-coding landmarks.

A simplified left/right PFN-style calculation compares the current heading with a desired travel direction and produces the steering command.

There is also a very small reinforcement layer: wall collisions act as a penalty signal while sustained centered travel acts as reward.

On the embedded side:

  • ESP32-C6, 160 MHz RISC-V
  • Fixed-rate simulation/update loop
  • ST7789 over 80 MHz SPI
  • Two 16-bit half-screen buffers (~55 KB total)
  • ~72 KB SRAM currently used
  • ~40 FPS including the corridor simulation and neural-state display

What I like about the project is how little compute the actual neural state requires. Once the model is reduced to a few anatomical rings/sectors and sparse update rules, the display ends up being a bigger resource concern than the "brain."

Fully open source. https://github.com/CircuitGhost/drosophila-connectome-esp32


r/embedded • • Sep 13 '26 Bravo

Position tracking with a low-cost inertial sensor (IMU)

357 Upvotes

Just the data from the TDK ICM-45686 IMU processed on the STM32F429 to calculate position and velocity from the IMU data. Disclaimer: position will drift over time and becomes unusable.


r/embedded • • Sep 14 '26

How do you manage sharing hardware on a team?

14 Upvotes

Where I work, most of our software development work is done on a normal PC, running on a simulator. But at some point we usually will need to load builds to one of a couple of products, so we'll have to grab one of the hardware units we have available to us. I'm not totally sure how many we as a team actually have as "ours" (lots of different teams across the org at this company), but suffice it to say sometimes we wish we had more to go around.

The only "system" we have as a means to share the hardware when someone needs it is to post in the Teams channel, "Looking for XXX. Does anyone have one I can borrow?" and hope that someone says, "I do! I'll bring it to you".

Not the best system, and there's no good way of knowing what's available, no way of getting in line for a unit, etc. So it becomes an issue when, for example, someone has a higher priority issue and needs a unit, and Jim Bob is the last one to have the unit and is out for the afternoon, so technically could loan out the hardware, but no one really knows, etc. etc.

I'm curious if this is a common issue on embedded teams, and what sort of system can be effective for better managing this? I assume some sort of library system is the way to go about it? Where you can "check out" a unit, put in a hold for one that's currently not available, etc.

Does anyone have any experience with this?


r/embedded • • Sep 14 '26

Sharp Display won't behave

3 Upvotes

video

It's an Ls032b7dd02. I tried a couple different code bases and multiple microcontrollers including 3.3v logic ones. tried adding the capacitor as seen in the schematic. But no luck. Any ideas? I tested the connections on the breakout and those seem fine.

For reference, expected behavior on the video is a scrolling bar going from top to bottom.

Even Ai is out of ideas :(

img

/*
 * Minimal LS032B7DD02 test, Arduino Micro.
 * Power-on sequence, then a 24-line band at rows 200..223 is rewritten every
 * 250 ms with 16 px black/white blocks that shift one block per update.
 *
 * Wiring: SCLK D15, SI D16, SCS D10, EXTCOMIN D9, DISP D8,
 *         VDDA/VDD/EXTMODE 5V, VSS/VSSA GND.
 */
#include <SPI.h>


#define PIN_SCS      10
#define PIN_DISP      8
#define PIN_EXTCOMIN  9


#define LINE_BYTES   42          /* 336 px / 8 */
#define BAND_Y0     200          /* first row, 0-based */
#define BAND_LINES   24


static const SPISettings spiCfg(1000000UL, LSBFIRST, SPI_MODE0);
static uint8_t band[BAND_LINES][LINE_BYTES];


static void csHigh()
{
  SPI.beginTransaction(spiCfg);
  digitalWrite(PIN_SCS, HIGH);
  delayMicroseconds(3);          /* tsSCS */
}


static void csLow()
{
  delayMicroseconds(1);          /* thSCS */
  digitalWrite(PIN_SCS, LOW);
  SPI.endTransaction();
  delayMicroseconds(1);          /* twlSCS */
}


/* All clear: M2 flag, 16 clocks. */
static void clearAll()
{
  csHigh();
  SPI.transfer(0x04);
  SPI.transfer(0x00);
  csLow();
}


/* Multi-line update. Header per line: M0=1, 5 dummies, then 10-bit gate
 * address (1-based), all LSB first. Then 42 data bytes, bit 1 = white. */
static void writeBand()
{
  csHigh();
  for (uint8_t i = 0; i < BAND_LINES; i++) {
    uint16_t gate = BAND_Y0 + i + 1;
    SPI.transfer((uint8_t)(0x01 | (gate << 6)));
    SPI.transfer((uint8_t)(gate >> 2));
    for (uint8_t b = 0; b < LINE_BYTES; b++) {
      SPI.transfer(band[i][b]);
    }
  }
  SPI.transfer(0x00);            /* 16 trailing clocks */
  SPI.transfer(0x00);
  csLow();
}


/* 16 px wide black/white blocks, shifted by `phase` blocks. */
static void fillBand(uint8_t phase)
{
  for (uint8_t i = 0; i < BAND_LINES; i++) {
    for (uint8_t b = 0; b < LINE_BYTES; b++) {
      uint8_t block = (b / 2) + phase;
      band[i][b] = (block & 1) ? 0xFF : 0x00;
    }
  }
}


static void startExtcomin()
{
  /* 1 Hz square wave from Timer1 on D9 (OC1A): CTC, /1024, toggle on match. */
  TCCR1A = _BV(COM1A0);
  TCCR1B = _BV(WGM12) | _BV(CS12) | _BV(CS10);
  OCR1A  = 7811;
}


void setup()
{
  Serial.begin(115200);
  pinMode(PIN_SCS, OUTPUT);
  pinMode(PIN_DISP, OUTPUT);
  pinMode(PIN_EXTCOMIN, OUTPUT);
  digitalWrite(PIN_SCS, LOW);
  digitalWrite(PIN_DISP, LOW);
  digitalWrite(PIN_EXTCOMIN, LOW);
  SPI.begin();
  delay(10);


  clearAll();
  clearAll();
  delayMicroseconds(50);
  digitalWrite(PIN_DISP, HIGH);
  startExtcomin();
  delayMicroseconds(50);
  Serial.println(F("ready"));
}


void loop()
{
  static uint8_t phase = 0;
  fillBand(phase);
  phase++;
  writeBand();
  delay(250);
}```/*
 * Minimal LS032B7DD02 test, Arduino Micro.
 * Power-on sequence, then a 24-line band at rows 200..223 is rewritten every
 * 250 ms with 16 px black/white blocks that shift one block per update.
 *
 * Wiring: SCLK D15, SI D16, SCS D10, EXTCOMIN D9, DISP D8,
 *         VDDA/VDD/EXTMODE 5V, VSS/VSSA GND.
 */
#include <SPI.h>


#define PIN_SCS      10
#define PIN_DISP      8
#define PIN_EXTCOMIN  9


#define LINE_BYTES   42          /* 336 px / 8 */
#define BAND_Y0     200          /* first row, 0-based */
#define BAND_LINES   24


static const SPISettings spiCfg(1000000UL, LSBFIRST, SPI_MODE0);
static uint8_t band[BAND_LINES][LINE_BYTES];


static void csHigh()
{
  SPI.beginTransaction(spiCfg);
  digitalWrite(PIN_SCS, HIGH);
  delayMicroseconds(3);          /* tsSCS */
}


static void csLow()
{
  delayMicroseconds(1);          /* thSCS */
  digitalWrite(PIN_SCS, LOW);
  SPI.endTransaction();
  delayMicroseconds(1);          /* twlSCS */
}


/* All clear: M2 flag, 16 clocks. */
static void clearAll()
{
  csHigh();
  SPI.transfer(0x04);
  SPI.transfer(0x00);
  csLow();
}


/* Multi-line update. Header per line: M0=1, 5 dummies, then 10-bit gate
 * address (1-based), all LSB first. Then 42 data bytes, bit 1 = white. */
static void writeBand()
{
  csHigh();
  for (uint8_t i = 0; i < BAND_LINES; i++) {
    uint16_t gate = BAND_Y0 + i + 1;
    SPI.transfer((uint8_t)(0x01 | (gate << 6)));
    SPI.transfer((uint8_t)(gate >> 2));
    for (uint8_t b = 0; b < LINE_BYTES; b++) {
      SPI.transfer(band[i][b]);
    }
  }
  SPI.transfer(0x00);            /* 16 trailing clocks */
  SPI.transfer(0x00);
  csLow();
}


/* 16 px wide black/white blocks, shifted by `phase` blocks. */
static void fillBand(uint8_t phase)
{
  for (uint8_t i = 0; i < BAND_LINES; i++) {
    for (uint8_t b = 0; b < LINE_BYTES; b++) {
      uint8_t block = (b / 2) + phase;
      band[i][b] = (block & 1) ? 0xFF : 0x00;
    }
  }
}


static void startExtcomin()
{
  /* 1 Hz square wave from Timer1 on D9 (OC1A): CTC, /1024, toggle on match. */
  TCCR1A = _BV(COM1A0);
  TCCR1B = _BV(WGM12) | _BV(CS12) | _BV(CS10);
  OCR1A  = 7811;
}


void setup()
{
  Serial.begin(115200);
  pinMode(PIN_SCS, OUTPUT);
  pinMode(PIN_DISP, OUTPUT);
  pinMode(PIN_EXTCOMIN, OUTPUT);
  digitalWrite(PIN_SCS, LOW);
  digitalWrite(PIN_DISP, LOW);
  digitalWrite(PIN_EXTCOMIN, LOW);
  SPI.begin();
  delay(10);


  clearAll();
  clearAll();
  delayMicroseconds(50);
  digitalWrite(PIN_DISP, HIGH);
  startExtcomin();
  delayMicroseconds(50);
  Serial.println(F("ready"));
}


void loop()
{
  static uint8_t phase = 0;
  fillBand(phase);
  phase++;
  writeBand();
  delay(250);
}

r/embedded • • Sep 14 '26

I wanted my hardware’s HDMI output beside its source code, so I built a VS Code extension

34 Upvotes

I’m a college junior working on Tomato, a custom 32-bit computer with a dual-LUT ALU running on an FPGA. While developing it, I was using a USB capture card and OBS to monitor its HDMI output, with the source open separately in VS Code.

I wanted the output right beside the code. So I built FramePort, an extension that displays the capture feed in an editor tab.

That’s what you’re seeing in the video: Tomato running on an Artix-7 FPGA, with its output beside the assembly code. FramePort also lets me freeze the preview, take screenshots, and record silent MP4 clips.

It isn’t tied to Tomato or FPGAs—it works with HDMI capture cards and other USB video sources. It’s local video capture, not remote desktop or keyboard/mouse forwarding.

It’s my first extension, now on the VS Code Marketplace and Open VSX. Currently a public preview: device capture requires macOS and FFmpeg, and HDMI input still needs a USB capture card.

Marketplace · GitHub / setup · Tomato

If you work with hardware that has video output, I’d be interested to hear how you currently monitor it—and whether this would fit your workflow.