Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

MaHo_4757026
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

I've working I2C communication from my PSoC 4 as I2C master, with si1153 proximity sensor as slave, however I'm polling in main loop for a flag that will be set on falling edge from slave device specific pin. If this flag is set, I'm doing a block read.

If I try to perform the block read directly from the pin ISR, no I2C communication is performed? I would like to have ISR triggered I2C read method without the need for polling to be as fast as possible, how can I achieve this?

This doesn't do anything:

CY_ISR(btn_prox_isr_Handler)

{

    uint8_t buffer[13]; 

    Si115xBlockRead(0, SI115x_REG_IRQ_STATUS, 13, buffer);   

   

    prox_int_btn_ClearInterrupt();

}

0 Likes
1 Reply
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi MaHo_4757026​,

We would like to review your code   Si115xBlockRead() to find out the issue. Can you please share your project in this forum so that we can debug the issue.

Also, are you using high level or low level APIs to perform transfer? High level APIs work on interrupts and therefore if the priority of the I2C is less than the priority of the pin interrupt, then your I2C ISR will not be executed and the communication will not happen. Can you ensure that the priority of I2C is greater than the priority of the pin interrupt?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes