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

Mapping an LCD to PORTA on a 18F2520 using #byte command...?

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







Mapping an LCD to PORTA on a 18F2520 using #byte command...?
PostPosted: Thu May 17, 2007 6:46 am     Reply with quote

Is there any reason why an LCD should not be overlayed to PORT A on a 18F2520?

In the driver file LCD.C, the LCD is always mapped to either PORT B or PORT D using the #byte lcd = 0xF81 or #byte lcd = 0xF83 command which I understand. I have succesfully mapped the LCD to PORT B on a 16F648 device, but now I want to map the LCD to PORT A on a 18F2520 device using #byte lcd = 0xF80; however I cannot get it to work....Any ideas - am I missing something?

Thanks,
Spero Colyvas
Ttelmah
Guest







PostPosted: Thu May 17, 2007 9:02 am     Reply with quote

Beware that the A4 line on many PIC's, does not have any drive 'upwards'. If used as an output, it needs a pull-up resistor added.

Best Wishes
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Thu May 17, 2007 9:17 am     Reply with quote

I map it like this

Code:
#define LCDPORT  PORTD
#define LCDTRIS  TRISD

struct lcd_pin_map
{
    unsigned char unused1:1;
    unsigned char rs:1;
    unsigned char rw:1;
    unsigned char en:1;
    unsigned char data:4;
}
lcdpin, lcdtris;
#locate lcdpin  = LCDPORT
#locate lcdtris = LCDTRIS
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