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.

XLCD with PIC18f452

Status
Not open for further replies.
Well, the problem is that I can only write on the first line. The second line is missing.
Even when I change the contrast to maximum, only the first row shows black rectangles, the second line is missing.
Initially I thought the problem should be the display but it works fine with an Arduino Uno, and I also tried other display and no luck.
Any ideas what could be the problem?
 
The problem is with this line

OpenXLCD(FOUR_BIT & LINES_5X7);

The defines are not correct, and you cannot include the cursor defines... You are using no function set as the parameters equate to 0x08... which isn't correct....
 
Hi,
I don't mean to hijack this thread...
I used this thread to get Oshonsoft PIC18 simulator to run the code posted and it worked well, thank you!

How do I send data (eg. output of analog pin ADC conversion 0-1023) to the LCD to be displayed?
I can display strings, but not other data types (eg. unsigned int)

I have tried using itoa(), snprintf() with no luck. I can't seem to find the function prototypes in order to figure out what arguments I need to provide them.
 
Last edited:
I don't mean to hijack this thread...

You just did!!! The code on here was in C, not basic!!! did you convert it? Oshonsoft has the ability to print values to the LCD screen..

If you are using C however! Look into the sprintf() function...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top