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.

problem with LCD

Status
Not open for further replies.

meera83

New Member
i m using PIC16F877 to run LED and LCD Display, the LCD that i use is type CMC216x01..(www.cct.com.my)
after i burn my program code inside PIC and run it..
the LED can blink as i want, but the LCD show nothing...

before that,the PIC that i program can run well on PICDEM2 PLUS(the LED and LCD can show the result)..
i just move the PIC to the board that i built but it only can show the LED result but not LCD result..

the LCD pin i just connect to PIC directly using wire:
pin1(Vss)=Gnd
pin2(Vdd)=+5V
pin3(Vo)=potentiometer
pin4(RS)=RA3
pin5(R/W)=RA2
pin6(E)=RA1
pin11(DB4)=RD0
pin12(DB5)=RD1
pin13(DB6)=RD2
pin14(DB7)=RA3
 

Attachments

  • PG15-C216X01.pdf
    153.4 KB · Views: 230
  • f877tmpo.asm
    10.2 KB · Views: 125
meera83 said:
i m using PIC16F877 to run LED and LCD Display, the LCD that i use is type CMC216x01..(www.cct.com.my)
after i burn my program code inside PIC and run it..
the LED can blink as i want, but the LCD show nothing...

before that,the PIC that i program can run well on PICDEM2 PLUS(the LED and LCD can show the result)..
i just move the PIC to the board that i built but it only can show the LED result but not LCD result..

the LCD pin i just connect to PIC directly using wire:
pin1(Vss)=Gnd
pin2(Vdd)=+5V
pin3(Vo)=potentiometer
pin4(RS)=RA3
pin5(R/W)=RA2
pin6(E)=RA1
pin11(DB4)=RD0
pin12(DB5)=RD1
pin13(DB6)=RD2
pin14(DB7)=RA3


i think i have upload the wrong file, should be this one..
 

Attachments

  • f877tmpo.asm
    9.5 KB · Views: 127
Hi,
Can you assemble the program properly?
Code:
	[b]cblock	0x20			;start of general purpose registers
			count[/b]
			
LCD_PORT	Equ	PORTD
LCD_TRIS	Equ	TRISD
LCD_CTRL	Equ	PORTA
LCD_RS		Equ	0x03			;LCD handshake lines
LCD_RW		Equ	0x02
LCD_E		Equ	0x01

LEADZ	Equ		0x00

COUNT1 equ 20h
COUNT2 equ 21h

ADCON0 Equ 1Fh  

;start of program

		ORG	0x0000
.
.
.
don't you need 'endc' for the block of constant?
 
bananasiong said:
Hi,
Can you assemble the program properly?
Code:
	[b]cblock	0x20			;start of general purpose registers
			count[/b]
			
LCD_PORT	Equ	PORTD
LCD_TRIS	Equ	TRISD
LCD_CTRL	Equ	PORTA
LCD_RS		Equ	0x03			;LCD handshake lines
LCD_RW		Equ	0x02
LCD_E		Equ	0x01

LEADZ	Equ		0x00

COUNT1 equ 20h
COUNT2 equ 21h

ADCON0 Equ 1Fh  

;start of program

		ORG	0x0000
.
.
.
don't you need 'endc' for the block of constant?

i got put endc at the 2nd file that i upload..

the result show that the LED can flash mean that the PIC is running well, just i not sure the LCD can't function is the LCD problem or source code problem?
 
The code seems okay. Are you combining from 2 source?
Maybe you can check the hardware connection. Sometimes my LCD not working because of the hardware.
Besides, I don't use RW pin, I pull it down usually because I never read from LCD.
 
bananasiong said:
The code seems okay. Are you combining from 2 source?
Maybe you can check the hardware connection. Sometimes my LCD not working because of the hardware.
Besides, I don't use RW pin, I pull it down usually because I never read from LCD.

then the code that i write to PICDEM2 plus LCD can use for this type of LCD?
cos i use the same code..

i just use 1 source..

for the hardware, is it i just need to connect the pin direct to PIC, there is nothing special important component need to run the LCD, right?
i mean like PIC need Oscillator..
 
Just connect directly from the PIC to the LCD. I'm not sure whether this code suits your LCD or not.

BTW, did you adjust the contrast well? You will see nothing if Vo has the same potential as Vdd.
 
bananasiong said:
Just connect directly from the PIC to the LCD. I'm not sure whether this code suits your LCD or not.

BTW, did you adjust the contrast well? You will see nothing if Vo has the same potential as Vdd.

for the potentiometer, i had try to adjust from minimum to maximum but it still show nothing lo...

i have no idea of what method can i troubleshoot in order to solve the problem...:( :confused: :(
 
meera83 said:
for the potentiometer, i had try to adjust from minimum to maximum but it still show nothing lo...

i have no idea of what method can i troubleshoot in order to solve the problem...:( :confused: :(

For a start turning the contrast pot should produce a single row of full black squares, if not the LCD itself isn't working - and it's probably connected wrongly?. If you get the squares, then it's probably not being initialised correctly.
 
Be careful with the supplied voltage. My friend has burned 2 LCDs by giving too much voltage to them (forgot to lower the programming voltage, 13 V :D)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top