Skip to main content
sohaib qamar
Associate
March 15, 2020
Question

Hi, I am using STNRG388A to communicate with some I2C device. For now, i have picked MAX30205 temperature sensor. See Details please

  • March 15, 2020
  • 5 replies
  • 2812 views

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.

Need some help from ST community.

This topic has been closed for replies.

5 replies

alister
Senior III
March 16, 2020

Haven't looked at your code.

There's a concise summary of the I2C bus by TI at http://www.ti.com/lit/an/slva704/slva704.pdf.

Some things to check with a CRO...

  1. The START and STOP conditions?
  2. 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.
  3. The ACK/NACK bit, i.e. 9 clocks per byte?
sohaib qamar
Associate
March 16, 2020

Thanks for the response.

I have gone through the document you have mentioned.

As far as i have dig in, the problem is in the configuration registers for Pins I am using for I2C.

The configuration for using those pins as I2C interface is not found in the header files for STLUX385.

There are no configuration files for STNRG388A.

I am lost there, any ST team member who can help me out.

Regards

alister
Senior III
March 16, 2020
sohaib qamar
Associate
March 17, 2020

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?