cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong data on I2C 2 ?

antonius
Senior

Dear Members,

I got a wrong data on I2C 2 for LCD, the first time it was ok, after a while it becomes like in the photo, what do you think the cause of it ?

I have put a pull up resistor for it 10K, and the speed is 100KHz,

I2C1 for Accelerometer and temperature,

Is it because of power supply or something else ?

Thanks0690X000009ZXuZQAW.jpg

7 REPLIES 7

As I recall you have an IO Extender, with 4-bit connectivity, I'd suppose the two halves aren't getting cleanly latched.

Perhaps review with a logic analyzer, and review setup/hold timing requirements of the display.

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

............. I'd suppose the two halves aren't getting cleanly latched....

do you mean between expander and the LCD ?

antonius
Senior

I reduced SCL to 50KHz, still got the same response, after GPS is on or accelerometer is on...

Ok, so you've established that the speed of the I2C interface isn't the issue. Now you need to review the performance of the signals to the display's micro-controller, and how the edges/transitions of those relate.

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

when I make time out =100ms

HAL_I2C_Master_Transmit (&hi2c2, 0x7E,(uint8_t *) data_t, 4, 100);

it's reducing the error, is it the cause or something else ..?

Do the functions return an error status? The timeout would need to be accommodative of the amount of data you plan to transmit, and the bus speeds you are clocking at.​

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

I reduced SCL to 40KHz, it's now stablizing,

 hi2c2.Init.ClockSpeed = 40000;

I keep posted, perhaps, I need to reduce the clock lower ....Iet's see...