>>> I want to interface a 1.3MPixel CMOS sensor to the xdio port of ts-
>>> 7300. The xclock frequency of camera is 24Mhz, which means each pixel
>>> should be read within 41.7ns. Can xdio achieve this high speed? I
>> ever write the following code:
>>> unsigned char buf[1280*4];
>>> for (i=0;i<1280*4;i++){
>>> buf[i]=xd2->base[2];
>>> }
>>>
>>> but it can only capure about 200 pixels per line. Why?
>
> Write a simple test where you toggle an XDIO line.
I wrote a test to toggle the bits in XDIO#1.
With the loop
while(1) {
*port = 0;
*port = 0xFF;
}
and optimization on, the code disassembles into
a 3-line loop containing strb, strb, and b.
Thats about the smallest loop you'll get.
The I/O toggled at 3.5MHz, i.e., about 285ns period.
So, each write low or high takes about half that.
Assuming the XDIO control port is a typical register,
then 7MHz is the fastest rate you write to the FPGA,
i.e., 7MB/s for a byte-wide register, 14MB/s for a
16-bit wide register.
If a 24MHz sensor with 8-bit data has a continuous
data rate of 24MB/s, you're out of luck!
However, an image could be captured into a buffer, and
then transmitted to the ARM;
capture time: 1.3Mpixels / 24MHz = 54.2ms
transfer time: 1.3Mpixels / 14MB/s = 92.8ms
But, the Cyclone doesn't have 1.3MB of memory,
so you'd have to buffer the data into the SDRAM.
Which means you'd need to check that its bus bandwidth
can hit 24MB/s; which I'm pretty sure it can since its
clocked at 75MHz and is 16-bits wide.
So given that you have to send data to SDRAM, and then
read from SDRAM, your time for 1 image is at best
about 150ms, or about 6 frames per second.
Of course if you could slow the sensor clock to say 5MHz,
then you could probably do this with the XDIO.
Hope that helps.
Dave
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|