CX3 USB HID with ICM20602 sample rate not stable

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

cross mob
lock attach
Attachments are accessible only for community members.
JerryLin
Level 1
Level 1
First reply posted First question asked Welcome!

Hi Sir. 

Good day. We had met some issues for using CX3 USB HID with IMU ICM20602. The sample rate now is set to 1k but it does not quit stable. Our architecture is as follows

JerryLin_0-1620639500407.jpeg

 

I also provide the reference config and code at attched file src.zip.

Does anyone has idea or further suggestion for debugging this issue?

 

 

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

From the discussion we understood that a thread execution was hindered when multiple application threads are used, which caused the delay in reading the sensor. 

- Please check if the device does not enter suspend mode by calling CyU3PSysEnterSuspendMode. Also,  check if the control is not stuck in the other execution thread.

- As the problem was due to delay in execution of one thread out of 2 threads even though both the threads had same priority, please check if the DMA callback doesn't include code that is slow or time consuming( for example calling CyU3PDebugPrint or copying large amount of data  inside DMA callback). As DMA callback holds higher priority, this might hinder the execution of application thread.

Regards,
Rashi

View solution in original post

0 Likes
3 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please let me know the details of the problem faced.

I understand that there is some issue on the SPI interface of CX3 which communicates to  IMU ICM20602 . Please confirm.

The sample rate now is set to 1k but it does not quit stable

>> Kindly let me know to which interface does 1K sampling rate correspond

Regards,
Rashi
0 Likes

Hi Rashi,

1K sampling rate correspond to SPI interface. At same SPI interface we have  IMU ICM20602 and flash on it. There are 2 GPIO on CX3 for chip select. Thanks

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

From the discussion we understood that a thread execution was hindered when multiple application threads are used, which caused the delay in reading the sensor. 

- Please check if the device does not enter suspend mode by calling CyU3PSysEnterSuspendMode. Also,  check if the control is not stuck in the other execution thread.

- As the problem was due to delay in execution of one thread out of 2 threads even though both the threads had same priority, please check if the DMA callback doesn't include code that is slow or time consuming( for example calling CyU3PDebugPrint or copying large amount of data  inside DMA callback). As DMA callback holds higher priority, this might hinder the execution of application thread.

Regards,
Rashi
0 Likes