2024-04-22 04:55 AM
Hi,
I now implementing i2c with 2 stm board.
The process is
1. Master transmit data
2. Slave receive and calculate some functions.
3. Slave transmit that changed data
4. Master receive it.
with HAL_I2C functions.
I measure the SDA line with logic analyzer, and the results are unexpected..
As you can see in the code, I transmitt 3.1416 to slave repeatedly.
and in the slave ProcessData function, TX_Buffer_1 updated 1 or 0.111 randomly . (random but the probability of 1 must be higher than 0.111)
As a result , the very first data transmit & receive & calculate & transmit well (left picture)
but after that, every data show 0.111 (right one)
I check RX_Buffer_1 in slave with PuTTY,
RX_Buffer _1 printed
3.1416
0
0
0
0
... which means except first data, slave receive 0 everytime...
but master still transmit 3.1416 (I checked it both logic analyzer and PuTTY)
Plz help :( idk what's the problem....
I attached master and slave main.c file. thank you
summary----------------------------------------------------------
1. master transmit 3.1416 reapetedly
2. slave receive 3.1416 at first, but after that, slave receive 0.
2024-04-22 06:50 AM
2024-04-22 06:52 AM
I'm sorry :(
After I posted it, I thought it was mass, so I re-post.
I can't find edit or delete function here
2024-04-22 08:36 AM - edited 2024-04-22 08:39 AM
@eunni wrote:I can't find edit or delete function here
It's here - the little round "down-arrow" in the top-right of the post:
EDIT:
For the opening post of a thread, it has 'Edit Message' instead of 'Edit Reply':
That also lets you edit the title.
2024-04-22 02:46 PM
Already removed the duplicate.
Regards
/Peter