I am using standard peripheral library for STLUX and using stm8 library for I2c interface. I have tried with all the examples in libraries which are using interrupt handlers. Also, i have tried the online examples for stm8 using poll methods. Nothing is working for me till now.
I am using Pin 17, Pin 18 for I2C interface. I have uploaded the code in attachment.
The slave address is the correct position? Assuming 7-bit addressing, the low bit of the address byte indicates read/write, i.e the slave address is shifted left 1 bit.
Thanks for the response, Yes i had gone through that document.
I am able to communicate with my testing device using Pin 20, 21 (SDA, SCL). But i want to use the I2C interfac on Pin 17, 18(SDA, SCL). I am using STLUX385 standard peripheral library which has no definiation of MSC_IOMXP2 register. After going through the datasheet the register is in Indirect Area which i'm unable to access.
How can i enable Alternate Functions of P2 using MSC_IOMXP2 register which is in Indirect Access Area?