PSOC63 I2C: Losing data when 'useRxFifo' enabled

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

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

When PSOC63 is master and 'useRxFifo' enabled we losing data within 28bytes if interrupts are disabled for more than 400msec or so.

Expected Data: 40011900031E030008000102038081828302D002FF020004881001AE

Received Data: 4001198302D002FF020004881001AEFFFFFFFFFFFFFFFFFFFFFFFFFF

 

When 'useRxFifo' is enabled the MCU suppose to receive up to 127 bytes on its own without intervention firmware right? Why are we seeing this effect for less than 32bytes?

We are planning to disable the useRxFifo, but want to understand just to make sure.

0 Likes
1 Solution
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @RaMu_4639021,

From the expected and actual data that you attached, it is observed that the bytes are being missed in the middle of the entire data frame. After initializing the I2C Master (I2C initialization code), set the RX FIFO level as maximum i.e. 128 using the following API Cy_SCB_SetRxFifoLevel().

Please check the above instruction once and update the thread.

Thanks 

Ganesh

View solution in original post

0 Likes
7 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Can you please attach the I2C Master project that you are using? You can attach the demo version of the project which reproduces the issue.

Thanks 

Ganesh

0 Likes

Hi Ganesh,

Unfortunately, We don't use PSoC Creator, so I don't have a project to share with you. Just adding the following in our idle task causes the problem.

uint32_t interruptState = Cy_SysLib_EnterCriticalSection();
cpu_delay_us(400);
Cy_SysLib_ExitCriticalSection(interruptState);

 

0 Likes
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

1. Can you please let us know whether you are using Low-level APIs or High-level APIs for I2C Master?

2. Generally, we recommend you to use CPU Sleep in idle mode. Can you please tell us why are you using EnterCriticalSection and ExitCritical section?

Thanks and regards

Ganesh

 

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

Hi Ganesh,

Thanks for the response.

We use High-level APIs for I2C Master.

We go sleep in idle mode, we set up a lptimer before going to sleep to keep track of the amount of time it spent in sleep for OStick correction, that lptimer code was in the critical section to cause the problem, Now we manage to move that code out of the critical section, but still worried for other critical sections.

 

With useRxFifo disabled everything works great, but like to enable it to reduce firmware intervention in I2C comm.

0 Likes
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Can you please try using I2C Low-level APIs instead of High-level APIs? Please refer to PSoC 6 I2C Master Low-Level Code example in PSoC Creator, which doesn't require interrupts. I am attaching the code example with this email. 

Thanks

Ganesh

0 Likes

Hey Ganesh,

Our system uses the cooperative multitasking scheme with a little over a dozen tasks, Don't want to use blocking low-level apis.

0 Likes
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @RaMu_4639021,

From the expected and actual data that you attached, it is observed that the bytes are being missed in the middle of the entire data frame. After initializing the I2C Master (I2C initialization code), set the RX FIFO level as maximum i.e. 128 using the following API Cy_SCB_SetRxFifoLevel().

Please check the above instruction once and update the thread.

Thanks 

Ganesh

0 Likes