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

Changing Ports on LCD420

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







Changing Ports on LCD420
PostPosted: Tue Mar 21, 2006 6:57 pm     Reply with quote

I want to modify LCD420.c to use port F instead of port C for the PIC18F8722. Here is the structure in which port B is defined/used:


#byte lcd = 6 // This puts the entire structure
// on to port B (at address 6)

BYTE lcd_read_byte() {
BYTE low,high;

set_tris_b(LCD_READ);
lcd.rw = 1;
delay_cycles(1);
lcd.enable = 1;
delay_cycles(1);
high = lcd.data;
lcd.enable = 0;
delay_cycles(1);
lcd.enable = 1;
delay_us(1);
low = lcd.data;
lcd.enable = 0;
set_tris_b(LCD_WRITE);
return( (high<<4) | low);
}
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Mar 21, 2006 11:45 pm     Reply with quote

Hint #1 read this

#byte lcd = 6 // This puts the entire structure
// on to port B (at address 6)

and now go read the datasheet to find out what portf is on your PIC.

Hint #2
set_tris_b(LCD_READ);

you said move it from b->f. Take a guess at what the above line should read.
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