Camera "SnapShot" Time

6 views
Skip to first unread message

James

unread,
May 27, 2008, 4:55:56 PM5/27/08
to Virtual Cogs
Hi,

I have noticed the snapshot time in the standalone camera application
seems to be longer than expected for the camera module. It's taking
around 500ms for VGA from what I can tell but the camera handles up to
15fps or 67ms, I realise you could miss the start of the frame, say
between 67 - 120ms is what I expected.

So we are out by about 5, the CSI is responsible for the Master clock?
So maybe it's 12Mhz not 48Mhz by default - where do I check/set
something like that.

Or perhaps there is some other divide by clock setting in the
registers

Am I on the right track or is there something else I should know about
the camera module dma transfer time being slower than expected.

Thanks,
James

Dan Foisy

unread,
May 27, 2008, 5:05:26 PM5/27/08
to virtu...@googlegroups.com
James,

The DMA reads the camera data as it's coming in - it has to be as fast
the data.

I'm not sure what you mean by the time being longer than expected - how
are you timing this? If you are using the PC application, I wouldn't
use that as any indication of speed - who knows what delays lurk in
Windows. The only real delay in the mx21 code is where the code pauses
to look for the start of image:
while((CSI_CSISR & 0x00010000) == 0); //wait until start of image

You might also verify that the number of bytes being read in is correct.

Dan

--
Daniel Foisy
Virtual Cogs Embedded Systems Inc.
Unit 4, 5694 Highway 7 East, Suite 311
Markham, Ontario, Canada L3P 1B4
www.virtualcogs.com
416-238-2231

"Your future is modular"

james...@muvium.com

unread,
May 27, 2008, 5:21:46 PM5/27/08
to virtu...@googlegroups.com
Dan,

Yes that's what I thought with the DMA, so I am trying to verify the clock
(PERCLK4) and the MCLK divider (CSICR1-MCLKDIV) settings

<thinking out loud>

I assume this means the it is supposed to run the peripheral at 44.33Mhz
which is close enough to the max of 48Mz

CRM_PCDR1=0x05070705; //PERCLK clock divider settings (44.33MHz)

And I assume is MCLKDIV
CSI_CSICR1=0x00183b12;

So the 3 in there is the MCLKDIV which converts to a scaling factor of 8.
That's about right, 575ms ( I get now ) / 8 = 71ms.. pretty much spot on.

Ok.. I will try changing that and let you know.

Cheers,
James

James

unread,
May 27, 2008, 5:46:55 PM5/27/08
to Virtual Cogs
Thanks for your fast response Dan.

To answer my own question, I want to have the camera clock at ~48Mhz,
44.3mhz will do

To do this it seems you need to set the PERCLK to generate a CSI
master signal and then you divide it again with the MCLKDIV. The
minimum MLKDIV is 2 so we first want 88.6Mhz which requires a change
to CRM_PCDR1

//CRM_PCDR1=0x05070705; //PERCLK clock divider settings (44.33MHz)
CRM_PCDR1=0x02070705; //PERCLK clock divider settings (44.33MHz)x2 =
88.66Mhz

Then you need to change the MCLKDIV
//CSI_CSICR1=0x00183b12; //MCLKDIV = 3 ( / 8 )
CSI_CSICR1=0x00180b12; //MCLDIV = 0 ( / 2 )

So now I have my 44Mhz CSI master clock and my benchmark reports a
sample time of ~71ms which is about right

However, I noticed that at the faster clock rate the image quality
reduces so definetly keep the original clock settings if you want
still images. For my application though I want fast sampling and image
quality isn't so import.

Hope this is useful to anyone else with the same issue.

Cheers,
James



Reply all
Reply to author
Forward
0 new messages