Cam Xcore read pixels at 26.6 MHz 10 bits parallel

If you have a simple question and just want an answer.
Post Reply
uth
Member
Posts: 14
Joined: Sun Jan 13, 2019 4:45 am

Cam Xcore read pixels at 26.6 MHz 10 bits parallel

Post by uth »

Hello, there is a camera chip MT9V022 which outputs pixels at 26.6 MHz, single pixel data is 10 bit parallel. Start of a line readout can be triggered externally. Would bigbanging with Xcore 200 be fast enough to support chips like that?


uth
Member
Posts: 14
Joined: Sun Jan 13, 2019 4:45 am

Post by uth »

The clock of the chip can be set within the range 13.0 to 27.0 MHz. Is it possible that Xcore produces a master clock 100.0*8/30 = 26.66 MHz for the chip? It would allow an asynchronous reading of the pixels, as clock out is simply the master clock inverted.
The question is, can xcore integrate 10, or at least 8, input pins into a word and store it within a sufficient time?
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi. Yes, it is possible.

Recommended reading:

1) Review the code sample at the following URL with title "The following program configures a port to synchronise the sampling of data to an external clock."

https://www.xmos.com/developer/publishe ... and-output

2) Suggest that you allocate a SINGLE BIT port to accept an external clock source.

3) Then drive the above SINGLE BIT port with an external PLL such as the very low cost Si5351 which operates from a 25 Mhz crystal (not an oscillator) and is < $ 1 USD. Adafruit has a low cost test board < $ 9 USD from Arrow (free shipping) that will serve your project well for testing. Using I2C routines with the XMOS CPU, program this PLL (using the Silabs Clock Builder tool - free) and prime the registers to clock out your desired clock with precision. Also drive the same clock to your camera module - you may want to buffer the clocks to each, the XMOS input and again for the camera module - keeping the same skew.

Then proceed to apply as per the above brief article. There are many other documents on the same topic but be sure to allocate the proper ports for the 8 bit access. Chime back if you need other pointers.
uth
Member
Posts: 14
Joined: Sun Jan 13, 2019 4:45 am

Post by uth »

Thanks mon2. But why not make xcore generate the 25MHz clock for the camera chip? Because it would waste processor resources for a simple task?
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

You can consider to do this but the granularity of the clock generation is much more flexible using a true PLL such as the SI5351A. Also, can serve as the XMOS CPU clock. XMOS built a factory OTP programmed component from Silabs where there are 3 pre-defined clock outputs upon power up. This is a nice to have for most project. Bear in mind that internally there are 2 independent clock generators so be sure to assign a dedicated one for say your CPU input clock and use the other for the camera clock. This way, you do not disturb the CPU clock (ie. CPU would be clock-less) during any changes to the other clock. You will always want a glitch free method of clock changes. Otherwise you can lock up the CPU. This is only an idea to use the Si5351A for "any desired" clock value on the fly.

Alternatively, use a fixed clock oscillator for the CPU and use this clock and divide by 4 and output to a single bit port. That is 100MHZ/4 = 25 Mhz for your camera clock. Best to test your idea before applying to a custom PCB layout.

Reference:
https://www.xmos.com/developer/publishe ... and-output

For more details than you may care for on the PLL :), please review this thread:

https://www.xcore.com/viewtopic.php?t=4599

and full source code to program the Si5351A (even the OTP version) over I2C on XMOS CPU:

https://www.xcore.com/viewtopic.php?t=4647&start=10
Post Reply