progccsc Guest
|
problem of RS232 (CCSC) |
Posted: Thu Apr 05, 2007 8:44 am |
|
|
I use this programme to receive 10 data from RS232 and then transmit all the data to PC(RS232). in the same time, affiche to LCD.
But there are always some problem.
if I transmit these data from PC:
30 31 32 33 34 35 36 37 38 39 0123456789
I will receive these data from PIC
39 38 3F 3E 3D 3C 3B 3A 39 38 60 FF 02 FF 00 01 98?>=<;:98`ÿ.ÿ..
FF 00 3C FF 00 38 FF 00 18 FF 40 FF 01 FF 03 FF ÿ.<ÿ.8ÿ..ÿ@ÿ.ÿ.ÿ
18 40 FF 20 FF A1 FF 18
Thanks first for all the helps coming....
#include <18F452>
#fuses HS, NOPROTECT, NOWDT, NODEBUG, NOLVP, PUT
#use delay(clock=20000000)
#use rs232(baud=115200,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=d)
#include <LCD_.c>
void main()
{
int8 data[10],i;
lcd_init();
printf(lcd_putc,"CCSC LCD");
for(i=0;i<10>=0;i--)
{
fputc(data[i],d);
lcd_gotoxy(1,2);
printf(lcd_putc,"%u",data[i]);
delay_ms(500);}
} |
|