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 CCS Technical Support

Use Driver in my compiler

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



Joined: 12 Apr 2013
Posts: 3
Location: Persian

View user's profile Send private message

Use Driver in my compiler
PostPosted: Fri Apr 12, 2013 10:44 am     Reply with quote

How can i use some driver that another person wrote them? For example how can i add flex_lcd.c driver in my compiler ? Is it needed to write this in new source and save it in drivers folder ?
Code:

// flex_lcd.c

//#define LCD_DB4   PIN_D4
//#define LCD_DB5   PIN_D5
//#define LCD_DB6   PIN_D6
//#define LCD_DB7   PIN_D7

//#define LCD_E     PIN_E1
//#define LCD_RS    PIN_E0
//#define LCD_RW    PIN_E2

// If you only want a 6-pin interface to your LCD, then
// connect the R/W pin on the LCD to ground, and comment
// out the following line.

//#define USE_LCD_RW   1     

http://www.ccsinfo.com/forum/viewtopic.php?t=24661
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Fri Apr 12, 2013 11:19 am     Reply with quote

edit for use with your schematic pin out
and save anywhere you can link to it at compile time.
aryan.ir



Joined: 12 Apr 2013
Posts: 3
Location: Persian

View user's profile Send private message

PostPosted: Fri Apr 12, 2013 12:24 pm     Reply with quote

THX.But how can i call it in my program? is this true???
#include <flex_lcd.c>
I wrote this in my program but it gave me undefined identifier error.
Code:
#include <16F877A.h>
#device adc=8
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOBROWNOUT               //No brownout reset

#use delay(clock=8000000)

#define LCD_DATA_PORT getenv("SFR:PORTD")
#include <flex_lcd.c>

void main()
{
   lcd_init();   

      delay_ms(10);
      lcd_gotoxy(2,1);
      lcd_putc("!Hello!");
      delay_ms(10);
      lcd_gotoxy(1,2);
      lcd_putc("Welcome");

}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 12, 2013 12:27 pm     Reply with quote

Quote:
#define LCD_DATA_PORT getenv("SFR:PORTD")
#include <flex_lcd.c>

The line in bold is not part of the flex_lcd.c file. The line in bold is from
the CCS lcd driver file, which is in this directory:
Quote:
c:\program files\picc\drivers\lcd.c


Do not try to mix together lines from flex_lcd.c and lcd.c.
temtronic



Joined: 01 Jul 2010
Posts: 9240
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Apr 12, 2013 2:08 pm     Reply with quote

also...

Be sure to copy the original source, save as 'my_flex_lcd.c' or similar.
Then edit THAT file, NOT the original!
Obviously in your programs you'll include your version not the original.

hth
jay
aryan.ir



Joined: 12 Apr 2013
Posts: 3
Location: Persian

View user's profile Send private message

PostPosted: Sat Apr 13, 2013 12:45 pm     Reply with quote

THX Idea
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