Yes, really handy. Thanks a lot again.
I would appreciate to find some more explanations on how to read (understand) and write to the display the configuration commands such as LCDOUT $FE, xxx.
Merci encore.
Yes, really handy. Thanks a lot again.
I would appreciate to find some more explanations on how to read (understand) and write to the display the configuration commands such as LCDOUT $FE, xxx.
Merci encore.
Roger
I've got an answer from ELECTRONIC ASSEMBLY (EA). They say this display is fully HD4470 compatible.
So, until the contrast (all the display in fact) is not initialised properly, nothing will happen on the display.
I've got this table extracted from the PDF file I inserted in my first post:
This example is for a 8 bits display. I would prefer to use it with 4 bits but if it is easier to start this way...
Can somebody tell me what syntax I have to use to modify the contrast settings?
Is it LCDOUT $FE, $74? I tried this already but nothing happened.
I don't understand how to use this table. Could somebody explain me please?
BTW, EA also sent me some assembly examples (see attachments); for those who understand this, it may help, maybe. Unfortunately, I don't know assembler...
Mister_e, see the picture? Thanks you, again ;-)
Last edited by flotulopex; - 26th November 2006 at 13:34.
Roger
Take a look at http://www.lcd-module.de/eng/pdf/zubehoer/st7036.pdf
Pages 34-38 tell you exactly what each register contains and what each bit does.
Page 39 shows 8 bit initialisation
Page 41 shows 4 bit initialistaion but you dont need to go down to that lave. PBP should take care of that for you.
Just look for the commands that set the contrast. It look to be "$7x" where x is the setting 0-F for the 16 possible values.
I would follow Steves advice for leaving a long delay after the first initialistaion command then try something like this
That should send all possible values to the LCD for adjusting the contrast and if it works you will see on the display the values that give a visible display. Then pick the best one.Code:contrast var byte contrastcommand var byte For contrast = 0 to 15 contrastcommand = $70 + contrast LCDout $FE, contrastcommand pause 10 LCDout $FE,1, "contrast=", DEC2 contrast pause 1000 Next
Cant really offer much more as I dont have that type of display.
Keith
www.diyha.co.uk
www.kat5.tv
Okay.
I'll go back to my breadboard and try.
Come back asap.
Roger
I did almost everything all of you suggested.
Still nothing works; the display is just not showing anything.
I even tried to reverse the bus order (sorry Melanie) since the guy from EA said this would be so (but I can't believe it - D0 on display should be connected to DB0 and so on, for sure).
Ii is now sunday 15:45 local time and I won't be able to have news before tomorrow morning.
So, let's wait a little...
Roger
Can you try...
there's still some more code efficient solutions so far..Code:' Register settings OSCCON = %01100000 'Internal RC set to 4MHZ ANSEL = %00000000 'Disable Analogue Inputs OPTION_REG = %01000000 'Enable PORTB pullups ManualLCDInit: FLAGS=2 ' Void PBP lcd initialisation... it's a nice feature !!! PAUSE 500 Lcdout $FE, $30 Lcdout $FE, $30 Lcdout $FE, $30 Lcdout $FE, $20 ' official 4 bit mode Lcdout $FE, $28 ' Function Set Lcdout $FE, $14 ' Bias Lcdout $FE, $78 ' Contrast set Lcdout $FE, $5E ' Power/Icon/Contrast Lcdout $FE, $6A ' Follower control Lcdout $FE, $0C ' Display ON Lcdout $FE, $01 ' Clear display Lcdout $FE, $06 ' Entry mode Set ' --------------------------------- End LCD init! LCDOUT $FE,1,"Line1",$FE,$C0,"Line 2" Pouet: Goto Pouet
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hey Steve.
I could be wrong, but I think it needs a fix.
The LCD will Power-up in 8-bit mode, but PBP will still be sending 4-bit.
So each nibble acts as a full command.
If you use $33 (twice), then it will get the "reset" 4 times, instead of $30,$00,$30,$00 ...
Then when it switches to 4-bit mode, it receives an extra nibble from the $20 which puts it out of sync with the rest of the data. By pulsing the E pin once it clocks in another $0 which is a "nothing" command and puts it back in sync.
Like this ...Code:ManualLCDInit: FLAGS=2 ' Void PBP lcd initialisation... it's a nice feature !!! PAUSE 500 Lcdout $FE, $33 Lcdout $FE, $33 Lcdout $FE, $20 ' official 4 bit mode @ bsf LCD_EREG, LCD_EBIT PAUSEUS 20 @ bcf LCD_EREG, LCD_EBIT ; -- rest is the same --
DT
Hi,
Just for an update, let me paste the code I use currently to make these kind of display working.
Code:' Code lines to be adapted according to 4 or 8 bits mode are marked " '// " ' LCD circuitry '23,24,25,26,40 - Vdd (+5V) '27,37,38 - Vss (GND) '35 DB0 - PORTC.0 '34 DB1 - PORTC.1 '33 DB3 - PORTC.2 '32 DB4 - PORTC.3 '31 DB4 - PORTC.4 '30 DB5 - PORTC.5 '29 DB6 - PORTC.6 '28 DB7 - PORTC.7 '39 RS - PORTB.5 '36 E - PORTB.4 '------------------------------------------------------------------------------- ' Fuses @ DEVICE PIC16F690,FCMEN_OFF @ DEVICE PIC16F690,IESO_OFF @ DEVICE PIC16F690,BOD_OFF @ DEVICE PIC16F690,CPD_OFF @ DEVICE PIC16F690,PROTECT_OFF @ DEVICE PIC16F690,MCLR_OFF @ DEVICE PIC16F690,PWRT_OFF @ DEVICE PIC16F690,WDT_OFF @ DEVICE PIC16F690,INTRC_OSC_NOCLKOUT '------------------------------------------------------------------------------- ' Registers 76543210 OPTION_REG = %10000000 'PORT A&B Pull-Ups disabled (look WPUA & WPUB) ANSEL = %00000000 'Disable analog inputs Channels 0 to 7 ANSELH = %00000000 'Disable analog inputs Channels 8 to 11 ADCON0 = %00000000 'A/D Module is OFF CM1CON0 = %00000000 'Comparator1 Module is OFF CM2CON0 = %00000000 'Comparator2 Module is OFF INTCON = %00000000 'INTerrupts CONtrol TRISA = %00000000 'Set Input/Output (0 to 5) PORTA = %00000000 'Ports High/Low (0 to 5) TRISB = %00000000 'Set Input/Output (4 to 7) PORTB = %00000000 'Ports High/Low (4 to 7) TRISC = %00000000 'Set Input/Output (0 to 7) PORTC = %00000000 'Ports High/Low (0 to 7) - 8 bits '//PORTC = %00001111 'Ports High/Low (0 to 7) - 4 bits '------------------------------------------------------------------------------- ' Defines DEFINE LCD_DREG PORTC 'LCD data port DEFINE LCD_DBIT 0 'LCD data starting bit 0(8bits) '//DEFINE LCD_DBIT 4 'LCD data starting bit (4 bits) DEFINE LCD_RSREG PORTB 'LCD register select port DEFINE LCD_RSBIT 5 'LCD register select bit DEFINE LCD_EREG PORTB 'LCD enable port DEFINE LCD_EBIT 4 'LCD enable bit DEFINE LCD_BITS 8 'LCD bus size 8 bits '//DEFINE LCD_BITS 4 'LCD bus size 4 bits DEFINE LCD_LINES 2 'Number lines on LCD '------------------------------------------------------------------------------- ' Variables Contrast var byte Contrastcommand var byte '------------------------------------------------------------------------------- ' Init display ' COG Mandatory settings pause 1000 'Time to settle Vdd (THIS IS VERY IMPORTANT!!!) lcdout $FE, $39 'Function Set: 8 bits bus mode '//lcdout $FE, $29 'Function Set: 4 bits bus mode lcdout $FE, $1C 'Bias set lcdout $FE, $52 'Power control + Contrast (HiByte) lcdout $FE, $69 'Follower control Lcdout $FE, $74 'Contrast (LowByte) ' COG Optional settings 'lcdout $FE, $38 'Function Set: switch back to instruction table 0 'lcdout $FE, $0F 'Display ON/OFF 'Lcdout $FE, $01 'Clear display 'Lcdout $FE, $06 'Entry Mode Set: cursor auto-increment 'lcdout $FE, $0F '%00001111 - Display ON, Cursor ON, Blink ON 'lcdout $FE, $0C '%00001100 - Display ON, Cursor OFF, Blink OFF '------------------------------------------------------------------------------- ' Program MAIN: lcdout $FE, $70 LCDOUT $FE,1,"2 Lines Display",$FE,$C0,"EA DOGM-162L-A" pause 1500 LCDout $FE,1, "contrast = ", $FE,$C0,"Hello Gerben ;-)" For contrast = 0 to 15 contrastcommand = $70 + contrast LCDout $FE, contrastcommand pause 10 LCDout $FE,$8B, DEC2 contrast pause 200 Next pause 1500 goto main: end
Roger
Bookmarks