Skip to main content

Check Your Understanding 10.2.4 Check Your Understanding

1.

A four-digit display has 34 LEDs and 14 pins. At any single instant, roughly how many of those LEDs can be lit?
  • Only the ones in one row of the grid, a fraction of the display. The rest are dark until their turn comes round.
  • Correct, and it is the price of the wire saving. A grid can energize one row at a time without lighting LEDs in other rows, so the display is swept row by row. What makes it look continuous is that the sweep is much faster than the eye.
  • All 34, because each LED has its own controllable path through the grid.
  • If each LED had its own path there would be no saving and no need for a grid. That arrangement is exactly the 34 wires the grid exists to avoid. In a grid the wires are shared, so lighting an arbitrary set of LEDs at one instant is not possible.
  • Exactly one, because only one wire can be energized at a time.
  • Closer, but too pessimistic. One row’s worth can be lit together, every LED where the energized row meets an energized column, which is why a whole digit can be shown at once.
  • All 34, but at a lower brightness, because the current is shared between them.
  • Brightness does drop as the number of rows goes up, because each row is only lit for its share of the time. But that is a consequence of the sweeping, not an alternative to it: at any one instant the LEDs outside the current row are fully off.

2.

What would your program have to do differently if the display had no HT16K33 on it, if the fourteen wires came straight to the STM32C031C6?
  • It would have to keep sweeping the grid continuously, forever, fast enough that the display does not flicker, on top of whatever else it was doing.
  • Correct. The image exists only while something is refreshing it. That is the job the backpack takes off your program, and it is why the backpack is worth two wires and a datasheet.
  • It would have to send the display data fourteen times instead of once.
  • The number of wires is not the number of sends. What changes is not how much data you send but that you can never stop sending it: the refresh has to keep running.
  • Nothing would change in the program; only the wiring would.
  • The wiring is the smaller half. Without a controller, generating the multiplexed sweep becomes the program’s job, and it is a job with a hard real-time deadline that never ends.
  • It would need a faster clock, because I2C at 100 kHz is too slow to refresh a display.
  • The bus speed is not the constraint: with a backpack the display data is sent once, when it changes. Without one, there is no bus at all: the fourteen wires are driven directly, and the constraint is that the driving never stops.

3.

A grid needs one wire per row and one per column. Which arrangement reaches 34 LEDs with the fewest wires?
  • Something close to square, around 6 by 6, because for a fixed number of LEDs the sum of rows and columns is smallest when the two are similar.
  • Correct in principle. 1 by 34 needs 35 wires; 2 by 17 needs 19; 6 by 6 needs 12. The real display is not free to choose, because the grid has to match how the digits are physically wired, which is what we look at in class.
  • One row of 34, because a single row needs only one row wire.
  • One row wire, but 34 column wires, 35 in total, which is worse than no grid at all. The saving comes from balancing the two, not from minimizing one of them.
  • 34 rows of one, so that each LED can be addressed on its own.
  • That is the individually wired arrangement again, with the same 35 wires. It does give you arbitrary control at any instant, which is exactly what you trade away for the wire saving.
  • It makes no difference; any grid holding 34 LEDs needs the same number of wires.
  • Compare 1 by 34 (35 wires) with 6 by 6 (12). The number of LEDs is the product; the number of wires is the sum, and the two behave very differently.