question about TC397 implementation of TC264 camera data acquisition

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
happyeveryday
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

The TC397 does not have a TIF interface, can I use GPIO to emulate the TIF driver? For example, by using GPIO external interrupt to detect camera VSYNC, HERF and PIXCLK, and by configuring 8 consecutive pins into input mode and using DMA to transfer the values in their registers to memory to simulate parallel data transfer.
Is this idea feasible and is there anything I should be aware of?

0 Likes
12 Replies
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi,

the CIF interface is not everywhere available among the A2G devices. Try the TC37xEXT device. There you have one. Generally spoken, it could also work without CIF module available. Do you want to provide the clock signals with the AURIX or do you have somehow an external source for it?

Best regards,

TBencher

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi,

ok sorry I was in display mode. You should get your clock signals already from the camera. Here you need to process your incoming signals in parallel. The best way to do it is to use the GTM I suppose. Hopefully that helps.

Best regards,

TBencher

0 Likes

My idea is to trigger a DMA data carry through each camera PCLK cycle. 8-bit parallel data is stored in the data registers of p02_0-p02_7 and the PCLK frequency is 50Mhz, how should I get the PCLK to trigger my DMA carry? I don't quite understand what you mean by GTM, could you please give a more detailed explanation? Thank you!

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi,

you would need to define an interrupt (eg. rising edge of pixel clock) and initiate a DMA transfer in within this routine. You always need to initialize those kind of transfers and you need of course a suitable destination address for it. If I assume you're doing image processing afterwards, you should iterate your destination address throughout every rising pixel clock edge within your HSYNC scope. You should also calculate whether your destination memory space is large enough for your operation. Using DMA is clever because of it independency from CPU. The thing here is as soon as you call your above mentioned interrupt routine you surely interrupt your program flow at CPU. Using GTM would prevent you from that. But using this module would also need comprehensive knowledge of it, unfortunately.

We are quite familiar with image processing in all its facets. Hence, If you would give us a little bit more insight, we could get mentally a little bit more involved. For more, please contact us directly.

Best regards,

TBencher

0 Likes

What you said is exactly what I tried, but the pixel clock is a sinusoidal signal with a frequency up to 50Mhz. I tried to sample its rising edge with an external interrupt(ERU). This sampling is always for square wave signals, and for sampling sine signals is a bit unreasonable in itself, and the result confirms my idea. I missed almost four fifths of the rising edge. What should I use to sample the rising edge of the pixel clock in a more accurate way? Thank you very much for your answer.

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi,

pixel clock is supposed to be digital for further processing. Please could you tell us the sensor type? It sounds like you are yet at the analog side. Or is the resolution of your oscilloscope not large enough. How do look your HSYNC and VSYNC signals like? Please also put an image of the pixel clock signal in here.

Best regards,

TBencher 

0 Likes

My camera used is OV5642. The pixel clock and Hsync is like the following image. 

happyeveryday_0-1659609059348.jpeghappyeveryday_1-1659609078049.jpeg

 

0 Likes

The timing diagram drawn in the user manual does show the pixel clock as a square wave, but what I actually see with the oscilloscope is not.

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi,

ok we are digital. I think the possible sample rate at your Oszi is not high enough.
Ok this looks normal to me. Do you have a signal generator available? If yes you could just emulate
the pixel clock signal and try to setup an interrupt on rising edges and calculate the incoming frequency or just toggle an output. Then you can check whether you read the signal properly or not. Start with lower frequencies and then all the way up to higher ones. Let's see what happens....

Best regards,

TBencher

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi again,

you could also take the original pixel clock, define an interrupt for rising edge upon your input signal and toggle an output. Then check with your oscilloscope wether your output signal is regular square wave with 50% duty cycle.
This frequency is of course lower than the incoming one, but it's shape tells us wether its reading work.

Best regards,

TBencher

 

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Any news?

 

Best regards,

TBencher

0 Likes
happyeveryday
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

I tried to use a signal generator to generate a 50Mhz square wave, but unfortunately the signal generator I could use also showed strong distortion when the frequency reached above 15Mhz, and it didn't look like a square wave anymore.  I'm trying to figure out other ways to generate a 50Mhz square wave.

Best regards

0 Likes