Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Jan 12, 2005 2:49 pm |
|
|
| Quote: | | How can i use this code like a driver.c |
If you want this code in a separate file, just put it in one and use a #include "driver.c" in the main c file. Just look at the examples and you will find plenty of examples of doing this.
| Quote: | | set the control lines (DATA, CLOCK) from a main source code |
First you need to define them
| Code: |
#define DATA PIN_B1
#define CLOCK PIN_B0
|
This could be in the main c file or in the driver.c file. To control them, just use commands like:
| Code: |
output_low(CLOCK);
output_high(CLOCK);
|
| Quote: | | how i can share the RS and DATA lines without imcompatibility in PIC C, ex: portb.1 = RS and portb.1 DATA? |
You can define both the RS and Data to be PIN_B1. |
|