4 ms·
What do you mean by "crowbar current"? Running the bus for a large array definitely takes a lot of power, but I agree it wouldn't be huge compared to the LEDs
by cffddjkkbtdhjv 7y ago
What do you mean by "crowbar current"?
Running the bus for a large array definitely takes a lot of power, but I agree it wouldn't be huge compared to the LEDs themselves.
> Now the hardware to compute the binary signal is the same as the PWM because you still need to subdivide the clock and count to know how many phases have passed to pulse at 1, 2, 4, 8ms, etc. This is typically done with dedicated hardware (the Atmega has a fairly unsophistcated PWM compared to TI, ADI or STM). Ideally you want the PWM to use the IO fabric to DMA the data, and not have the CPU twiddle GPIOs, that's a sledgehammer approach.
BCM isn't used when hardware PWM is an option. It's used for displays driven by long long chains of shift registers where you have to reload a whole frame to change an LED's state. Your DMA is sending data to a hardware SPI transmitter, not a PWM block in this case. There are ICs designed for _very_ large, high-end LED arrays that have hardware PWM for each LED, but they're less common and much more expensive.
You also don't really need to 'compute' BCM. You generate a bit-sync pulse or interrupt or whatever that runs once for each bit. At that point you just grab the pixel from the frame buffer, mask the correct bit, and output it to the array. The advantage over PWM is this bit-sync only runs 8 times (or whatever the bit depth) instead of 256. The shortest time between syncs is still the same length of the equivalent PWM signal, but the length between them grows but double each time (up until the start of the next period).
> Also, the PWM rate is not fixed, it does not have to be 256 pulses. Depending on the hardware it can go from Hz to MHz (it impacts responsiveness). But that is a function of the MCU, and Atmega has fairly coarse adjustment for the PWM modes.
256 is the number of grayscale colours (2^bit depth), not the pulse rate. Just like PWM, BCM can run at any rate or any bit depth.
You're really hung up on microcontroller PWMs. They're certainly helpful, and you certainly can use them to drive LEDs, but they top out at anywhere between 2 and 24 channels, so they aren't cost-effective for large, dense arrays. These LED drivers are really just shift registers, so they're dead simple and very, very cheap.