8bit input at 25Mhz

Technical questions regarding the XTC tools and programming with XMOS.
Vanillacoke
New User
Posts: 3
Joined: Fri Dec 06, 2013 3:38 pm

8bit input at 25Mhz

Post by Vanillacoke »

Hello

I try to implement a image sensor interface consisting of

D0 - D7 -> 8 Data lines
HREF -> act as data-valid signal. high if pixel data could be sampled. One high phase consists of 1280xPCLK.
VSYNC -> Peak with a defined length at the start of a frame
PCLK -> PixelClock (25Mhz, 50% duty)

Cause the principles of these signals are nearly equal to an Ethernet-PHY (even the clock speed), I implement my first solution according to the Ethernet-MAC software module. This means, I copied the RX port initialisation unchanged and designed the input routine equal to the ethernet input routine. Instead of waiting for the 0xD (sof) I wait for a general input after HREF enables it.

The result is: It does not work. Instead of inputting all 1280 samples, there are only 800-1000 samples taken.

So my assumption is:
The EthPHY uses a 4 bit data port. So the 32bit buffered input port is full after 8 clock cycles.
In my situation the input port is full after 4 clock cycles (160ns)

Before I post my input routines, I have a question:
Is it possible to input 8bit samples at a rate of 25Mhz. I am using the sliceKit XP-SKC-L2 V1.2 using only one thread and no data processing for now.

PS: I guess... it would only be possible if the input routine is implemented using assembler to use each of the 16 possible instructions perfectly... :(

Greetings Vanilla


mmar
Experienced Member
Posts: 123
Joined: Fri Jul 05, 2013 5:55 pm

Post by mmar »

Hi,
you have more ways for workflow with high speed data.
Good inspire is lcd driver. Provide 16bit RGB 565 data in dot speed .
You need double or triple buffer and more threads work together.
Too you can split 8bit to two 4bit buffered port to make more instruction to you...

25MHz is no problem with 125MHz (500) core.
yzoer
XCore Addict
Posts: 133
Joined: Tue Dec 15, 2009 10:23 pm

Post by yzoer »

You should be able to read 8-bits at 25mhz. At 25mhz, you have 40ns at your disposal. Given that each core run at 100mhz (caveat, as long as there are less than 4 active), you can execute 4 instructions per sample.

It does come down to a) making sure your loop fits and b) you have no other threads competing for resources. One way I went around this in my vga module was to unroll your loop and fill the remaining slots with instructions like pointer updates, counter decrements etc.

Have a look at the VDP-1 VGA driver and let me know if you need more help!

Yvo