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.

Again: TLCD HD44780 + PIC18F4550 for education.

Status
Not open for further replies.

Peca

New Member
Here is my tested and, I think, well commented code which works on my EasyPIC3 board at 8MHz with text LCD 2x16 with HD44780 controller and PIC18F4550.
Try it, change it and make it works better!
And, of course, share this better results with us.
 

Attachments

  • TLCD HD47780 connected on PIC18F4550.zip
    84.3 KB · Views: 711
Here is my tested and, I think, well commented code which works on my EasyPIC3 board at 8MHz with text LCD 2x16 with HD44780 controller and PIC18F4550.
Try it, change it and make it works better!
And, of course, share this better results with us.

Hey Peca, thanks for the codes..
I have just downloaded them, I will try them
out in a while..
We are still working on a harder problem,
Streaming Parallel Port for PIC18F4550..
Do you have an idea how to make a PIC a slave under SPP?
Someone said this is possible, but I don't know how..

Please help..
Thank you!!
 
Hi, urefowei!
I am glad that you downloaded the code. Use it too son!
But, streaming parallel port is more complex and I didn`t worked with it, but You gave me an idea what to experiment next :).
Also, do not expect the results soon. Maybe someone other can help. Of course, when I done program that works, I will arttach it on the forum.
 
Code:
/* For definition of Nop() */
#include <p18cxxx.h>

That is where my error is found..
My MPLAB c18 compiler...........

C:\MCC18\h\delays.h:16:Error [1027] unable to locate 'p18cxxx.h'

What should I do?

About SPP of PIC18F4550, I hope you find out how to make one slave..
I am having problems, I wanna communicate 2 PIC18F4550 using SPP..
 
Last edited:
Code:
/* For definition of Nop() */
#include <p18cxxx.h>

That is where my error is found..
My MPLAB c18 compiler...........

Well, sorry, but I am not shure that I understand where is the mistake. In my code? I am not using directive #include <p18cxxx.h>.
Please, be more precise.
 
Hi Peca,

I tried to use your code to interface the HD44780 with a PIC18F4550, but could not get it to work. The code compiles successfully, but the LCD only turns on and displays a single row of blocks. I followed the diagram and connected everything as shown. The only difference was I used Pickit2 to program the PIC rather than the EasyPic3. Do you have any idea what is wrong? Thanks in advance!
 
Hi eeuser!

I just compiled the code (again) and tested it on my EasyPIC3 - works fine.
And I had problems at he begginning, too :). The problem my be with the delays. Let me try to explain it.
My EasyPIC3 is clocked by 8MHz crystal and that signal produces 48MHz clock for PIC18F4550. (If I am wrong, anybody, please correct me!). That means that PIC can send far more commands than periferal can accept. Because of that, we must include some delays between the commands that we send to the periferal.
As you can see from the code, first we prepare all the data at the necessery pins, assert the ENABLE pin and immediately deassert it. The instruction will be executed in the FALLING edge of the ENABLE pulse. This means that the assertion of the ENABLE pin will be ignored by TLCD and the delay is not necessery after the assertion. After that I am using the Delay1KTCYx(20); after ENABLE signal to give the TLCD necessery time to complete the previous instruction.
So, my suggestion is to experiment with the amount of delay: start with Delay1KTCYx(255); and if TLCD starts to work, lower the amount of delay to the moment the TLCD stops working. Than use the previous working delay.

Peca.
 
Last edited:
Thanks Peca! We increased the delay and added an external clock to the pic since we are using the pickit2 instead of the easypic3 development board. Thanks again for the test code everything works perfectly, we can finally start working on our project, lol!
 
Hi eeuser!
Sorry, I had a lot of of obligations so I haven`t time to read the forum.
I am glad that my code helped somebody. Improve it and share it with us.
Good luck!
Peca.
 
After a long time...

Hi AtomSoft!

You are absolutely not as* and you are right: we will call it CLCD for character LCD and GLCD for graphical LCD.

But, let me explain some catch :): in my language (serbian) we have very similar word "karakter" (read it just as it is written, or something like "charachter") and it means the nature, personality, good or bad person so it does not mean a letter or sign. We had the other word ("znak" or "slovo") and use them instead of character(s). Ordinary, the term in use is "text display" (Tekstualni LCD or TLCD) so I used it by inertia... I think that you understand me :eek:
I¨ll consider it in future.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top