Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

JHD 162A LCD display using MikroC

Status
Not open for further replies.

jameschia

New Member
i written a program to display using JHD 162A LCD.
i using MikroC Compiler and i quite sure that my program do nt have any error.
but after i download the program into PIC and run it, it shows black box at the 1st row of my LCD. it remain unchanged even i remove my PIC.
this is my circuit and the code i write, is there any problem or any configuration need to be done that i have left?
 

Attachments

  • LCD circuit.png
    LCD circuit.png
    29.1 KB · Views: 311
  • code.txt
    860 bytes · Views: 231
i have replaced the MCLR resistor with 8.2k and add a 100ms delay before i call lcdinit, but it doesn't work also.
the black box still appear there.
 
When you say black box.. Do you mean the whole top line of the display, or just one at the beginning of the first line?

If the whole of the top line is bars!! the screen isn't initialized.

Is this project built on breadboard... If so ditch the xtal caps
 
Last edited:
there is a mistake in handling the Vee pin of the display. it is for contrast
generally this pin should have a voltage around 0.7 to 1V wrt gnd. People use a 10K preset across supply connecting the variable pin to Vee pin. It is adjusted to get best contrast. otherwise one can comfortably use 2 resistors as shown below.
 

Attachments

  • JHD162A mod.PNG
    JHD162A mod.PNG
    29.9 KB · Views: 492
Last edited:
In past i was using this 16X2 LCD with denounce switch and DIP for addressing data....
 

Attachments

  • 29072011200.jpg
    29072011200.jpg
    109.1 KB · Views: 274
  • 29072011201.jpg
    29072011201.jpg
    82.6 KB · Views: 263
  • 29072011203.jpg
    29072011203.jpg
    129.1 KB · Views: 255
The newer version of MikroC PRO and the EasyPIC 5 and 6 development boards use 6 PORTB pins for the LCD (not PORTD). You should check your version of MikroC, and the way you have set up the LCD in the code.

Unless you have a good reason I would use the 6 PORTB pins as used on all the new MikroE development boards, and use the MikroC internal libraries to drive the LCD as it makes it very easy. :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top