I2C data on oscilloscope

Hey,

Yesterday, I used an oscilloscope to see if I could see the address of my LCD and the data of what I write on my LCD.

I have a Grove - LCD RGB Backlight, his address is 3E, multiplying by 2 is 7C.

I'm able to find everything I write, but there is something between the LCD address and the ASCII of the letter I write that I don't understand.

If I type "numero," I get: 7C (LCD address), 0x40, 6E (n) - 7C (address), 0x40, 75 (u), and so on.

Does anyone know what the data : 40 is representing ?

A quick look at the Grove LCD RGB Backlight library on github suggests that this bit of code is being called:

// send data
inline size_t rgb_lcd::write(uint8_t value) {

    unsigned char dta[2] = {0x40, value};
    i2c_send_byteS(dta, 2);
    return 1; // assume sucess
}

I couldn't see any details of what the 0x40 means but it's probably somewhere in the actual LCD datasheet.

Thanks,
I'm looking for the meaning in the datasheet but haven't found it yet.

Saw some people mentioning that the CGRAM address command starts from 0x40, the CGRAM is mentioned in the library too. But the CGRAM is for custom caracter I think so it's weird, or maybe I misunderstood.

@thialdyn, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

Life is much easier if you use a Logic Analyser.
Ok, scopes can decode I2C but not as well as a regular Logic Analyser.

Regarding most I2C display controllers. They tend to write a "control-byte" followed by a variable length of data.

The corresponding datasheet will explain.

From memory bit7 is continuation bit, bit6 is data/command bit. (you must check)

<S><7C> <00> <register><P>
<S><7C> <80> <register><register>...<P>
<S><7C> <40> <data><P>
<S><7C> <C0> <data><data>...<P>

Think about it. You tend to send single lcd_command(c)
but multiple lcd_data(d)

David.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.