2021-10-21 4:20 AM
master side :
uint8_t TMP102_ADDR = 0x08;
uint8_t REG_TEMP = 0x01;
int result = 0x01;
(result is numerical data which i want to transfer to another stm 32 )
HAL_I2C_Master_Transmit(&hi2c3,(TMP102_ADDR<<1),&result,sizeof(result),100);
slave side stm 32 program
uint8_t TMP102_ADDR = 0x08; // Use 8-bit address
uint8_t REG_TEMP = 0x00;
char buf[4];
AL_I2C_Mem_Read(&hi2c1,(TMP102_ADDR<<1),0x0C,I2C_MEMADD_SIZE_8BIT,buf, I2C_MEMADD_SIZE_8BIT,100);
still it shows error or no output on slave side both supplied by USB and ground at common point
2021-10-21 7:37 AM
The slave should call HAL_I2C_Slave_Receive to receive the information from the master.
There are examples for this. Here is one:
2021-10-21 10:11 PM
HAL_I2C_Slave_Receive(&hi2c1,(uint8_t *)aRxBuffer,sizeof(aRxBuffer), 1000);
i use this instruction also but not works....
2021-10-22 6:58 AM
It won't even compile as you don't have a slave address. Were you able to follow the example?
2021-10-22 8:46 PM
i see the example but still it not work for my case
i have same stm32 f407 discovery board as tx and rx side and adress is 0x08
2021-10-23 12:06 AM
yes thank you now its work
but it dnt send updated value of ADC from transmit side
receiving side get value only once
it not update time by time
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.