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.
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?
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:
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).
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
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;
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.
Aaaaand - I got the major loop IRQ working now - was missing this:
So I'm good to go for now. Thanks again.
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.
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 220.127.116.11 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?
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.