2024-04-11 04:43 AM
Hi,
What I want to implement is I2C communication.
There is one master(NUCLEO-U575ZI-Q) and slave(LK432KC).
Master transmit TX_Buffer_1 which is double 3.0
and Slave recieve it in RX_Buffer_1.
Slave doubled RX_Buffer_1 and transmit to master.
I use memcpy and Slave_RxCallback function to implement it.
I attached 2 main file each is master and slave.
And I also have logic analyzer to detect SCL and SDA line.
In my code, Master transmit only 1 slave address (0x08) like this picture,
but sometime it appear like this..
Here is my question
I think the main problem is noise of my HW system.
but I'm not sure.
so plz check whether my code is wrong or not.
1. Do I need more or less Delay time?
2. Is it okay to use polling mode in Master and interrupt mode in Slave? what's the recommendation?
3.I need double data type. Can I use 8byte double type in I2C function? How??
4. Is there any other problem in my code??
It's my first time to use STM32..
Thank you
Solved! Go to Solution.
2024-04-11 05:28 AM
Use external pullups. The internal pullups are 40kOhm nominally and usually not adequate.
JW
2024-04-11 05:28 AM
Use external pullups. The internal pullups are 40kOhm nominally and usually not adequate.
JW
2024-04-22 05:12 AM
I change pullups resistor into 4.7kohm.
It still have various problem ;( but your solution helped a lot, thank you :)