Hi, I'm working with a KL25Z MCU in an I2C multimaster configuration (yes, it's a nightmare but such is life) and sometimes the bus gets locked up when 2 masters are trying to initiate communication at the same time.
I'm trying to use the SHTF1 bit from the SMB register to determine if the I2C bus is idle but I've got mixed results (sometimes the bit is set sometimes it isn't). I have a custom hardware already produced and cannot use external pins to detect the state of the lines.
Have any of you worked with the SMBus register before? Any advice?
Cheers,
Alex.
Solved! Go to Solution.
Hello Alexander,
I suggest you to check the BUSY flag in Status register right before start of communication. Each master has to check it first and then generate START condition and continue with communication.
I think it will help you to solve your issue.
Best Regards,
Stano.
Hello Alexander,
I suggest you to check the BUSY flag in Status register right before start of communication. Each master has to check it first and then generate START condition and continue with communication.
I think it will help you to solve your issue.
Best Regards,
Stano.
Hi Stano,
Thanks for the advice (and sorry for the delay in my response, I just had a chance to test your answer). You are right the BUSY flag is the way to go. My problem was that after detecting the BUSY state I was generating a repeated START condition instead of waiting for the line to be free.
Regards,
Alex.