RL78/G13 - Not able to generate repeated start using simplified I2C(SDA00)

Hello,

As mentioned we were working on a simplified i2c master mode, where we need to generate a repeated start. But we couldn't achieve it. 

We are using CCRL Complier, E2 studio.

Adding a code snippet

1. When using without stop condition.

R_IIC00_Master_Send(0XC0, data_buf_tx, 1);
   while(IIC00_flg_end == 0)
    {
        NOP();
    }
    IIC00_flg_end = 0;
    // R_IIC00_StopCondition();
    
    //IIC00_flg_end is set to 1 when interrupt is generated
   R_IIC00_Master_Receive(0XC0, data_buf_tx2, 2);
    while(IIC00_flg_end == 0)
        {
            NOP();
        }
        IIC00_flg_end = 0;
    R_IIC00_StopCondition();

2. By using Stop condition

R_IIC00_Master_Send(0XC0, data_buf_tx, 1);
   while(IIC00_flg_end == 0)
    {
        NOP();
    }
    IIC00_flg_end = 0;
    R_IIC00_StopCondition();
    //IIC00_flg_end is set to 1 when interrupt is generated
   R_IIC00_Master_Receive(0XC0, data_buf_tx2, 2);
    while(IIC00_flg_end == 0)
        {
            NOP();
        }
        IIC00_flg_end = 0;
    R_IIC00_StopCondition();

Guide us how to generate repeated Start using simplified I2C.

Thank you

Parents Reply Children
  • Hi JB,

    Thank You for your reply. 

    Simplified I2C is working.
    But we faced one issue with simplified I2C. We were using IIC00, IIC01 and UART1, and UART2. 

    The code used with IIC00 and IIC01 is the same just the API call is different which is generated by code generated.

    ISSUE: 
    when using IIC00 with an i2c multiplexer sensor it giving NOT ACKNOWLEDGE.
    When I run the same code with IIC01, Its works.

    Is there something that should be considered for IIC00? Because when only using MuX its not work but it works without MUX. This is not the issue with IIC01

    * We also Used UART0, where an interrupt is not generated.

    Do you refer sample code for UART0 

    Thank You