contrast setting problem in OLEDM204 lcd with I2C interface

Thread Starter

Yogesh Nandurkar 1

Joined Apr 19, 2019
3
hii all,​
i am going to interface OLEDM204 lcd with PICf1823 using I2C. i have done all the thing .
but now i want to change the contrast and i could not. in datasheet they said that you have to set RE and SD bit
and then only you can do that. i tried it but fail. some one having experience in that cam guide me

Code:
I2C_Is_Idle();
     I2C1_Start();
     I2C_Is_Idle();
     I2C1_Wr(0x78);
     I2C_Is_Idle();
     I2C1_Wr(0x80);
    I2C_Is_Idle();
    I2C1_Wr(0x08); //Display blink cursor OFF
    I2C_Is_Idle();
    I2C1_Wr(0x3A); //FunctionSet: N=1 BE=0 RE=1 IS=0
    I2C_Is_Idle();
   
    I2C1_Wr(0x79);    //set SD
     I2C_Is_Idle();
    
     I2C1_Wr(0xFF);   //set contrast
     I2C_Is_Idle();
    
    I2C1_Wr(0x09); //4-line mode
    I2C_Is_Idle();
    I2C1_Wr(0x05); //View 0°
    I2C_Is_Idle();
    I2C1_Wr(0x38); //FunctionSet: N=1 DH=0 RE=0 IS=0
    I2C_Is_Idle();
    I2C1_Wr(0x3A); //FunctionSet: N=1 BE=0 RE=1 IS=0
    I2C_Is_Idle();
    I2C1_Wr(0x72); //ROM Selection (RE muss 1 sein)
    I2C_Is_Idle();
    I2C1_Wr(0x00); //ROM_A = 0x00, ROM_B = 0x04, ROM_C = 0x0C
    I2C_Is_Idle();
    I2C1_Wr(0x38); //FunctionSet: N=1 DH=0 RE=0 IS=0
    I2C_Is_Idle();
    I2C1_Wr(0x0D); //Display blink cursor on
    I2C_Is_Idle();
    I2C1_Wr(0x01); //Clear display
    I2C_Is_Idle();
    I2C1_Stop();
 

Attachments

Top