I found mentions of a FlexIO Camera Demo for NXP's Kinetis processors, but from what I could find - there isn't any similar demo provided with the 2.5.0 SDK for the RT1015 / RT1020 parts.
Has anyone ported this demo over to the RT series devices?
I'm looking for a similar reference to start from:
FlexIO w/ data coming in from pins in parallel, sampled on the positive edge of an external clock... signalled by another external pin for start/stop.
Hi Hui_Ma
Thanks again for this demo - I'm working on converting this to work for my setup (RT1015 to a camera a 12 pin data interface (+line valid / frame valid).
Could you help me understand a few things?
1.
For the 12 bit data - can you confirm the only change there needed is the parallel data width?
Would I need to change anything w/r/t the number of shifters the demo uses (currently 4)?
In fsl_flexio_camera.h - I updated:
2.
Can you give advice on how I can break / interrupt after just a single line instead of a full frame of all lines? (it seems that just swapping LV and FV (what you call HSYNC & VSYNC) and manually starting streaming / flexio didn't work for me.
My goal with this question is merely to view a single line in memory before it's overwritten (our memory footprint is very small).
3.
In the demo code, I don't see where the code tells the Ov7670 to actually start streaming, does streaming start at the end of
?
Thanks!
-Andrew
Hi,
Sorry for the delay reply.
Please check the author's feedback:
1. Sorry. The FlexIO camera interface does not support 12-bit camera by default. To support a 12-bit camera, the driver and the project required several modifications, not just the macro FLEXIO_CAMERA_PARALLEL_DATA_WIDTH.
timerConfig.timerCompare = 8U * base->shifterCount - 1U;
to be:
timerConfig.timerCompare = (64 / FLEXIO_CAMERA_PARALLEL_DATA_WIDTH) * base->shifterCount - 1U;
I haven't used a 12-bit camera before. There may be other modifications needs to be done.
2. To break / interrupt after just a single line or several lines:
Enable DMA interrupt in the flexio_ov7670.c -> configDMA() function:
3. OV7670 automatically starts streaming once the XCLK is provided.
Wish it helps.
best regards,
Mike
Aaaaand - I got the major loop IRQ working now - was missing this:
So I'm good to go for now. Thanks again.
Hi Andrew,
Quite sorry for the delay reply.
I just back from my PTO.
Nice to hear the progress.
Please let us know if there with any issue about this application. Thanks.
best regards,
Mike
Hi Hui_Ma,
So using an extra buffer to save "last capture" before it's overwritten by the DMA - it looks like I'm getting valid data in - so scratch my previous post about the 12 bit issue...
(I see data at around 2500 (max 12 bits) when pointing the camera directly at lights, and then data values dropping to 100~200 when covering the lens).
So I'm just back to trying to figure out how to get the DMA interrupt @ end of transfer.
Will consider rewriting the FlexIO->DMA->buffer code w/ a similar flow as the DMA SDK demos if there aren't any other suggestions?
One further bit of follow-up.
Looking at the RT1020 RM, it appears that I should revert the PWIDTH to:
as per the PWIDTH description that appears to indicate that the FlexIO module auto-handles configuring the correct # of pins, and then sets the shift accordingly:
That said, setting PWIDTH to 12 (but leaving the TIMCMP correct via:
still gives me data that's outside the 12 bit bounds.
Section 44.4.4.1 Parallel Interface states that PWIDTH < SHIFTSIZE should get prefixed with 0's by the FlexIO module, but I'm getting data like this:
In order to try and get the DMA interrupt, I've also tried calling:
from void FLEXIO_AS0330Init(void), which is my version of
but this didn't help me get any interrupts...
I also tried running this in main after the EDMA_Init call, but also no success (either directly calling the DMA0_DMA16_IRQHandler() or the EDMA_Callback()
What might I be missing to trigger that DMA interrupt / or see it?
Hi Hui_Ma ,
Thanks for the detailed input!
I'm not seeing the DMA ISR get hit..., I'm using DMA0_DMA16_IRQHandler from the startup files.... is this not the correct ISR to "override"?
Hi Andrew,
Quite sorry for the delay reply.
I need to check with related engineer for the detailed info.
I will let you know when there with any feedback.
Thanks for the patience.
best regards,
Mike
Thanks Mike!
Going through it now