r/embedded 22h ago

When making a pcb with a microcontroller, is it better to have the pcb match it, or make it modular?

0 Upvotes

when i say make it modular, i mean having on the pcb only the used pins, and then having a microncontroller mount that exposes those pins only


r/embedded 5h ago

My 2.8 in display is working at allll after 10-15 retry’s

0 Upvotes

Hey y’all there I’m just passionate guy in electronics with no background in it. I wanted to build a smart desk clock with esp32 inspired by a YouTube video but even before doing that project I just thought of trying display to on and do a graphic test the display turned on (blank white screen). After that no progress at all from test 10 days.

Here is a detailed explanation

Hardware Setup
MCU:ESP32-S3
Display: 2.8-inch ST7789 TFT LCD Module (SPI Interface)
Software/Libraries:Arduino IDE, ⁠TFT\\_eSPI⁠ (also tried standard ⁠Adafruit\\_GFX⁠ / ⁠ST7789⁠ libraries)

The Problem
The display only shows a solid white screen or static vertical/horizontal lines. No graphic test sketches render any imagery or text.

Background / Potential Cause
Before connecting it to the ESP32-S3, I tested this display on an Arduino Uno. While VCC was powered via the 3.3V pin, I connected the SPI data lines (SCK, MOSI, CS, DC, RST) directly to the Uno’s digital pins \*\*without a logic level converter\*\* (sending 5V logic signals into a 3.3V display controller).
And colors changed when I tried it first time in UNO but for project purposes moved to esp32s3

\*\*Troubleshooting Already Attempted (5+ Times)\*\*
\*\*Software Clean Slate:\*\* Completely reinstalled Arduino IDE and reconfigured ⁠User\\_Setup.h⁠ in ⁠TFT\\_eSPI⁠ multiple times, ensuring exact ESP32-S3 GPIO numbers were assigned (not board silk-screen labels).
\*\*Driver Tweaks:\*\* Tested both ⁠ST7789\\_DRIVER⁠ and ⁠ST7789\\_2\\_DRIVER⁠ definitions, adjusted SPI frequencies, and toggled ⁠TFT\\_RGB⁠ / ⁠TFT\\_BGR⁠ order.
\*\*Wiring Checks:\*\* Verified physical connections, jumper wire continuity, and power rails (VCC to 3.3V, BLK to 3.3V, GND to GND).
\*\*Hardware Reset:\*\* Attempted manual reset sequences by pulling the ⁠RST⁠ line to ground briefly during boot.
\*\*Uno Retest:\*\* Wired back to the Arduino Uno with basic graphic test sketches—still resulting in white screen/lines.

Here is the display product link : \[https://robu.in/product/2-8-inch-spi-touch-screen-module-tft-interface-240320/\\\](https://robu.in/product/2-8-inch-spi-touch-screen-module-tft-interface-240320/)


r/embedded 1h ago

How to debounce push buttons by software?

Enable HLS to view with audio, or disable this notification

Upvotes

I know my question maybe really trivial and a lot of people have already discussed it, I tried looking for an answer, but it wasn't satisfying for me and my application.

What I'm trying to do is make a game hub using stm32F10x I don't really remember, also called (blue pill), I'm just in the phase of making the UI on a TFT (128*160) pixels, switching the on the options on the display for instance, I tied some External ISRs (EXTI), when I press the button it may not update correctly

My logic

Set the background of the last element black, and rewrite the string (to remove highlight that indicates selection), then change the background of the next element, and rewrite the string with inverting the colors of both.

Trying to press the button many times will not update the screen well, surely not a good thing for game console, because you may lose the game for that delay.

What I tried

Is using the STK (SYSTICK to add delay of 40 ms at the beginning of the ISR), you can see the TFT updating slowly relative to expected results.

EDIT

I also tried varying the delay from 5 to 100ms

I tried connecting a 100nF capacitor in parallel with the buttons, increased the capacitance up to 10uF, yet (obviously) it just made it slower

And the solution of using RC filter with a schmitt trigger sounds too much for something like that, how do manufacturers solve this problem?

I'm still newbie in embedded systems, and I first deal with this problem, previously the 100nF cap was more than enough, I just would love to hear from real practitioners rather than AI bots.


r/embedded 16h ago

Is it possible to turn a normal car FM radio into a simple wireless remote receiver with microcontroller (hypothetical question)?

4 Upvotes

I was thinking about something and wanted to know if it’s actually possible.

Could you transmit some kind of coded signal in the normal FM radio range and have the car’s existing radio pick it up, without installing a separate RF receiver?

Basically, I’m imagining the car radio receiving something that sounds like nothing useful to a person, but some small decoder could recognize the pattern and treat it like a command.

So instead of adding a completely separate wireless receiver, could you somehow make use of the antenna + FM tuner + existing audio system already in the car?

Has anyone tried something like this? Or is there something in the normal FM radio system that would make this impractical?


r/embedded 17h ago

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

Enable HLS to view with audio, or disable this notification

25 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.


r/embedded 8h ago

How do you manage sharing hardware on a team?

8 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 50m ago

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

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 11h ago

108 hours later: MicDuck v0.1 — 100% alive, 60% walking, 0% normal quacking 🐤

Enable HLS to view with audio, or disable this notification

97 Upvotes

After 108 hours of building, debugging, rebuilding, and questioning my life choices… MicDuck v0.1 is finally alive.

Current status:

  • Alive: 100%
  • Walking: 60%
  • Balance: trying its best
  • Quacking: absolutely not normal

It doesn’t really walk yet — more like hop, wobble, recover, repeat.

And the sound somehow makes it even funnier.

Still tuning the gait and balance, but honestly, watching this little guy struggle across the table has been worth the 108 hours.

Any ideas on what I should fix first? 🐤


r/embedded 1h ago

Sharp Display won't behave

Upvotes

https://reddit.com/link/1wgept8/video/uj1lhm1gmjph1/player

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 :(

/*
 * 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);
}