I2C
- 2 replies
- 2990 views
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
