cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding AN5203 why init/denit i2c in while loop?

darla14
Senior

Hello,

In document : https://www.stmicroelectronics.com.cn/resource/en/application_note/dm00528962-teseoliv3f--i2c-positioning-sensor--stmicroelectronics.pdf pase 16.

is it mandatory to have below code in a while loop?

HAL_I2C_DeInit(&hi2c1);

HAL_I2C_Init(&hi2c1);

Why cant we init i2c just once?

Second question :

This set of commands will:  Reset the i2c message list  Disable the eco-ing message  Save the configuration on flash

>

$PSTMCFGMSGL,3,1,0,0 $PSTMSETPAR,1227,1,2 $PSTMSAVEPAR

Can you please tell the similiar code being used in the GetPos_I2C example for L476RG where we are using this commandset to enable i2c?

Third and last question :

If we have to use the uart again(between STM32 and Teseo) , what command set to be sent ?

Br,

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 REPLY 1

The deint/init does seem unnecessary, the bus typically doesn't need resetting unless you have an error. In many cases it might not help because the devices lack an asynchronous reset.

The trick here is to perhaps actually try things, and experiment.

Perhaps find someone in the local sales office, or engineering support, who can provide you with assistance and/or direction.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..