Sonsivri

Electronics => Pic C Languages => Topic started by: corbo on March 05, 2008, 11:11:43 11:11



Title: LCD initialization routine for EA DOGM162B-A ( ST7036 controller ) Help !!!
Post by: corbo on March 05, 2008, 11:11:43 11:11
Hi ,

I try to use an LCD display type  EA DOGM162B-A ( with ST7036 controller ) in an application which use 2x16 LCD HD44780 compatible chipset .
With usual 2x16 LCD display with HD44780 work fine . . . . but , with this type of LCD (EA DOGM162B-A) , when all is switched on I get nothing on the display.
Datasheet fot this lcd:
 http://www.lcd-module.de/deu/pdf/doma/dog-m.pdf
ST7036 controller it’s instruction compatible to ST7066U , KS0066U and HD44780 (from datasheet ) .
http://www.lcd-module.de/eng/pdf/zubehoer/st7036.pdf

In datasheet of ST7036 (on page 39)  is presented initializing by instruction (4 bit-interface)  and this is little different from HD44780 .
I think  slightly different initialization routine is required for this display .
 
I try to make this but it’s not so easy for me .
Please help me to make changes in initialization routines of the LCD for ST7036 controller .
For the LCD I have :
4 bit-interface
U=5V
Here is the lcd file which I try to change:
http://rapidshare.com/files/97191743/LCD.C
 . . sorry for my English .
Thank you !!!!


Title: Re: LCD initialization routine for EA DOGM162B-A ( ST7036 controller ) Help !!!
Post by: Hell on March 06, 2008, 09:39:30 21:39
Thank you!


Title: Re: LCD initialization routine for EA DOGM162B-A ( ST7036 controller ) Help !!!
Post by: rtm on March 06, 2008, 11:35:26 23:35
Look at my init code. It is working with 8x1 & 16x2 (printing only at 1 line) displays.
(Sorry, I do not remember details - it was made 4 years ago.)

void LCD_Init (void) {

   PORTB &= ~0xF0;                           //
   DelayX1mS(40);         //Init
   LCD_Inst_W(0x30);      //1st 8 bits
   DelayX1mS(5);         // wait >4.1 mS
   LCD_Inst_W(0x30);      //2nd 8 bits
   DelayX10uS(12);         // wait >100 uS
   LCD_Inst_W(0x30);      //3rd 8 bits
   DelayX10uS(20);
   LCD_Inst_W(0x20);      // 4 bits
   DelayX10uS(20);         // wait >100 uS
   LCD_Inst4_W(0x20);      //Mode 4 bits
   Wait4BF();
   flash(2);
   LCD_Inst4_W(0x0C);      // Display Off
   Wait4BF();
   LCD_Inst4_W(0x01);      // Display Clear
   DelayX1mS(3);
   Wait4BF();
   LCD_Inst4_W(0b00000110);      // Entry Mode Set
   Wait4BF();
   LCD_Inst4_W(0x80);      //Set address 0
   Wait4BF();
}


And do not forget to adjust LCD Driving Voltage.


Title: Re: LCD initialization routine for EA DOGM162B-A ( ST7036 controller ) Help !!!
Post by: kami_kami on April 18, 2008, 01:38:25 13:38
need lcd simulator


Title: Re: LCD initialization routine for EA DOGM162B-A ( ST7036 controller ) Help !!!
Post by: edaudo on April 24, 2008, 03:33:24 15:33
rtm's code looks like normal HD44780 to me.

The EA-DOG can be used like any HD44780 compatible display after it has been initialized.

The main differences are:

the ST controller has 2 setup pages, be sure you write to the right page
you must set the correct values for the voltage controller and the booster
you must set the contrast value

in a way like this:

Init 8bit
Init 8bit
Init 8bit
Init 4bit
Set config page
Set voltage
Set booster
Set standard page
Set contrast
Set mode

but I think all this is well described in the controller datasheet you can download from EA.


Title: Re: LCD initialization routine for EA DOGM162B-A ( ST7036 controller ) Help !!!
Post by: pickit2 on September 29, 2015, 11:10:17 11:10
need lcd simulator
You made a total of five post in forum, all on the April 18, 2008
Eight Years a Member, leeching is not what we want or need in a forum.
Account set for being deleted.


Title: Re: LCD initialization routine for EA DOGM162B-A ( ST7036 controller ) Help !!!
Post by: recog on May 03, 2016, 12:55:16 12:55
ALL ... OK, got an inexpensive 20 x 4 line LCD off eBAY... It uses the Sitronix ST7066 controller...
Here is my XC8 programming, it works... May not be fastest or most efficient....

First, check the "busy flag". Is it clear?

void wait4BFclr(void){
    byte btemp;
   
    TRISD = 0xFF;             // Set PORTD to input ...   
    LCD_RS = 0;
    LCD_RW = 1;  Nop();  Nop();

    BFchk: Nop();
        LCD_EN = 1;  Nop();  Nop();
        btemp = PORTD;
        btemp &= 0x80;
        LCD_EN = 0;
        if (btemp == 0x80) goto BFchk;
}

HERE is the function that does the work ........................

//  FUNCTION initLCD  --- EIGHT bit interface .................
//
//  RS  R/W  DB7 DB6 DB5 DB4  DB3 DB2 DB1 DB0
//  0   0    0   0   1   1    x   x   x   x     (0x30)
//
//  0   0    0   0   1   1    x   x   x   x
//
//  0   0    0   0   1   1    N   F   x   x     (0x30)  FUNCTION SET
//  0   0    0   0   0   0    1   0   0   0     (0x08)  DISPLAY OFF
//  0   0    0   0   0   0    0   0   0   1     (0x01)  DISPLAY CLEAR
//  0   0    0   0   0   0    0   1   I/D S     (0x06)  FUNCTION SET
//
//  END of initLCD

void initLCD(void){
    byte btemp;
   
    TRISD = 0xFF;                   // Set PORTD to INPUT ...
//   
    LCD_EN = 0;    LCD_RW = 0;     LCD_RS = 0;
    LCD_PWR = 1;   BACKLIGHT = 1;   // POWER on .....
    LCD_PORT = 0b00110000;          // INIT state, PORTD latch bits ....
//
    for (btemp=0; btemp<6; btemp++)  Delay_msec(20);   
    Nop();  Nop();  Nop();
    Nop();  Nop();  Nop();         // WAKE up time ...
 
    writeLCDcmd(0x38);             // OR 0x30 ????
    Delay_msec(20);   
    Nop();   Nop();   Nop();     
 //
    writeLCDcmd(0x38);             // DO again ...
    Delay_msec(20);   
    Nop();   Nop();   Nop();   
//
    writeLCDcmd(0x38);             // DO again ...
    Delay_msec(20);   
    Nop();   Nop();   Nop();   
//   
    writeLCDcmd(0x08);             //
    Delay_msec(20);     
    Nop();   Nop();   Nop();   
//     
    writeLCDcmd(0x01);             //
    Delay_msec(20);   
    Nop();   Nop();   Nop();   
//   
    writeLCDcmd(0x06);             //
    Delay_msec(20);   
    Nop();   Nop();   Nop();   
//     
    wait4BFclr();
    homeLCD();
    wait4BFclr();
    dispLCD();
    wait4BFclr();
 }

Easy to debug, and it works ....
Hope this helps ............................