Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 17th July 2007, 03:32 AM   (permalink)
Default problem with LCD

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
Attached Files
File Type: pdf PG15-C216X01.pdf (153.4 KB, 10 views)
File Type: asm f877tmpo.asm (10.2 KB, 6 views)
meera83 is offline   Reply With Quote
Old 17th July 2007, 03:54 AM   (permalink)
Default

Quote:
Originally Posted by meera83
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..
Attached Files
File Type: asm f877tmpo.asm (9.5 KB, 7 views)
meera83 is offline   Reply With Quote
Old 17th July 2007, 03:59 AM   (permalink)
Default

Hi,
Can you assemble the program properly?
Code:
	cblock	0x20			;start of general purpose registers
			count
			
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?
__________________
Superman returns..
bananasiong is offline   Reply With Quote
Old 17th July 2007, 04:07 AM   (permalink)
Default

Quote:
Originally Posted by bananasiong
Hi,
Can you assemble the program properly?
Code:
	cblock	0x20			;start of general purpose registers
			count
			
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?
meera83 is offline   Reply With Quote
Old 17th July 2007, 04:10 AM   (permalink)
Default

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.
__________________
Superman returns..
bananasiong is offline   Reply With Quote
Old 17th July 2007, 04:23 AM   (permalink)
Default

Quote:
Originally Posted by bananasiong
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..
meera83 is offline   Reply With Quote
Old 17th July 2007, 04:56 AM   (permalink)
Default

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.
__________________
Superman returns..
bananasiong is offline   Reply With Quote
Old 17th July 2007, 08:21 AM   (permalink)
Default

Quote:
Originally Posted by bananasiong
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...
meera83 is offline   Reply With Quote
Old 17th July 2007, 10:38 AM   (permalink)
Default

Quote:
Originally Posted by meera83
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...
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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 17th July 2007, 02:20 PM   (permalink)
Default

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 )
__________________
Superman returns..
bananasiong is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
problem of display number on LCD meera83 Micro Controllers 7 3rd July 2007 03:14 AM
PIC16+Parallel lcd - by twitchy Nigel Goodwin Micro Controllers 16 18th May 2007 10:44 AM
8 bits LCD Problem joe_1 Micro Controllers 3 27th April 2007 01:38 AM
89c4051 4-bit controlled LCD sporadic screwup Pax Writer Micro Controllers 7 26th April 2007 05:58 AM
LCD Template Code For PIC16F84A (Help) Peter_wadley Micro Controllers 23 4th April 2007 03:47 AM



All times are GMT. The time now is 08:54 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.