I2C is stopped after 5 to sec time with 5 slaves

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C is stopped after 5 to sec time with 5 slaves

1,004 Views
sreekanthreddyc
Contributor I

Hello, 

We are using I2C lines of MC9S12Z with 5 slaves. 3 of them are TMP75 and 2 of them are INA226 from TI.

We are currently using the code from NXP community which was uploaded by Radek.....

When we tried to communicate the devices, the communication is stopped with in 10 to 15 sec and tried to restart again, the BUS is completely busy for some reasons.

 

Please check and reply.

 

Thanks and Regards

Sreekanth

Original Attachment has been moved to: ZVC192-IIC-HUMIDITY-CW106.ZIP

Labels (1)
0 Kudos
4 Replies

603 Views
iggi
NXP Employee
NXP Employee

Hi,

it looks like some of the slaves is blocking the I2C bus, for example it hangs in 'read mode' holding the SDA line low.

Maybe the code Radek posted has some bug.


The recovery procedure you can find in I2C-bus specification and user manual (page 20):
http://www.nxp.com/documents/user_manual/UM10204.pdf 

Some hints about recovery you can check here:
I2C device dead-lock recovery 

http://www.microchip.com/forums/m175368.aspx 

or this 2-page appnote from analog devices:

Implementing an I2C® Reset

Hopefully the information helps.

Regards,

iggi

0 Kudos

603 Views
anwarhusengokav
Contributor II

Hi Iggi,

Thank you for the information.

I have a doubt on implementing software reset as mentioned in the references provided, as port pins(PT1 and PT0) used for SCL and SDA are configured using the one time writable "Module Routing Register 0 (MODRR0)" in normal mode of the MC9S12ZVC micro. To implement the software reset logic of the we need to change these pins to GPIO mode.

Is this possible to change these pins to GPIO mode during runtime and configure them back to IIC special function pins?

Please let us know your opinion on implementing the IIC software reset w.r.t MC9S12ZVC microcontroller.

Thanks,

Anwar

0 Kudos

603 Views
iggi
NXP Employee
NXP Employee

Hi Anwar,

are you saying you don't have any more GPIO pins available?

Anyway, by writing MODRR0 the routing of peripherals to external port pins is configured. But, the actual assignment (connection) of port pins to a peripheral is done after enabling a particular peripheral.
So in your case, for example, firstly you write MODRR0 and configure the routing. Still the PT0/1 pins can be used as GPIOs and when you enable I2C interface system (IBEN=1), the PT0/1 will be assigned to the I2C system.
Then again you can disable I2C system and port pins PT0/1 will be available for GPIO function.

(note that the I2C registers are available even if I2C system is disabled (IBEN=0)).

Regards,

iggi

0 Kudos

603 Views
anwarhusengokav
Contributor II

Adding to the Sreekanth's question, we would like to know the IIC Communication Deadlock/Busoff recovery procedure with respect to MC9S12ZVC64 microcontroller.

Thanks,

Anwar

0 Kudos