-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add ESP32 DMA Driving? #3
Comments
hi, but it could be that i oversaw something, if you think so, feel free to open a pull request :) |
I wanted to create a piece of HC74 logic that would create the clock signal, decoupling this task completely from the ESP32, but never came around to do it, here is what i came up with so far: its a LogiSim file: |
Yes, that's close to what we do with our libraries, though the clock is generated by the I2S peripheral. There's more details including a link to the original ESP32 example code that shows how to shift data from memory to GPIO via the I2S bus here: https://github.com/pixelmatix/SmartMatrix/wiki/ESP32-Port I don't know what you need to shift out to the ICN2053 chip specifically that is different from "normal" HUB75 panels, but as long as there's no need for the data/address lines to change without the clock, it should be straightforward to adapt the existing I2S DMA code to drive these panels. (The I2S peripheral creates a clock edge for each GPIO update, you can't just update the GPIO without the clock. You could ignore the actual I2S clock signal and manually create the clock by alternating 0/1 manually using up twice the memory) |
Summary of the difference: Comment on request: There is an advantage to doing this. It could allow for higher refresh rates or higher clock depth. If you have more RAM, it could allow for larger chains. However, the primary benefit would be getting that CPU back. Everything else is probably not as important. You have to switch to async thread model. SmartMatrix does not support multicore so this would be the model it would use. Speculation of 138: You would want to use SPI, UART, etc. RPI has serializer in PWM. RP2040 has PIO. That should give you the control you are looking for. Configuration is documented in the receiver cards, kind of. |
Comment on conversation: This will not work on the RPI. The software would be more like the current super loop. Again, using SPI, UART, external microcontroller, etc. would allow you to move in parallel. Setup a serial for GCLK then shift out on CLK. When done with CLK block till done with GCLK. Aka make a new PinPulser. This could be done here, without the external hardware. You can do all kinds of clock tricks too. For UART you have to factor in start and stop bits. Now there is a wrinkle here. This applies to not just my suggestion but everyone's. You are changing the algorithm fundamentally to async thread model. There will be concurrency here, which will force you to consider the VSYNC sync point. (You need to be able to stop GCLK.) Working around this is possible in both approaches. (To the best of my knowledge at least.) For the hardware circuit shown above you will need to use a GPIO instead of LAT? Edit: Edit 2: Edit 3: |
ESP32 + icn2053(FM6353) + I2S DMA :) |
Random thought: Technically you just block until VSYNC. A flag would be set by the data process. The multiplex logic would stop on that flag when it reaches the VSYNC line and clear the flag. This would release the data process to start the VSYNC process. (There may need to be a some GCLK operations too.) VSYNC forces serialization due to shared internal state. A fully concurrent process is not supported to the best of my knowledge. (This would create tearing anyhow.) Edit: |
I was forwarded a link to your project by someone that's trying to get ICN2053 panels working in SmartMatrix Library (my project). I see you ruled out using PWM to drive these panels, but have you looked into using DMA to toggle GPIO pins to update the panels? That's what SmartMatrix Library and other libraries like this one use to continuously refresh the panel without using the CPU. I haven't looked into the details of how the ICN2053 needs to be refreshed so I may be missing some reason why DMA driving GPIO wouldn't work.
The text was updated successfully, but these errors were encountered: