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.

Weird crystal problem 16f887

Status
Not open for further replies.

osmansafa

Newbie level 6
Joined
Jan 10, 2006
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,390
Hey guys. I am implementing a very basic microcontroller (PIC 16f887) circuit that basically sends data to LCD. I simulated the program successfully but when I implement it, there is nothing showing on LCD. I have checked the connections and two outta four of the LCD's data bits are on. The weird problem popped out when I check the crystal and realized that it is not working (crystal per se is fine in other circuits and gives nice 4 MHz oscillation). Any ideas will be appreciated. Thanks.
 

Hi friend

First of all, remove LCD from Project board,
and than check your crystal using some testing Program.

write some testing program like led blinking with 1 second time period in your micro,
it help you to find out that crystal is ok or not

than check your LCD.

Hope this is help you.
Shyam
 
Hello, is your project on "breadboard"? What is the XTAL manufacturer name? If it is low quality noname crystal, there might be a problem to start oscillation on breadboard
 
check if you are using proper capacitor for your cystal circuit.... Check if you are getting voltages at the controller pin connected to crystal... try to resolder it properly.
 

Thank you all for quick replies. I have checked my crystal using a LED blinking circuit and it worked perfectly. I tried the circuit using two LCDs so I do not think it is a LCD or xtal issue.
 

Hi friend

if crystal is not your problem, then
What is your problem?
describe in detail.

Which language is used to write program? C or ASM.

Shyam
 

My problem is LCD does not show up anything. The program was written in C and it is just to write 'welcome' on LCD.
@ckshivaram
Can you be more specific? I do not follow you.
Thank you again.
 

Hi,
I think you need to adjust the contrast of LCD.
56_1292828437.png


There was a similar problem of no text on LCD in another thread where it was due to not adjusting the contrast. Check it here: https://www.edaboard.com/threads/194246/#post824737

Hope this helps.
Tahmid.
 
Hi,
With above cct you should add 10k pull-up for RS line.

In software, before initializing LCD give enough time-delay to settle LCD. For that you may give 300~400ms delay before initializing commands to LCD.

Also enable following features of PIC for stable start-up of xtal and power
1. Power-up Timer (PWRT)
2. Oscillator Start-up Timer (OST)
(Use PIC data-sheet for details on these topics)

Wish you success !
 
Thanks for the replies. I changed my resistor for pin 3 and add 10 k to pin4. When I power it up, the second row (using a 16x2 lcd) is filled with 16 squares. Any idea why not writing some letters but filled squares?
 

That's the first row, actually, and that usually means you didn't go through the configuration sequence of the LCD correctly.

Ensure that you follow the sequence as described in the datasheet and make sure you are using reasonable delays between instructions.
 

Hi osmansafa,

It's nice to know you have some improvement;

You can find good tutorial on LCD here,
PIC Tutorial  Three - LCD Modules
Although it has assembly-code, it's description is very good to use with all other programming languages.

After initializing LCD, instead of using "delay" between commands, you can check busy-flag in LCD. It is the best way to communicate with LCD.(This has been also described in above tutorial)

Good luck.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top