View previous topic :: View next topic |
Author |
Message |
jelodavid
Joined: 03 Apr 2005 Posts: 22 Location: Laguna Philippines
|
rs232 samples |
Posted: Sat Apr 09, 2005 11:30 pm |
|
|
hello everyone!
May I ask a simple "Hello World" program that will be send from hyperterminal via rs232 and then displayed on 2x16 LCD... i'll be using PIC16F876 and pcwh IDE ver3.40. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Apr 10, 2005 1:28 pm |
|
|
The code on that thread is too complicated for a newbie. The code
below matches his request better, and is also simple enough for him
to understand.
Code: | #include <16F876.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#define use_portb_lcd TRUE // LCD is on port B
#include <lcd.c>
void main()
{
char c;
lcd_init();
while(1)
{
c = getc(); // Get a char from the PC
lcd_putc(c); // Display it on the LCD
}
} |
|
|
|
jelodavid
Joined: 03 Apr 2005 Posts: 22 Location: Laguna Philippines
|
|
Posted: Sun Apr 10, 2005 4:20 pm |
|
|
thank you for very big help.........mabuhay! |
|
|
|