PSOC4 I2C slave with interrupt

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.
SiYe_3979446
Level 1
Level 1
First like given

hi,

   I am working on PSOC4 with I2C with interrupt driven when I2c slave stop condition reached.I am able receive data properly from Master when it is 7 bytes,but if I want receive more than 7 bytes I am facing problem,after sending 2 times from master,I am receiving in slave,but this problem is not observed in without interrupt scenario,If i use I2c with interrupt i am facing this problem,can any one faced this problem.how can i use I2C slave interrupt with more than 8 bytes  coming from Master,without issue,the following is the code,

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi SiYe_3979446​,

I have gone through your attached project. The interrupt issue is being created unnecessarily due to the checking of the condition I2CS_INTR_SLAVE_I2C_WRITE_STOP explicitly. The conditions of FIFO write and read flags being set is taken care by the component ISR itself, therefore you need not check the condition with every slave write complete transfer using the macro.

I have shared my project in which I have included cyapicallbacks.h in the main file and used the I2CS_I2C_SlaveCompleteCallback function to service the interrupt. This callback function is called when slave transfer is completed.  I have defined I2CS_I2C_SLAVE_CMPLT_CALLBACK in the header file. You can go through this macro in the component datasheet.  Please go through the attached project and let us know if you are facing the same issue again.

Also, the number of bytes should not be a problem as the size of software buffer is enough to handle as per the maximum size of RAM.

Thanks and Regards,

Aashita

View solution in original post

3 Replies