2021-11-10 02:15 AM
I have to use two STM32F429 discovery kits. One as a master and the other as a slave in a I2C protocol. My problem is about the slave one. I don't know how to get the address belongs to its and if it doesn't need how the slave will understand that it has to send a data ?
I explain more in details, when I use it as a master i have to indicate the address of the slave :
HAL_I2C_Master_Transmit(&hi2c3, slave_address, data_transmit, data_size, timeout);
But if I use as a slave i don't know where to find this information.
I hope my informations are clear enough and I apologize for my english.
2021-11-10 02:32 AM
IIC was always supposed to be a low power interface to sensors.
The big cheat with IIC is to make the two pins "Very High Speed", but is not good for the power usage.
You can tune your IIC to lower the speed requirement and thereby lower the power usage, after it is working.
IIC was never meant to run over different processor boards.
IIC is very flakey, you have to have a thick solid ground wire between boards.
dont use it, if you can avoid it.
surely it is the same address for both boards, did you check the data sheet ?
can you change the IIC address on this proccessor ?
did you pull up the lines ?
you may need a 1K pullup over 2 separated processor boards where the ground potential will be moving around a bit.
it is a dodgy interface/solution...
dont use it, if you can avoid it.
What about a TTL connected Serial port ?
I use two 1K resistors (Rx & Tx) in series to avoid blowing any pins on a TTL Uart connection.
2021-11-10 05:21 AM
The thing is that I use the STM32F429 board just to replace a sensor that I don't have for instant, and I must use IIC interface.
On the datasheet I don't see any information about the adress for IIC protocol. I haven't pulled up the line. But my problem for instant is not why it doesn't work but more about how theorically it should be implemented ?
For instant I know how to discuss with a sensor while my board is a master.
But I don't know how to configure my board to make it become a slave. Indeed as a master the configuration is done automaticaly.
For me, as a slave it should work like this :
Also I know how to send data from a slave on the bus. But I don't know how to ask the data from the master to the slave.