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.
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.
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,
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)
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?
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)