just4hoi
Joined: 26 Apr 2006 Posts: 3
|
I need help with HDM64GS12.c |
Posted: Thu May 04, 2006 2:25 am |
|
|
Hi, Im working on my graphic LCD project.
I have used ex-glcd.c with HDM64GS12.c driver and it works fine.
Now I want to change the I/O pins in pic.
for example, R/W is connected to B4 in HDM64GS12.c code and I want to use other pin such as A4. What change should I make in HDM64GS12.c code?
Thanks |
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 04, 2006 10:46 am |
|
|
If you want to change the default i/o pins used by the HDM64GS12.c
driver, you need to put in new #define statements in the EX_GLCD.c
file, in the location shown in bold below.
If you use Pin A4, be sure to put a 4.7K pull-up resistor on it, because
on most PICs this pin is an open-drain output. It can pull down to
a logic 0, but it can't drive a logic one. You have to add an external
pull-up resistor to do this.
Quote: | #if defined(__PCM__)
#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#elif defined(__PCH__)
#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#define FAST_GLCD
#endif
// Define new pins for the HDM64GS12 driver here.
#define GLCD_CS1 PIN_A4 // Pin A4 requires 4.7K pull-up
#define GLCD_CS2 PIN_A3
#include <HDM64GS12.c>
#include <graphics.c>
#include <math.h> |
|
|