[Help needed] creating blinking LED before OS loads on boot up - Page 1
Forum section: electronics / projects

author: Smile2016
author_rank: Regular Contributor
timestamp: July 10, 2025, 02:43:09 am
content: Assistance needed: I’m designing a status indicator using an LED that should blink during the device’s boot sequence and transition to a GPIO-controlled state once the CPU is fully initialized and operational. The circuit should be connected to a GPIO pin. The solution should be highly cost-effective, ideally adding only a few cents to the BOM at 1k unit volumes. ideas?

author: Psi
author_rank: Super Contributor
timestamp: July 10, 2025, 02:47:34 am
content: I'm assuming the boot sequence has no ability to toggle/flash the GPIO itself and you need an external flashing circuit that turns off once booting is done?Since the cheapest option would be to just flash it yourself as it moves through the boot sequence?

author: Smile2016
author_rank: Regular Contributor
timestamp: July 10, 2025, 02:49:38 am
content: correct, the boot sequence cannot control LED... assumed to be open drain or high Z

author: Psi
author_rank: Super Contributor
timestamp: July 10, 2025, 02:59:23 am
content: Ok, so accepting that assumption.Some options that come to mind- I'm sure china must make little sot-23 led flashers for peanuts. So could perhaps add one of them along with a circuit that enables it until a cap charges up. The MCU GPIO should be input state at boot. So shouldn't care what you do to the led even if its connected to it, as long as the voltage is within spec and the MCU has power.- A Hacky solution might be using a flashing LED. I suspect if you don't provide enough current/voltage they wont flash and will just behave like a normal LED except dimmer than normal. but it would need testing. Maybe you can abuse that effect to make it flash brightly for a time at boot with a transistor that shorts a series resistor/zener or something based on a cap charging up.- Maybe you can find a ultra cheap clock divider chip that can take the 32khz xtal or mcu xtal clock and turn that into something that can flash at led at visible rate. Probably long shot.- Simple led flasher made from passives and a transistor or two. With cap/transistor to turn it off some number of seconds after power on, or stop the circuit from being able to flash.Most options are going to need some way to turn this flashing off, so a cap that changes up or an extra IO from MCU to stop the flashing.

author: Psi
author_rank: Super Contributor
timestamp: July 10, 2025, 03:05:04 am
content: Do you have access to any other IO on the MCU that might have a signal that turns on/off at visible rate?Like a address line to some RAM/FLASH or something. Maybe you can tap a signal off that during boot time.The flashing would be somewhat random but maybe that's ok?

author: Smile2016
author_rank: Regular Contributor
timestamp: July 10, 2025, 03:11:27 am
content: Quote from: Psi on July 10, 2025, 03:05:04 am-->DDR is in a PoP configuration and not directly accessible, eMMC is connected via SDIO interface.

author: edavid
author_rank: Super Contributor
timestamp: July 10, 2025, 03:14:16 am
content: Make a Schmitt inverter oscillator that drives the LED. Connect the GPIO pin to the inverter's input.

author: Smile2016
author_rank: Regular Contributor
timestamp: July 10, 2025, 03:29:05 am
content: Quote from: edavid on July 10, 2025, 03:14:16 amThat should work, though using a NAND gate with a pull-up on the second input would be even better. Since the capacitor is in the 10 µF range for a ~1 Hz blink rate, it can be difficult for a GPIO to drive effectively at higher pulse rates. Limitation would be GPIO pulse rate faster than the 1st pulse delay...seems like 1st pulse is always longer due cap initial charge

author: Psi
author_rank: Super Contributor
timestamp: July 10, 2025, 05:39:23 am
content: As soon as you consider adding any sort of IC, the best IC cost wise is probably one designed to simply output a flashing LED signal. Though you might find a logic gate that could work its probably going to be a big package with 3 other gates you have to pay for and not use

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 10, 2025, 09:17:20 am
content: Quote from: Smile2016 on July 10, 2025, 03:29:05 amYou can isolate the RC node with an input resistor, so there is no large C load.You also do not need 10u, if you use Megohm resistors.Parts like TC4S584F or BU4S584G2 are single gate CMOS inverters with 3-18V specs, so they can do very low power RC oscillators at 3.3VIf you do not care so much about Icc, 74HC parts might do.See Nexperia 74AHC1G14; 74AHCT1G14 for Icc curves. Using a HCT part allows skewed on/off times.This assumes the GPIO floats during boot, allowing the oscillator to run, and can drive low Z at any pattern after boot.

