Security Door Project.Problem With Lcd.Plese Help!!

Status
Not open for further replies.

muras

New Member
Hello everyone!

Thanks to this circuit you can put an access key to enter in a home,door Lab,etc. If somebody tries to access to this enclosure and introduces three times the password incorrectly, this activated a sonorous alarm. The key is introduced by means of a keyboard of 16 keys and the state in a LCD 16X2.When introducing the correct key, the circuit activates a relay which drives the device to opening the door.The "brain" of this device is a PIC16F877

I´m trying to put this project to work, i´ve already have the PCB and all the hardware conected, but when i "feed" the circuit the only thing that shows in the LCD is 32 black squares
The Lcd i´ve used is this:

**broken link removed**

and it is supposed to work in 8bit mode

I´ve attached the source code (used the microchip Mplab 7.2 compiler and shwoned no erros in the code) and a picture of the project,the picture reffers to a Pic16F876 but I´ve used a Pic16F877 and use the same port configuration and components

Can anyone help me?
Thanks in advance
 

Attachments

  • KEY.JPG
    117.5 KB · Views: 232
  • KEY_SOURCE_CODE.txt
    16.1 KB · Views: 201
Last edited:
First question is, is you contrast voltage correct?
Like 3/4 of the people trying to drive LCDs who have an entirely black or white screen simply don't have the contrast set properly.
 
Oznog said:
First question is, is you contrast voltage correct?
Like 3/4 of the people trying to drive LCDs who have an entirely black or white screen simply don't have the contrast set properly.

The contrast voltage is correct I use a Potentiometer of 10k to regulate it
 
Just took a quick look at your source, and I don't think you have your LCD initialization routine down. You should just try getting the LCD to work with a simple program first, then you can add all of your other functions when you have it working. Also, you should probably just post a short section of code which will illustrate your problem, rather than the whole enchilada, which people are probably not going to sift through, to find your problem.
It appears you are using LCD status to tell if your LCD is ready (WAITLCD,) but I don't see any calls to this in your init routine. What is, perhaps more common, is to just wait for a short time for the LCD to initialize, and I don't see that in your INITLCD routine.
I think you should take a look at Nigel's tutorials, they may help out. You can find them here:
http://www.winpicprog.co.uk

Regards,
Robert
 
Yes, the black squares generally mean that you're not initialising the display, but by turning the contrast up too high you can get the black squares (but only on one row).
 


I´ve used the PIC Simulator IDE v5.92 from oshon software and when I load the Hex file and run it,it apeears an error saying:"New command or data received while LCD was busy.LCD will not behave properly and probably display some garbage data.Appropriate delay interval in your program should be increased".

Has Robert says I think this is the problem, can anyone tell me what can I change in my LCD routines or which delay interval sould I use?
I´ve attached a smaller version of the code with only the lcd routines and where I call them

Hope that someone can help me
 

Attachments

  • LCD__.txt
    2 KB · Views: 150
EDIT: sorry... misread the INCIO section, i was expecting a bad ADCs disabling..

Some LCDs need a higher settle time than others, so i would guess to increase it before to initialise the LCD. i heard that some may need up to 2Second of settle time... YUK!

Make sure you set correctly the HS osc fuse before programming your PIC and add a 0.1uF as close as you can of your PIC. Be sure both PIC VSS lines are connected too.... wich is not the case in your schematic.

Also 33Pf cap is a little bit high... 15-22pF would be a better choice.
 
Last edited:
Not Sure if this is of any help, but we had the same problem with an Lcd at work on a parking machine display.
If the unit was rebooted before it had completely discharged the screen would always come up with black squares. This was always cured by either leaving it off for 30 seconds before rebooting. Or to decrease the contrast until all the black squares disappear then raising it again which would bring the characters back up.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…