View previous topic :: View next topic |
Author |
Message |
Guest
|
Communicating with an LCD |
Posted: Mon Feb 22, 2010 6:15 pm |
|
|
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: 1934 Location: Norman, OK
|
|
Posted: Mon Feb 22, 2010 7:19 pm |
|
|
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
|
|
Posted: Tue Feb 23, 2010 1:24 am |
|
|
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.
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
|
|
Posted: Tue Feb 23, 2010 1:55 am |
|
|
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
|
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Tue Feb 23, 2010 3:18 am |
|
|
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 |
|
|
|