|
|
View previous topic :: View next topic |
Author |
Message |
dieter Guest
|
LCD on 18f6585 not working.... |
Posted: Sat Oct 08, 2005 5:27 pm |
|
|
Hi, i connected a 16x2 lcd which i tested with standard lcd.c driver on a pic. So far, so well. Now i connected it on other pins as the following:
RS:A4
RW.B2
EN:D2
Data0-3:B4-B7
the lcd is connected via a flat cable(20cm) and every line is pulled-up by a resitor of 50k. Contrast on pin 3 works correctly and is visible. But the display wont work...Even with marks driver...every line is connected on its right place as i tihnk. is there another fuse to set or does enable line not need any pullup? i already disabled all_analogs. but it still doesnt work on my 18f6585... what could be wrong? thanks... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Oct 08, 2005 9:48 pm |
|
|
When an LCD is used in 4-bit mode, it uses the upper 4 bits to talk
to the micro-controller. i.e., DB4-DB7 on the LCD.
You're using the lower 4 bits on the LCD. So you need to change that. |
|
|
dietmar Guest
|
|
Posted: Sun Oct 09, 2005 4:19 am |
|
|
Well this is not my problem. propably is was a fault to say i use data0-3, but i am already using D4-D7...This is not the problem i think... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Oct 09, 2005 10:31 am |
|
|
Try the LCD driver that I recently posted in the Code Library.
It's very easy to modify.
http://www.ccsinfo.com/forum/viewtopic.php?t=24661
To modify it for your board, just comment out the Pin definitions
at the top of the file and use these instead:
Code: |
#define LCD_DB4 PIN_B4
#define LCD_DB5 PIN_B5
#define LCD_DB6 PIN_B6
#define LCD_DB7 PIN_B7
#define LCD_E PIN_D2
#define LCD_RS PIN_A4
#define LCD_RW PIN_B2
|
To test it, write a simple program that outputs "Hello World" to
the LCD. Something like this:
Code: | #include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#include <flex_lcd.c>
//=======================
void main()
{
setup_adc_ports(NO_ANALOGS);
lcd_init();
lcd_putc("Hello World");
while(1);
} |
Also, in a previous thread, you were planning to use a 74HCT14
schmitt trigger inverter chip. I assume that you removed that
chip for your tests. The lcd driver shown above will not work with
the inverter. So make sure you remove it. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|