2019-05-05 12:40 AM
I am using STM8L Discovery board, and want to communicate with external memory and humidity sensor which requires I2C protocol for communication.
I am using STM8l15x standard peripheral library, but unable to communicate. I found the following problems while debug:
Please help me out how can I resolve it?
Thank you so much in advance.
2019-05-05 08:35 AM
The i2c bus needs pull-up resistors on both lines (SCL, SDA), it cannot work without them.
I just checked the STM8L Disco. board schematics: your SB17 jumper needs to be open, so that the blue button is not functional anymore.
How do you know it cannot generate the start condition? Post some more info and maybe the relevant part of your software.
2019-05-19 07:18 AM
Hello Cristian,
First of all thank you very much for your reply, and sorry for late reply from my side.
How do you know it cannot generate the start condition?
-> I am using standard peripheral library of stm8l152, where by putting breakpoint (code get stuck here:while(!(I2C1->SR1 & 0x02); I observed that start condition is not generated. But now I am able to generate start condition even with pull up resistor.
Still there is no acknowledgement from slave.
I just checked the STM8L Disco. board schematics: your SB17 jumper needs to be open, so that the blue button is not functional anymore.
-> For this I need to desolder the jumper. Let me try this.
Thank you ;)
2019-05-19 10:23 AM
2019-05-19 10:24 AM
2019-05-19 10:26 AM
It's rustly and I've got something a bit cleaner for STM32. Used it with many humidity sensors (ST, Honeywell, Bosch, (Sensirion is not supported as it's the only sensor with clock stretching), etc...). Functionally rugged like a hummer.
2019-05-19 11:54 AM
Hello Cristian,
I tried by removing the SB17 jumper, but still the issue is same.
Please help.
2019-05-19 12:14 PM
2019-05-19 12:47 PM
I will have a look on the code you posted, until than I noticed you say the device address is 0x50 - this shouldn't be right, as the 24AA512 EEPROM should have an address starting with 0xA (0xA0 if you tied the A0,A1,A2 device select inputs to ground and you start a write transfer, or 0xA1 if you start a read transfer with the same inpts to ground).
If the slave address is not correct, it will not acknowledge your transfer.
2019-05-19 10:00 PM
Hello Cristian,
Yes it was my mistake, the address is 0xA0 and not 0x50. I will try this address and let you know.
Thank you very much for your continuous support.