author: kloetpatra
author_rank: Regular Contributor
timestamp: July 10, 2025, 06:24:18 pm
content: MIC1557: $0.35 + 1 resistor + 1 capacitorhttps://eu.mouser.com/ProductDetail/Microchip-Technology/MIC1557YM5-TR?qs=Y3Q3JoKAO1RdGx3BXrhjHA%3D%3D

author: Smile2016
author_rank: Regular Contributor
timestamp: July 11, 2025, 02:06:18 am
content: Chose the SN74LVC1G14 due to its cost ~0.02$. Testing with initial values: 10k + 10µF + 100k at 3.3V ; we'll see how it performs. Still uncertain about the high-Z behavior of the AM62L at boot so I left a placeholder for a diode.

author: NiHaoMike
author_rank: Super Contributor
timestamp: July 11, 2025, 04:37:13 am
content: Quote from: Psi on July 10, 2025, 02:59:23 amGive a flashing LED a square wave (frequency about 100Hz or so) and it won't flash as it would be constantly getting reset before it has a chance to do so. Then add a resistor so that it does flash with the default tristated output.

author: Zero999
author_rank: Super Contributor
timestamp: July 11, 2025, 09:02:17 am
content: Quote from: Smile2016 on July 10, 2025, 03:29:05 amWhat state do you want the LED be in once it's booted? A NAND gate will just enable/disable the oscillator giving a choice between flashing and on/off continuously, depending on how the LED is wired. A simple NOT Schmitt trigger will give a choice between flashing, steady on, or steady off.I would use NOT Schmitt trigger oscillator with a much higher value resistor and smaller capacitor, say 10M and 100nF, with a 10k series resistor to the GPIO pin. The leakage current when it's hi-Z should be small enough to not interfere with the oscillator, even with a 10M resistor, and the 10k resistor will protect the GPIO pin from surges from the capacitor, whilst still allowing it to inhibit the oscillator.

author: Psi
author_rank: Super Contributor
timestamp: July 13, 2025, 12:45:40 pm
content: Quote from: NiHaoMike on July 11, 2025, 04:37:13 amThat's a great idea.

author: Smile2016
author_rank: Regular Contributor
timestamp: July 14, 2025, 11:40:36 pm
content: Quote from: Zero999 on July 11, 2025, 09:02:17 amA ceramic 4.7 µF capacitor with 100 kΩ and 10 kΩ resistors to the GPIO works well for me with the SN74LVC1G14DCKR. After boot, the LED should either stay ON or blink a set number of times to indicate if any error codes. The series pull resistor on the GPIO that's an order of magnitude smaller than the one in the RC timing network is enough to prevent oscillations, regardless of whether the logic state pulled HIGH or LOW. GPIO pin in a high-impedance state allows free running. I wouldn’t go above 470 kΩ due to the GPIO high-impedance characteristics and potential issues from leakage currents, PCB contamination, capacitor leackage , etc. Thanks, everyone!

author: Paradroid
author_rank: Contributor
timestamp: July 15, 2025, 05:45:40 am
content: If you're making high volume, then no component is the best component.The boot loader of the AM62x is open-source (it's U-boot). The chip has three ePWM modules. If you don't need all of them in your application, connect the LED and a series resistor to one of the pins and slip in the PWM init into the first commands of UBoot. This blinks the LED during boot, near-immediate after power-up, and gives software control when the system is up and running.

