View previous topic :: View next topic |
Author |
Message |
jenn Guest
|
connect lcd to pic16f877-code |
Posted: Wed Aug 12, 2009 1:58 am |
|
|
Hi
i have lcd WITH 8 bits, DB0-DB7 2x16.
i can see here in the sticky code that you allways use only 4 pins of it - db4-db7, but i have 8 bitsdb0-db7 ..so what with the others ?
can i present words only with the last 4 ?
anyway, i really want just to send "hello world" from my pic16f877, to this 7 pins lcd.
can some one give me a simple short code for that ?
does this chip has a build in function for THIS LCD ? |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Wed Aug 12, 2009 2:51 am |
|
|
No there are no built in functions for the 16F877 mcu. But see the code section in this forum. Many people have designed LCD routines that can be used in the mcu.
Also mention what kind of LCD module are you using. |
|
|
jenn Guest
|
other |
Posted: Wed Aug 12, 2009 6:39 am |
|
|
so other pics does have a built in lcd ?
for example pic16f690- the one who came with pickit2 ?
its a parallel lcd .
i couldnt find the code you talked about anyway . |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Wed Aug 12, 2009 6:45 am |
|
|
PICs do not have built in LCDs they are only micro-controllers.
PICs can be connected to LCDs. The 16F690 can also be connected to a LCD.
Since you mentioned built in LCD, I assumed you meant built in LCD functions/procedures.
You can connect the 16F690 to the LCD. The pins DB0 to DB7 connect to each of the I/O pins of the 16F690.
For exact circuit you can search in this forum, or google around. There are tons of code that use LCD and a PIC.
What compiler are you using ???
thanks
arunb |
|
|
jenn Guest
|
|
Posted: Wed Aug 12, 2009 7:49 am |
|
|
Hi..
man...thank you but i know for couple of years what is mcu,screen or pic.
I am enginner so thanks for explanation but i know that.
I did mean to built in function in the ccs c but i understood that not all pics can use this built in function.
So my question was, if 16f690 can work with this built in function, or do i need to build a function to send asci code ?
I need a pic which i can write to him :printf-and the word i need to print.
does 16f690 can deal with this built in c function?
I was google all over the earth and haven't found one ccs c code to run a parallel lcd with pic. Only serial\assembler.
So if you have a simple one, please....
Thanks a lot !
jenn |
|
|
Guest
|
|
Posted: Wed Aug 12, 2009 8:38 am |
|
|
can someone tell me what is the flex_lcd.c ?
i know its a built in function, that the ccs c has, and can help me use a parallel lcd simply.
i know that someone rewrite it to other pins..
my question is where can i find the original function in my header, and what pins that it uses? can i use it with pic16f690 ?
thanks ! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Aug 12, 2009 10:34 am |
|
|
Quote: | can someone tell me what is the flex_lcd.c ? |
It's a lcd driver program, and it's in the Code library forum, near the top:
http://www.ccsinfo.com/forum/viewforum.php?f=2
It has instructions on how to use it. |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Wed Aug 12, 2009 11:52 am |
|
|
LCDs can be used with the full 8 lines, just present a byte to the port where the 8 lines to the lcd is connected and toggle the right control lines
some lcds offer an option to load data only using 4 data lines... (not including control lines) in which you have to load a byte 4 bits at a time
others offer serial interface.. in which you use even less I/O pins...
depends on the screen controller.... look at the chip numbers on the back of the screen...
aside from the data lines.. screens need control lines
like: enable, read, write.... maybe other controls as well... or combination.
you have to toggle them in the right order and with some small delays...
since the screen is basically controlled by its onboard microcontroller...
its basically something like this:
1) present byte on data port (8 or 4 lines)
2) set write control line high or low depending on logic
3) toggle enable line high to low (or vice versa depending on logic)
(on or off time should be of a reasonable time to allow the screen controller to react.... )
4) small delay
5) repeat for next byte....OR COMMAND (like changing the screen line you want your data to be shown....
its not like a 7 segment display where your PIC is the brain.
find the type of controller your screen has and read up on it....
(look at the chip number on its back....
hope i helped....this is what i remember of the top of my head.
gabriel _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
|