|
|
View previous topic :: View next topic |
Author |
Message |
xbrav
Joined: 17 Feb 2009 Posts: 3
|
Odd output from KS0108 |
Posted: Tue Feb 17, 2009 6:15 pm |
|
|
Hello all,
Encountering an odd error with a PIC16f628a and a KS0108-based graphic LCD.
Code: | #include <16F628A.h>
#include <math.h>
#FUSES NOWDT, XT, NOPUT, NOPROTECT, NOBROWNOUT, NOMCLR, NOLVP, NOCPD, INTRC //628A
#use delay(clock=4000000)
#include <glcd.c>
void main()
{
glcd_init(ON);
glcd_fillScreen(ON);
} |
Very basic code, initialize the LCD then fill it.
I have modified the glcd.c for my 628a as follows:
Code: | #ifndef GLCD_CS1
#define GLCD_CS1 PIN_A0 // Chip Selection 1
#endif
#ifndef GLCD_CS2
#define GLCD_CS2 PIN_A1 // Chip Selection 2
#endif
#ifndef GLCD_DI
#define GLCD_DI PIN_A2 // Data or Instruction input
#endif
#ifndef GLCD_RW
#define GLCD_RW PIN_A3 // Read/Write
#endif
#ifndef GLCD_E
#define GLCD_E PIN_A6 // Enable
#endif
#ifndef GLCD_RST
#define GLCD_RST PIN_A7 // Reset
#endif |
When executed, my LCD displays this:
Anything I'm doing wrong? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 17, 2009 6:36 pm |
|
|
Quote: | #FUSES NOWDT, XT, NOPUT, NOPROTECT, NOBROWNOUT, NOMCLR, NOLVP, NOCPD, INTRC |
You're using the XT and INTRC fuses. Those are contradictory.
You should only specify one oscillator fuse. It's best to put it as the
first fuse in the list because it's so important.
I assume you want the internal oscillator. To get the oscillator
pins A6 and A7 to work as normal i/o, you need to specify INTRC_IO. |
|
|
xbrav
Joined: 17 Feb 2009 Posts: 3
|
|
Posted: Tue Feb 17, 2009 6:42 pm |
|
|
Wonderful thank you! It works fully now |
|
|
|
|
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
|