Close

Who's Driving?

A project log for megaPanel: A Monochrome LED Matrix Display Panel

The megaPanel: (16) monochrome LED matrix panels, 8 bits, 120Hz

george-gardnerGeorge Gardner 11/17/2019 at 11:290 Comments

Since I'm using a STM32F446RE to drive this panel, I'll be driving the data pins (DR) using DMA on the STM32 chip.

The way this will work is the DMA controller will receive a request from a peripheral. Once the request is received it will copy a byte from an address in memory to another address in memory. I'll go into specifics later, but we will be copying an array in memory to the GPIO pins to spew out our data. The request will come from a timer, which will also act as the clock signal for the panels. 

The DMA controller can either copy a byte (8 bits) or half word (16 bits) to the GPIO pins. Looking at the panel layout sheet below, you can see I have chosen to daisy chain the left (2) panel rows together, and daisy chain the right (2) panels together. 

The lines and arrows represent the data into the panels, and you can see that I'll be using 8 data lines (DR pin) to drive the megaDisplay. 

Since I'm making use of the DMA feature to automatically change the states of the data pins, I could technically use the DMA to transfer half word to the GPIO port, or 16 bits at a time, allowing me to drive each panel's (since there are 16) DR pins individually. In this case, none of the panels would be linked together. This would allow for the fastest framerate given my hardware, but has the downside of requiring more wires and connections to the boards. 

I could have very well chosen to daisy chain each row together, allowing the need for only (4) data lines in, but the framerate would suffer. One byte, or 8-bits, is a great tradeoff, requiring only 8 data pins in (DR pin), makes use of DMA's one byte transfer, and is a happy medium for achieving a good framerate. 

While I haven't begun programming yet, the sequence would look something like this: 

  1. Timer TIM1 sends request to DMA
  2. DMA copies a byte from an array in memory to the GPIO pins, changing the state of (8) pins <--these are the DR pins
  3. Timer TIM1 creates the clock signal, pin going high AFTER the DMA transfer is complete
  4. Repeat until 256 bits are shifted out (2 panels daisy chained at 128 bits per row per panel) 
  5. Timer clock stops and end of 256 bits to allow software to manipulate the OE, Latch, and Select the next row
  6. Timer is restarted to repeat the process. 

Discussions