fredelek59
Joined: 09 Jun 2010 Posts: 3 Location: dunkerque, france
|
playing with serlcd |
Posted: Wed Dec 01, 2010 2:47 am |
|
|
hi everyone !!
I'm playing with this little code for a serial lcd from Sparkfun.
Everything is ok but when I connect the data wire on pin_c5 nothing appear....
My configuration is working on different pin like c0 or a0. But in my future project it must be on pin c5 !
Did I miss something ? or c5 is burned ?
Regards.
Here is the so little code :
Code: |
/////////////////////////////////////////////////////////////////////////
//// SERIALLCD.C ////
//// ////
//// This program will show how to use the serlcd with ////
//// hex special command clear screen ////
//// ////
//// Configure the CCS prototype card as follows: ////
//// Connect serlcd rx pin to pic pin_c5 ////
//// Connect Rs232 from rs232 as usued to c6 xmit & c7 rcv ////
//// plug serlcd data wire to c7 to take order from your pc
//// plug serlcd wire to c6 to see pc data line
//// plug serlcd wire to xx(here c5) to see lcd data line
////
/////////////////////////////////////////////////////////////////////////
#include <18F2550.h>
//#include <serLCD.c>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)
#use rs232(stream=PC, baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#use rs232(stream=serLCD, baud=9600, xmit=PIN_c5, ERRORS)//configuration of your tx :D
//#include <serLCD.c>
/****************************** MAIN ******************************************/
void main(){
int8 tartenpion=0xff;
while(TRUE)
{
fprintf(pc," %x ",tartenpion);
delay_ms(1000);
Fprintf(PC,"hello pc here is 18f2250,38400,38400 "); //comunicate with pc line
tartenpion=get_tris_c();
Fprintf(serLCD,"LCD");
delay_ms(1500);
}
}
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Dec 01, 2010 1:19 pm |
|
|
Sparkfun must have at least 15 "serial enabled" lcds. How do you expect
us to know which one you have ? Also, they have a forum. I would first
look there for tips on how to make it work.
But, you will never make pin C5 work as an output pin. The 18F2550
data sheet says it's a "digital input only" pin. |
|