hi all
please, anybody successfully use the callback function for I2C library ? "I2C2_SetTimeoutCallback" ?
as soon as it's enable, the I2C bus stop to work !
without the callback, main program run as expected most of the time, but maybe 1 time each 24 hours, i discover that the I2C bus hang..
so now, i try to use this timeout callback function to re initialize the bus.
i declare this function when i initialize the I2C bus (just after the I2C2_Init)
but when enable, nothing work anymore on the I2C bus !
i got a lot of error when i configure my I2C devices then the program hang.
target PIC32MX450F256H
any tips ?
thanks, regards
phil
I2C2_SetTimeoutCallback problem
- filip.grujcic
- Posts: 822
- Joined: 14 May 2018 08:34
Re: I2C2_SetTimeoutCallback problem
Hello,
Please find attached the example that demonstrates the usage of I2C_SetTimeoutCallback function.
Regards,
Please find attached the example that demonstrates the usage of I2C_SetTimeoutCallback function.
Regards,
- Attachments
-
- I2C Advanced.zip
- (5.72 KiB) Downloaded 102 times
Filip Grujcic
Re: I2C2_SetTimeoutCallback problem
hi Filip
what is the step of the timeout value ?
"timeout: Represents a number of while loops in which the I²C timeout condition is checked."
are you sure that the functions works on 32MX450F256H, on I2C2 too ?
thanks
what is the step of the timeout value ?
"timeout: Represents a number of while loops in which the I²C timeout condition is checked."
are you sure that the functions works on 32MX450F256H, on I2C2 too ?
thanks
- filip.grujcic
- Posts: 822
- Joined: 14 May 2018 08:34
Re: I2C2_SetTimeoutCallback problem
Hello,
I2C timeout is pure software implementation, it is hardware independent, therefore it should work on PIC32MX too.
What do you mean by "step of the timeout value"? The value you pass to the timeout function is simply a number of while loops in which I2C flag is checked.
Regards,
I2C timeout is pure software implementation, it is hardware independent, therefore it should work on PIC32MX too.
What do you mean by "step of the timeout value"? The value you pass to the timeout function is simply a number of while loops in which I2C flag is checked.
Regards,
Filip Grujcic
Re: I2C2_SetTimeoutCallback problem
what is the time of the "while loop" then ?