View previous topic :: View next topic |
Author |
Message |
oyhan
Joined: 03 Jun 2005 Posts: 21 Location: TURKEY
|
Changing lcd.c driver for 16f88 |
Posted: Sun Jul 16, 2006 5:25 am |
|
|
Hi
I want to use 2X16 lcd with 16f88pic.
I need that,
lcd 4 port data port B4,B5,B6,B7
rs pin port B3
E pin port B2
how can I do that please help me for driver....
Thanks.... |
|
|
oyhan
Joined: 03 Jun 2005 Posts: 21 Location: TURKEY
|
|
Posted: Sun Jul 16, 2006 2:24 pm |
|
|
How can I do that..? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 16, 2006 2:32 pm |
|
|
Use the LCD driver in this post, instead of the CCS driver.
http://www.ccsinfo.com/forum/viewtopic.php?t=24661
Edit the #define statements at the start of the driver, so the
pin numbers are the same as the pins shown in your post. Example:
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_B2
#define LCD_RS PIN_B3
// #define LCD_RW PIN_A2
|
Also in your post, you don't use the RW pin. So in the driver,
just comment out the line for USE_RW_PIN. Example:
Code: | // #define USE_LCD_RW 1 |
If you don't use the RW pin, then you must connect it to ground
on the LCD.
Also, make sure that your #fuses statement has NOLVP in it.
Make sure that you call the lcd_init() function at the start of your program. |
|
|
oyhan
Joined: 03 Jun 2005 Posts: 21 Location: TURKEY
|
|
Posted: Sun Jul 16, 2006 2:42 pm |
|
|
Thanks for your answer.
Would you give me short example please...?
like that "Hello world"
I want to learn this subjects..
Best Regards... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 16, 2006 2:56 pm |
|
|
Code: | #include <16F877.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#include "flex_lcd.c"
//======================
void main()
{
lcd_init();
lcd_putc("\fHello World");
while(1);
} |
|
|
|
oyhan
Joined: 03 Jun 2005 Posts: 21 Location: TURKEY
|
|
Posted: Sun Jul 16, 2006 3:28 pm |
|
|
Thank you very much
Dear PCM programmer. It is ok.
I wrote that:
Code: | #include <16F88>
#fuses INTRC_IO, MCLR, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=8000000)
#include "flex_lcd.c"
void main()
{
setup_adc(ADC_OFF);
setup_adc(NO_ANALOGS);
SETUP_CCP1(CCP_OFF);
setup_spi(FALSE);
setup_counters(RTCC_INTERNAL,WDT_18MS);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
lcd_init();
while(1)
{
output_high(PIN_A2);
delay_ms(500);
output_low(PIN_A2);
delay_ms(500);
lcd_putc("hello world");
lcd_putc("\n PIC 16f88");
}
} |
|
|
|
oyhan
Joined: 03 Jun 2005 Posts: 21 Location: TURKEY
|
|
Posted: Tue Jul 25, 2006 5:26 pm |
|
|
Hi Dear Friends
I want to do blinking lcd's karakter or may I see lcd's cursor. I use "flex_lcd.c" lcd driver. I want to increment variable like examp=xxxx I have 2 button up and down for increment and decrement. I want to see for this increment and decrement event on lcd but how? Give me an example for that please...
Best Regards... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|