cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

Hi there!

   

I've searched quite a lot for my I2C-Problem wihtout any success...now I hope you can help me!

   

It seems that the I2C in MultiMasteSlave-Mode has kind of bug or undocumented state:

   

When I use the API MasterWriteBuf and there is no slave on the bus, the I2C (actually the whole device), "dies".

   

Acutally it gets stuck in an endless loop calling the I2C_ISR.

   

Looking at the Pins, the Master sends the address, doesn't get any ACK of course, and then holds the CLK low and loops inside the ISR.

   

And due to the loop, there is nothing I can do...(ok, a watchdog would do the job, but that is not what we want)

   

 

   

Setting the Component to MultiMaster without slave, everything works properly: MasterWriteBuf returns 0x00 and then MasterStatus returns 0x22, which is "write complete" and "addr not acked" - perfect!

   

 

   

Does anybody has any idea what is wrong? Am I missing something or is it a component bug?

   

Thanks!

   

 

   

UPDATE: I think it is something like a BUG/unhandled condition. Writing to your own slave-address causes the I2C to get stuck, as the slave-code seems to corrupt the status. I know this seems strange, but I am using the I2C only as a physical layer for a protocol, where every device has the same slave-address.

   

 

   

WORKAROUND: before writing to the bus, change the slave-address to something safe...and after the master is done set it back to what you want!

   

 

   

Maybe this could be handled inside the component in the future....i.e. prevent it from reading/writing to itself...

0 Likes
Reply
1 Reply
Moderator
Moderator

Hi Christian,

Having multiple slaves with same address is not I2C compliant. So the work-around you are suggesting is actually making it I2C compliant. 

Best Regards,
VSRS

 

0 Likes
Reply