Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Error when trying to display a character on LCD with PIC 16f877a

Status
Not open for further replies.

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
751
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,054
I just trying to display a letter A in a 16x2 LCD.

I got some information from


then i had written a small program in HTC for PIC16F877A(below)

Then i stimulate it in oshonsoft pic stimulator.
but the result is "error" and nothing is displayed in LCD.(SCREEN SHOOT BELOW)
31_1296822737.png



THE ERROR IS DISPLAYED IN LCD STIULATOR JUST AFTER THE high to low transition of E.
I DON'T HAVE THE DATA SHEET FOR THE LCD..
 
Last edited:

Re: LCD WITH PIC 16f877a

It could be to do with the timings, I had a similiar problem, if I remember correctly and you click on the error button it will tell you the problem.

Thsi link gives an idea of the timings required for each stage **broken link removed**
 
Last edited:
Re: LCD WITH PIC 16f877a

I think your problem is Port setting.
Your source code
#define Data PORTB
Simulator’s LCD module Data Line set to PORTD
Data Lines -----> PORTD
Use
Data Lines -----> PORTB
 

Re: LCD WITH PIC 16f877a

I think your problem is Port setting.
Your source code
#define Data PORTB
Simulator’s LCD module Data Line set to PORTD
Data Lines -----> PORTD
Use
Data Lines -----> PORTB

Missed that bit in the image (just noticed the error), as Denshil says, you are trying to use the same ports for data (8 bit and control) in the simulator,
 

Re: LCD WITH PIC 16f877a

Since you are using Hitech C, I would suggest you to go to the following path:
C:\Program Files\HI-TECH Software\PICC\9.71a\samples\LCDemo
there are two files named lcd.c and lcd.h, have a look at them, they are pretty much the sort of files that would work with LCD, that you are trying to use and will most likely run in simulation as well.

BTW: it seems that you are experimenting with the LCD and its code, which would mean that you wont be reading any thing from the CGRAM of LCD therefore, you should connect the R/W pin of the LCD to ground (putting it in write mode) and disconnecting the MCU pin going to the R/W of LCD, also comment out any reference to R/W in your code.

If you still find problems in initializing the LCD drop a line and I ll provide some working code.
 
Last edited:

Re: LCD WITH PIC 16f877a

sorry, i had deleted that screen shoot to avoid confusion, because that screen shoot is old one, and after that i changed those settings in stimulator, but still error ...
so, i think i need to know more about LCD working, its timing etc....
any way, is there any error in my code?
i write those code just by getting a small idea from the link above...(first screen)
 

Re: LCD WITH PIC 16f877a

thanks to all.....now its working, my problem was 'no delay'.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top