2023-11-07 01:52 AM
Hi All,
I trying to interface MAX6651 Device using I2C module using STM32F410C8U6 MCU.
Device address is 0x36 But when i'm using
HAL_FMPI2C_IsDeviceReady(&hfmpi2c1, 0x36 , 2, 100); this API returning the value
HAL_ERROR.
Here are some snaps
Anybody look into it send some solutions
2023-11-08 05:16 AM
Hello @Advance_tech,
Thank you for your question.
In the MAX6650 document from Analog Devices you shared, it specified that the rise/fall time should be between 20ns and 300ns (cf the figure below)
But on your CubeMx screenshot, you enter 0 ns, please change it and try again.
Let me know !
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-09 01:17 AM
Hello,
I think I2C start bit not generating.
FMPI2C1->CR1 |= (1 << 0);
FMPI2C1->CR2 |= (1 << 13);
printf("Hi\r\n");
while(!(FMPI2C1->CR2 & (1 << 13)));
printf("Hello\r\n");
program is struct inside the while(1)
after while(1) nothing is executing.
Is there is any chance the I2C Peripheral is gone
please answer
2023-11-09 09:58 PM
uint32_t error_code = HAL_FMPI2C_GetError(&hfmpi2c1);
i am getting error code as 2 that means
HAL_FMPI2C_ERROR_ARLO arbitration error
please let me know what are the causes of this error
2023-11-13 01:58 AM
Hello @Advance_tech,
Several I2C multi-masters can be connected to the same I2C bus and operate concurrently. By constantly monitoring SDA and SCL for start and stop conditions, they can determine whether the bus is currently idle or not. If the bus is busy, masters delay pending I2C transfers until a stop condition indicates that the bus is free again.
However, it may happen that two masters start a transfer at the same time. During the transfer, the masters constantly monitor SDA and SCL. If one of them detects that SDA is low when it should actually be high, it assumes that another master is active and immediately stops its transfer. This process is called arbitration.
Here some remark :
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-20 02:28 AM
we have single master and two slave devices in I2C line.
HAL_FMPI2C_IsDeviceReady(&hfmpi2c1, max6551_add_2 , 1, 2000);
when i use this API error code is 32 means timeout error
HAL_FMPI2C_Master_Transmit(&hfmpi2c1, i,(uint8_t *)&pdata, sizeof(pdata), HAL_MAX_DELAY);
when i use this API the error code is 2 means arbitration error.
2023-11-20 02:38 AM
Hello @Advance_tech,
Before I investigate further, can you please confirm you corrected the rise/fall time. (Timeout fault can be the consequence because the slave cannot follow...)
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-20 02:43 AM
hi @Pierre_Paris thanks for quick response
i have given rise time and fall time as 300ns as mentioned in datasheet.
But i don't know how to calculate rise time and fall time
2023-11-20 06:46 AM - edited 2023-11-20 06:47 AM
Hello @Advance_tech,
300ns is the maximum limit value, please check with 200ns (just in case).
You don't need to calculate rise and fall time. There is, indeed, a calculation with the I2C_TIMINGR but it's unnecessary to do it (tools do). However, if you want to learn more, you can read the chapter 2.2.4 of AN4235 by clicking here.
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-21 01:54 AM
Hi @Pierre_Paris i would like to thank for all your responses. i slowly heading into solve the problem.
retval = HAL_FMPI2C_IsDeviceReady(&hfmpi2c1, max6551_add_2, 1, 100);
error_code = HAL_FMPI2C_GetError(&hfmpi2c1);
printf("return value %d\r\n",retval);
HAL_Delay(100);
printf("error code is = %ld\r\n",error_code);
HAL_Delay(100);
Now i getting HAL_BUSY From this HAL_FMPI2C_IsDeviceReady API and error code is 32 which means
HAL_FMPI2C_ERROR_TIMEOUT
please let me know what may cause these problems