Hello,
We have several devices using the K20 MCUs running the same software that need to have their I2C slave address assigned on power up based on installed slot programming pin IDs.
Currently the slave address is defined as 7 via the Kinetis Design Studio Component Inspector and have found in the generated code where the slave address is assigned (in IntI2cLdd1_Init() ). The address specified in component inspector is hardcoded in the line
I2C0_A1 = I2C_A1_AD(0x07); /* Define slave address */
The program pins are read using a BitsIO component but this takes places after the Processor Expert PE_low_level_init() is executed.
In order to redefine the I2C slave address can I
If not, what should be done to reassign the I2C slave address when running?
An aside, in IntI2cLdd1.h I found:
#define IntI2cLdd1_SLAVE_ADDRESS 0x07U /* Slave address value */
using address defined in Component Inspector but it is not used in the generated code. Why?
thanks,
Fred
Hi fporter,
If you want to change the slave address, if the slave is not started, you can modify the address directly.
I also think you can use your flow that:
Please try it on your side.
Wish it helps you!
If you still have questions about it, please kindly let me know!
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------