cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 - I2C Restart after Lock-Up

askansimon2
Associate II
Posted on October 02, 2010 at 00:04

STM32 - I2C Restart after Lock-Up

4 REPLIES 4
Posted on May 17, 2011 at 14:09

But this dont work. I missed something?

Yes, you can reset the STM32, but resetting slave devices is more difficult. You'll need to clock them out of whatever state they are in.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
askansimon2
Associate II
Posted on May 17, 2011 at 14:09

Hello clive1,

thank you very mutch for your information. Yes, maybee the sensors (honeywell

HMC5843

compass, or VTI scp1000 pressure sensor) make the problems.

Both are on I2C1.

I do not understand, what do you mean with ''clock them out''.

There are SCL and SDA. After I2C1->CR1 restart, I the next command is

a typical Start Condition. But this step dont work. So I do not have

access on the sensor registers, to restart them also.

Thanks & Best Regards

Askan

Posted on May 17, 2011 at 14:09

You should be able to share an I2C bus with multiple slaves, that's what is was designed to do. If you are consistently having problems you should check that you have it correctly terminated, and that you are running it at a speed that is suitable for all devices.

I2C slave devices are usually pretty dumb, they are simple state machines, and typically don't have an external reset pin, or internal clocks. If you foul up the bus and the slaves get in to weird conditions (ie multi-byte sequences to EEPROM's), you have to clock them out of these states. The means you have to drive SCL with enough cycles that the slave device will recognize a protocol violation, and step off the bus.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist
Posted on May 17, 2011 at 14:09

''the next command is a typical Start Condition. But this step dont work.''

What do you mean by, ''dont work'' ?

  • Does the STM32 not generate a Start Condition on the bus?
  • Do the slaves not recognise the Start Condition on the bus?
  • Or what?