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

Can't change port data in glcd.c

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



Joined: 18 May 2009
Posts: 8
Location: Việt Nam

View user's profile Send private message

Can't change port data in glcd.c
PostPosted: Sun Apr 25, 2010 6:50 am     Reply with quote

I tried but I can't change port data in GLCD.C. Could you help me? Thank!
nhamdtk4



Joined: 18 May 2009
Posts: 8
Location: Việt Nam

View user's profile Send private message

PostPosted: Tue May 04, 2010 6:19 pm     Reply with quote

Could you help me. please!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 04, 2010 7:10 pm     Reply with quote

Explain your problem in detail. No one replied, because we don't know
what you mean by "can't change port data in GLCD.c".

Do you mean that you want to change the default PIC pins that are used
for the GLCD to some other pins ? If so, tell us what new pins you want
to use.
nhamdtk4



Joined: 18 May 2009
Posts: 8
Location: Việt Nam

View user's profile Send private message

PostPosted: Wed May 05, 2010 7:30 am     Reply with quote

Yes, thank PCM programmer very much (my english is too bad, i'm sorry). I want to use portB (or other ports) is data port.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed May 05, 2010 11:39 am     Reply with quote

To change the data port for GLCD.c to PortB, you need to edit the lines
shown in bold below, and change the "_d" to "_b" in each case.
Quote:

void glcd_writeByte(char chip, BYTE data)
{
.
.
.
output_d(data); // Put the data on the port
.
.
.
}


Note that the following routine has two lines that must be edited:
Quote:

BYTE glcd_readByte(BYTE chip)
{
.
.
.
input_d(); // Set port d to input
.
.
.
data = input_d(); // Get the data from the display's output
.
.
.
}


Also note that at the top of the GLCD.c file, it lists the PIC pins for the
control signals (such as GLCD_CS1, etc). Most of these control signals
are assigned to PortB. You need to change them to use pins on a
different port. You can't have the GLCD data port and the control
signals on the same port. They must be on different ports.
nhamdtk4



Joined: 18 May 2009
Posts: 8
Location: Việt Nam

View user's profile Send private message

PostPosted: Wed May 05, 2010 6:32 pm     Reply with quote

Thank you very much!
chuot chui



Joined: 19 Jul 2011
Posts: 2

View user's profile Send private message

i can't do it
PostPosted: Tue Jul 19, 2011 2:33 am     Reply with quote

i have changed data port(port b) and control pins but the simulation not work!! Please tell me why?
temtronic



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

View user's profile Send private message

PostPosted: Tue Jul 19, 2011 4:48 am     Reply with quote

Well now the bad part of your problem.
You tell us you're using a simulator( Proteus ?) NOT real hardware.
Should have told us that in the first message.
It is full of bugs, errors and other problems and cannot be solved here.Best to ask in the simulator's manufacturers 'support' forum, if one exists.
When you have real hardware,show us your code,PIC type, compiler version and we're then able to help.
chuot chui



Joined: 19 Jul 2011
Posts: 2

View user's profile Send private message

PostPosted: Tue Jul 19, 2011 11:53 am     Reply with quote

I'm using Proteus not real hardware. My code is very simple. I use PIC 16c77 and GLCD to display my name using CCS 's library (graphics.c and HDM64GS12.c). I changed control port and data port but it didn't work
dataport : port_b
CS1 : RD7
CS2 : RD6
RS : RD5
DI : RC7
RW : RC6
E : RC5
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