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

Odd output from KS0108

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



Joined: 17 Feb 2009
Posts: 3

View user's profile Send private message

Odd output from KS0108
PostPosted: Tue Feb 17, 2009 6:15 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 6:36 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 6:42 pm     Reply with quote

Wonderful thank you! It works fully now
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