CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Changing lcd.c driver for 16f88

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
oyhan



Joined: 03 Jun 2005
Posts: 21
Location: TURKEY

View user's profile Send private message Send e-mail MSN Messenger

Changing lcd.c driver for 16f88
PostPosted: Sun Jul 16, 2006 5:25 am     Reply with quote

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

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Sun Jul 16, 2006 2:24 pm     Reply with quote

How can I do that..?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 16, 2006 2:32 pm     Reply with quote

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

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Sun Jul 16, 2006 2:42 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 16, 2006 2:56 pm     Reply with quote

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

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Sun Jul 16, 2006 3:28 pm     Reply with quote

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

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Tue Jul 25, 2006 5:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 26, 2006 10:40 am     Reply with quote

Quote:
may I see lcd's cursor

This thread has a list of settings to show or blink the LCD cursor:
http://www.ccsinfo.com/forum/viewtopic.php?t=20237
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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