Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Control of EW 162 LCD display module

Status
Not open for further replies.

fejesg

New Member
Hello Everybody!

On last year I have bought from a Hungarian Microchip-reseller-company an EDT LCD module, type is EW-162G0Gr. It is a 2 rowed, 2x16 pcs 5x7 black LCD display with backlight.

I would like to control it with PIC16F628A, internal 4 MHz oscillator. I wrote in the original initialization routine, but it is not works - ellectronic of this display has a BF flag, with which it can sign, when is not allowed any writing operation, while electronic is working.

I wrote the program, and wait 1->0 transition; it has not comes. What is the problem? May I wait more before actions?

fejesg
 
So, I use this type metod; after it, cursor shall blinking:

fejesg

; 8 bits init
;
; wait 15-20 millisec No data should be transferred to or from the display during this time.
;
; RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
; 0 0 0 0 1 1 x x x x Function Set Command: (8-Bit interface)
; BF (BF=R/W !!!)cannot be checked before this command.
;
; wait 5 millisec No data should be transferred to or from the display during this time.
;
; 0 0 0 0 1 1 x x x x Function Set Command: (8-Bit interface)
; BF cannot be checked before this command.
;
; wait 100 mikrosec No data should be transferred to or from the display during this time.
;
; 0 0 0 0 1 1 x x x x Function Set Command: (8-Bit interface)
; After this command is written, BF can be checked.
;
; BF=DB7, which connected to RB3, BF=1 please wait, BF=0, ready
varak
banksel TRISB
bsf TRISB,3 ; change output to input
banksel PORTB
bsf PORTA,7 ; RW
btfsc PORTB,3
goto varak
bcf PORTA,7 ; RW
banksel TRISB
bcf TRISB,3 ; back to output
;
; 0 0 0 0 1 1 N F x x Function Set
; (Interface = 8 bits, Set No. of lines and display font)
;
; 0 0 0 0 0 0 1 0 0 0 Display OFF
; 0 0 0 0 0 0 0 0 0 1 Clear Display
; 0 0 0 0 0 0 0 1 I/D S Entry Mode Set:
; 0 0 0 0 0 0 1 1 C B Display ON (Set C and B for cursor/Blink options.)
;
;Initialization Complete, Display Ready.
;BF should be checked before each of the instructions starting with Display OFF.
 
I "translated" command lines orientate of PORTB&LCD connections:

; LCD data 0-1-2-3-4-5-6-7
; 6.bit RB2, 7.bit RB3 7-6-5-4-0-1-2-3
btfsc PARANCS,0
bsf PORTB,7
btfsc PARANCS,1
bsf PORTB,6
btfsc PARANCS,2
bsf PORTB,5
btfsc PARANCS,3
bsf PORTB,4
btfsc PARANCS,4
bsf PORTB,0
btfsc PARANCS,5
bsf PORTB,1
btfsc PARANCS,6
bsf PORTB,2
btfsc PARANCS,7
bsf PORTB,3
return
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top