2021-03-01 6:51 AM
Hello,
I have a very strange behaviour with the I2C bus of a STM32G431.
I try to communicate with a MLX90393 of Melexis. I had some problems to get the measurements, after a Start measurement. The MLX90393 returned an error code. So I checked the signal with a signal analyzer.
The signal look like this:
So the voltage of the SCL signal in white (digital measure at the top and analogue at the bottom) has a voltage drop to 1.6V at the end of the frame !
What is strange is that for other frames I've absolutely no problem. For example here I try to get the measurement from the sensor:
The SCL signal is stable until the end.
SCL and SDA are pull up on my board with 10k resistors and the frequency is set at 100kHz.
I had previously used a STM32F334 on the 1st version of my board with all the same components (only the tracks are of cours a little bit different because the footprints of the F334 and the G431 are a little bit different) and I had absolutely no problems.
I am able to write and read memory of the MLX90393 without any problem. The problem only becomes apparent when I try to initiate a measurement on the sensor.. !
Did anyone have any idea what the problem is?
Solved! Go to Solution.
2021-03-02 4:36 AM
It is solved. I had effectively a problem with the power supply of the sensor. The track was interrupted.
I hadn't thought of this problem before because the sensor worked without power supply (only with the i2c voltage, and probably helped with decoupling capacitors) for low-energy command ! As soon as I asked to start a measurement, the current was no longer sufficient.
Thank you for putting me on the answer's way ! :grinning_face:
2021-03-01 7:09 AM
what if..... the sensor is exhausting its power supply when you command to take a measurement (demanding too much current)
I would probe the MLXs sensor vcc line at the same time you send this command.
2021-03-01 7:17 AM
What would cause the sensor to demand too much current? I tried to switch the sensors between the board with the STM32G334 and the G431 one. And the problem "stays" with the uC.
2021-03-01 8:49 AM
i dont have any idea of the configuration of your board.
But maybe the board with the STM32G431has a weaker voltage regulator? or youre using it more?
2021-03-01 11:25 PM
The board is powered directly by a power supply with limit current set to 100 mA. In practice the circuit consumes only about 5 mA. There's no other other chips on the i2c bus and nothing that consumes some current.
2021-03-02 4:36 AM
It is solved. I had effectively a problem with the power supply of the sensor. The track was interrupted.
I hadn't thought of this problem before because the sensor worked without power supply (only with the i2c voltage, and probably helped with decoupling capacitors) for low-energy command ! As soon as I asked to start a measurement, the current was no longer sufficient.
Thank you for putting me on the answer's way ! :grinning_face:
2024-04-08 10:15 AM - edited 2024-04-08 10:15 AM
Hi Alexrey,
Would you like to share I2C code for MLX90393? I believe you were able to implement ML90393 interfacing.
Thanks.