-
Notifications
You must be signed in to change notification settings - Fork 10
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
Completion handling doesn't wait for DMA completion (only for PIO completion) #1
Comments
Hi, I think you're quite right, this is technically a bug. In an earlier implementation I was waiting for DMA completion but I must have dropped that when I moved over to using the PIO ISR. In practice, I expect this is very unlikely to be a problem - I'd expect the remaining DMA transactions to complete extremely quickly after the PIO interrupt fires; worst case there's 3 planes, 4 entries in each, so a total of 12 DMA transfers needed to completely drain the FIFOs. That would be 12 cycles assuming no bus contention, and best-case the M0+ interrupt entry latency is 15 cycles, so in all likelihood the ISR won't have even started executing by the time the DMA finishes. Still, I'll have a closer look at whether this could be a problem, I need to check what could slow the DMA down. |
Thanks for your kind reply, it is very detailed and helpful to me. Would you mind giving me some technical advice? |
Hi sorry, forgot about this. That sounds OK, it will depend on whether your display can directly take the pixel data or if it needs some conversion or some additional commands at the start of every line for example. If you have enough RAM, I think it would be easier to write the camera data to memory first, then write that to the display. Then you have more control over the timing and you'd be able to add stuff to the image like if you wanted to add text or a reticule or something. Sounds interesting anyway! |
My company develops a lot low resolution image sensors, so I can find a grayscale (mono) sensor for my project :). Because I want to separate PIO & DMA (two parts work independently),now I am thinking about how to let MCU know there is a new frame coming (to start the DMA job). It seems IRQ is only way. Anyway, thanks for your kindly support and chat. |
Hi Brian,
Thanks for your article and sample code, I am studying about PIO and try to create a simple sensor<>LCD project.
After studied your source code, there is a little question about ISR.
Why your capture callback is rely on PIO's ISR but not DMA's ISR? Am I misunderstand something?
The text was updated successfully, but these errors were encountered: