Skip to main content
Phanirajkiran M
Senior
May 24, 2018
Solved

I2C_GenerateSTART in STM32L4 /L4+ series

  • May 24, 2018
  • 3 replies
  • 1340 views
Posted on May 24, 2018 at 11:14

Hi

I want to know the similar API for 

I2C_GenerateSTART for STM32L4/L4+.

For F series 

STM32FXX is 

I2C_GenerateSTART.

STM32L4 is ???

Please let me know.

Thanks

Phani

    This topic has been closed for replies.
    Best answer by Nesrine M_O
    Posted on May 24, 2018 at 15:30

    Hi 

    The STM32L4 Series and STM32L4+ Series devices implement a different I2C peripheral

    • The user must set the START bit in I2C_CR2 register
    0690X0000060KrIQAU.png0690X0000060KviQAE.png

    please tell me how i need to proceed for I2C Start, on which control registers i need to take which has both START and RESET

    • The START bit is reset by hardware when the slave address has been sent on the bus, whatever the received acknowledge value. The START bit is also reset by hardware if an arbitration loss occurs

    -Nesrine-

    3 replies

    Nesrine M_O
    Associate
    May 24, 2018
    Posted on May 24, 2018 at 13:59

    Hi

    phanirajkiran.ma

    ,

    -Nesrine-

    Phanirajkiran M
    Senior
    May 24, 2018
    Posted on May 24, 2018 at 14:56

    Hi Nesrine

    Board: Nucleo144- STM32L4R5ZI.

    I want to write I2C_start condition .

    Use case: Read/write sensor BME680 over I2C.

    Please tell me what are the equivalent for

    I2C_GenerateSTART as in case of STM32FXX series.

    In Case CR1 series i cannot find

    I2C_CR1_START and for RESET i find I2C_CR1_SWRST  Case CR1:  START :: NO RESET :: YES

    But i cant find for CR2 for STM32L4XX series.  The above explain is for Start condition of I2C as like this :   Case CR2::  START :: YES  RESET :: NO 

    D_LOG(''Generate start condition\n''); dev->CR2 |= I2C_CR2_START; // This will make start of I2C on CR2.   For CR2 its not available. i want to know why there is not there for CR2(control register 2). 0690X0000060KvTQAU.png  

    please tell me how i need to proceed for I2C Start, on which control registers i need to take which has both START and RESET

    Thanks

    Phaniraj

    Nesrine M_O
    Nesrine M_OBest answer
    Associate
    May 24, 2018
    Posted on May 24, 2018 at 15:30

    Hi 

    The STM32L4 Series and STM32L4+ Series devices implement a different I2C peripheral

    • The user must set the START bit in I2C_CR2 register
    0690X0000060KrIQAU.png0690X0000060KviQAE.png

    please tell me how i need to proceed for I2C Start, on which control registers i need to take which has both START and RESET

    • The START bit is reset by hardware when the slave address has been sent on the bus, whatever the received acknowledge value. The START bit is also reset by hardware if an arbitration loss occurs

    -Nesrine-

    Phanirajkiran M
    Senior
    May 24, 2018
    Posted on May 24, 2018 at 15:36

    Thanks for the support Nesrine.

    Yes for SWRESET  

    0690X0000060KvYQAU.png

    On I2C_CR1 bit 13 

    0690X0000060KvdQAE.png

    Thanks 

    Phaniraj