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

Communicating with an LCD

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








Communicating with an LCD
PostPosted: Mon Feb 22, 2010 6:15 pm     Reply with quote

My pic does not allow I2C or SPI communication, and it doesn't list anything else for communication either. What kind of LCD can I use with a pic that has no communication features? Does CCS allow me to use software based I2C communication?
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Feb 22, 2010 7:19 pm     Reply with quote

What model of PIC do you have that has no comms hardware at all?
_________________
Google and Forum Search are some of your best tools!!!!
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 23, 2010 1:24 am     Reply with quote

dyeatman wrote:
What model of PIC do you have that has no comms hardware at all
It could be one of the baseline PICs. But, yeah, you should always post your processor so that others on the forum know what you're working with. It's just one of those things that'll get you help faster. Very Happy

Quote:
Does CCS allow me to use software based I2C communication?
Yes it does. Go through the manual. You can even use a software UART.
Code:
#use spi
#use i2c
#use rs232


Rohit
Guest








PostPosted: Tue Feb 23, 2010 1:55 am     Reply with quote

it's a pretty common mcu, 16f684.

I tried using software i2c but I can't get it to display anything. When I use the following code, it says the identifiers are unidentified.

#use i2c(slave,sda=pin_c3,scl=pin_c4)

? it's something like that, but I don't have it in front of me. Then later in my code I use:

void i2cstart()
{
scl=1;
sda=1;
sda=0;
scl=1;
}

Do I need to add:

int1 sda;
int1 scl;

???
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 23, 2010 2:04 am     Reply with quote

Quote:

What kind of LCD can I use with a pic that has no communication features?

Use a standard 16x2 character LCD with an HD44780-compatible parallel
interface. This requires 6 or 7 general purpose I/O pins on the PIC.
No special communications module is needed. These LCDs are available
from most electronics parts suppliers. Example:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=67-1780-ND

Then use this software driver with your PIC to display characters on the LCD:
http://www.ccsinfo.com/forum/viewtopic.php?t=24661

More information:
http://www.geocities.com/dinceraydin/lcd/intro.htm
You don't really need most of the information on that page.
All you need is the driver in the link above.
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 23, 2010 3:18 am     Reply with quote

What sort of LCD do you have? A simple character LCD? Some character LCDs have a serial 'backpack' on them. This allows them to communicate using I2C, async-serial, SPI, and other serial protocols.

In case your LCD is a plain-jane character LCD, use PCM's link to get it to work.

Rohit
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