author: amyk
author_rank: Super Contributor
timestamp: July 15, 2025, 06:05:10 am
content: A tiny MCU (this one is 1.5 cents:https://zeptobars.com/en/read/Nyquest-Technology-NY8A051H-8051-smallest-microcontroller) will satisfy your cost constraints.

author: Zero999
author_rank: Super Contributor
timestamp: July 15, 2025, 10:21:30 am
content: Quote from: Smile2016 on July 14, 2025, 11:40:36 pmYes, on reflection the resistor values I suggested were too high.For completeness, a classic two gate CMOS oscillator will also work. Connect the input of U1A to the GPIO pin.U1 can be the 74LVC2G04.https://www.ti.com/lit/ds/symlink/sn74lvc2g04.pdfThis circuit has no advantages or disadvantages over the Schmitt trigger oscillator, the twin gate package is the same size as the single gate package. I just thought I'd suggest it as an alternative.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 15, 2025, 10:32:57 am
content: Quote from: Zero999 on July 15, 2025, 10:21:30 amThat’s not quite true.A dual gate osc has lower ICC, as the waveform spends more time away from the current peaks.It also is more predictable, as the effect of hysteresis span is reduced.If not using Schmitt gates, the positive feedback path should be first, to avoid edge oscillation.That’s a bigger problem if clocking from the osc.See nexperia data for icc vs signal level

author: Zero999
author_rank: Super Contributor
timestamp: July 15, 2025, 10:53:41 am
content: Quote from: PCB.Wiz on July 15, 2025, 10:32:57 amI knew about the current peaks, but didn't think that was an issue as the LED uses much more power . I didn't think about the hysteresis span but does that matter, since the frequency is unimportant?What do you mean about the positive feedback path being first? Is that the case with the circuit I posted?I think I the 74LVC2G04 wasn't the best suggestion. It's a buffered gate, consisting of three inverters in series, which can can form a high frequency ring oscillator, when biased into the linear region.An unbuffered IC, such as the 74LVC2GU04 might be better to reduce the risk of parasitic high frequency oscillation.https://www.ti.com/lit/ds/symlink/sn74lvc2gu04.pdf

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 15, 2025, 08:26:42 pm
content: Quote from: Zero999 on July 15, 2025, 10:53:41 amIn this loose case, it may be 'ok', but this was about comparing topologies in general.Quote from: Zero999 on July 15, 2025, 10:53:41 amSee the HEF4541 - that has a non-inverting first stage, so the positive pin (cap) changes first, then the negative pin follows.The HEF4060 has a UB inverter first, as that part can also use a crystal.The PCB layout should also take care to avoid parasitic C coupling to the negative path, exceeding that of the positive path.Quote from: Zero999 on July 15, 2025, 10:53:41 amOr you can use a Nexperia 74LVC2G04, as that has schmitt action on the pins.Another two gate topology is below - this moves the R's to allow control of the sawtooth amplitude. Not all CMOS gates have dual clamp diodes.For lowest power low frequency oscillators, a uA/nA comparator can be used, commonly that has 1 timing C and 1 timing R and 3 schmitt-path R'sAddit: This shows a bad PCB layout, where negative parasitic dominates over positive. Multiple edges can occur.

author: Psi
author_rank: Super Contributor
timestamp: July 15, 2025, 11:37:38 pm
content: Does the MCU have a comparator built in with hardware output channel and programming input threshold that you can setup/init in the first few instructions before the long boot up process starts?Perhaps you can utilize that as part of a flashing circuit. External cap slowly charging up until comp triggers.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 16, 2025, 12:40:06 am
content: Quote from: amyk on July 15, 2025, 06:05:10 amThat's cute, but it is not 8051, in spite of the link heading, and no longer stocks at LCSC, other OTP Nyquist parts are 4-6c, and tagged not for new designs.Given OTP/EPROM parts are fading, only for really high volumes, perhaps they intend the MTP NY8AE51F to replace that?SOT23-6 MCUs are small, but seem to be losing favour. SO8 are common, but large relative to single-gate parts.For small size, some newer parts come in 2x2mm DFN8 / QFN12.The CH32V005D6U6 comes in QFN12, and is the smallest MCU I've found with external crystal support.

author: amyk
author_rank: Super Contributor
timestamp: July 16, 2025, 06:38:57 am
content: This is a somewhat famous ultra-cheap MCU:https://lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_PADAUK-Tech-PMS150C-U06_C168658.htmlDefinitely fits the "adding only a few cents to the BOM at 1k unit volumes" requirement.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 16, 2025, 12:01:35 pm
content: Maybe the classic astable multivib with 2 BJT's (in a single SOT-23-6 or smaller package) is still an option. But it also needs 4 resistors (can be one package?) and two capacitors. Parts are cheap, and the assembly is probably the highest cost.

author: Zero999
author_rank: Super Contributor
timestamp: July 18, 2025, 04:56:37 pm
content: Quote from: amyk on July 16, 2025, 06:38:57 amI don't think an MCU is the best solution.How would you get on continuous, off, or flashing with a single pin?A 2 gate or Schmitt trigger CMOS oscillator will do that. Set the pin to high impedance and the oscillator will work. Set the pin high or low and it will have a low impedance which will damp the oscillator and the output will settle continuously high or low.

author: mariush
author_rank: Super Contributor
timestamp: July 18, 2025, 05:21:00 pm
content: Blinking leds are 2-3 cents in quantity :https://www.tme.eu/gb/katalog/special-effect-leds_113470/?onlyInStock=1&productListOrderBy=1000015When you're done booting, just kill the power to the led (send a voltage on a p-channel mosfet or something like that)

author: amyk
author_rank: Super Contributor
timestamp: July 19, 2025, 01:33:00 am
content: Quote from: Zero999 on July 18, 2025, 04:56:37 pmIt blinks the LED until it sees a high on the GPIO. Then it just "passes through" the GPIO state until reset.