Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the idea of your program #3

Open
schhqq opened this issue Sep 11, 2022 · 2 comments
Open

the idea of your program #3

schhqq opened this issue Sep 11, 2022 · 2 comments

Comments

@schhqq
Copy link

schhqq commented Sep 11, 2022

Hello, Mr. can you briefly describe the idea of your program?

@efthym
Copy link

efthym commented May 30, 2023

Hi. I've studied this repository recently for a similar project that I am planning. The main code regarding the led matrix is in matrix.c.

Here's the outline of how I think it works. Two operations happen in parallel after each latch/strobe pulse (which copies the scanned in data from the shift register to a latch/register):

  • The scan-in of the RGB pixel data using DMA. When all data have been scanned in, an interrupt handler is called (DMA2_Stream5_IRQHandler)
  • A timer (TIM3) is set which outputs the OE (output enable - active low) immediately and after some time OE becomes high (stop displaying) and an interrupt is triggered calling (TIM3_IRQHandler)

The above interrupt handlers must synchronize when the next latch/strobe pulse will happen (to load the just scanned-in data of a row). The last one of these handler to arrive, calls matrix_next(), which handles the latch/strobe pulse and prepares the next DMA transfer and the next timer-controlled OE pulse.

Initially I was buffled by the use of another timer (TIM1) in the code. This is set to trigger each DMA transfer. Normaly the DMA is triggered by a peripheral when it is ready to send/accept data. However the GPIO does not have this capability, hence the use of TIM1.

@Frans-Willem
Copy link
Owner

In case either of you is interested, I know I wrote a blog post at the time writing down my thoughts and why I ended up the way I did here:
https://fw.hardijzer.nl/?p=223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants