cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

IlHa_3972631
New Contributor

Hi,

How can I reset the CX3 timestamp timer ?

thanks

0 Likes
1 Solution
KandlaguntaR_36
Moderator
Moderator

Edited:

Changed the timer incrementing value to 1ms from 10 ms.

Hello,

Typically, In CX3/FX3, the timer gets increment for every 1 ms - called a timer tick.

If you use CyU3PGetTime API to get the timer tick, it will give the number of ticks from the start of the OS.

For example, if you are streaming 30 fps, one frame takes 33.33 ms.

In this case, timer ticks update 10 ms, 20ms and 30ms and 40 ms. Hence, you cannot capture time 33.33 ms.

Therefore, you don't get proper time stamp for synchronization in CX3/FX3.

You can use CyU3PGetTime and CyU3PSetTime to get and set the timer tick. Please refer API guide for usage of the APIs.

View solution in original post

0 Likes
10 Replies
KandlaguntaR_36
Moderator
Moderator

CX3Timestamp - Do you mean Timer used to reset the DMA channel when the timer is up (No DMA activity)?

0 Likes
abhinavg_21
Moderator
Moderator

Hi,

Are you talking about ITP Time Stamp Register mentioned in section 10.16.6 of FX3 TRM?

Thanks & Regards
Abhinav

0 Likes
IlHa_3972631
New Contributor

I meant the timestamp that added to each frame

0 Likes
KandlaguntaR_36
Moderator
Moderator

Do you mean the time stamp that you see on USB data sent over the USB Bus?

If yes, please let us know what is the requirement to reset the timer.

0 Likes
IlHa_3972631
New Contributor

Yes.

The requirement is when the CX3 get interrupt from external GPIO pin then it do timestamp reset.

Whether the CX3 GPIO can be used as interrupt?

thanks

0 Likes
KandlaguntaR_36
Moderator
Moderator

Please let me know what is the requirement of resetting the time stamp.

0 Likes
IlHa_3972631
New Contributor

1. Can you please describe how the frame timestamp mechanism works?

2. What do you mean a requirement of resetting the time stamp?

0 Likes
KandlaguntaR_36
Moderator
Moderator

In the UVC example FW (An75779 and OV5640 example firmware), we have not used any time stamp fields (dwPresentationTime and dwSourceClock - extended feilds of payload header ) in the UVC Payload header. We are passing zeros to all the fields.

static uint8_t glUVCHeader[CX3_UVC_HEADER_LENGTH] =

{

    0x0C,                           /* Header Length */

    0x8C,                           /* Bit field header field */

    0x00,0x00,0x00,0x00,            /* Presentation time stamp field */

    0x00,0x00,0x00,0x00,0x00,0x00   /* Source clock reference field */

};

As per the UVC 1.5 Spec., section 2.4.3.3 Video and Still Image Payload Headers, there are dwPresentationTime and dwSourceClock fields to mark the presentation time stamp and Source reference clock. These are mandatory in the following case:

  • The device has multiple video and/or audio source functions and is sending audio and video streams to the host.
  • The video and/or audio streams are interrelated and therefore need to be kept synchronized.
  • The stream format in use does not already contain timestamp and clock reference information (MPEG-2 TS is an example of a format that contains this information).
  • The sample is part of a video frame (and not a still image frame).

Can you please confirm whether it is mandatory in your case?

0 Likes
IlHa_3972631
New Contributor

The following is mandatory in the our case:

  • The video streams are interrelated and therefore need to be kept synchronized.

We have two CX3 that connected to usb Hub, each CX3 is connected to sensor and therefore we need to synchronized the timestamp between the two CX3.

0 Likes
KandlaguntaR_36
Moderator
Moderator

Edited:

Changed the timer incrementing value to 1ms from 10 ms.

Hello,

Typically, In CX3/FX3, the timer gets increment for every 1 ms - called a timer tick.

If you use CyU3PGetTime API to get the timer tick, it will give the number of ticks from the start of the OS.

For example, if you are streaming 30 fps, one frame takes 33.33 ms.

In this case, timer ticks update 10 ms, 20ms and 30ms and 40 ms. Hence, you cannot capture time 33.33 ms.

Therefore, you don't get proper time stamp for synchronization in CX3/FX3.

You can use CyU3PGetTime and CyU3PSetTime to get and set the timer tick. Please refer API guide for usage of the APIs.

View solution in original post

0 Likes