20-04-2009, 03:51 PM
|
#9
|
Đệ tử 4 túi
Tham gia ngày: Dec 2008
Nơi Cư Ngụ: Hà Tĩnh - Hà Nội
Bài gửi: 61
:
|
Trích:
Nguyên văn bởi cskiller
Trong CCS C dùng nhiều software RS232
Code:
#use rs232(FORCE_SW, baud=9600, xmit=PIN_D0,rcv=PIN_D1, STREAM=ID1)
#use rs232(FORCE_SW, baud=9600, xmit=PIN_D2,rcv=PIN_D3, STREAM=ID2)
#use rs232(FORCE_SW, baud=9600, xmit=PIN_D4,rcv=PIN_D5, STREAM=ID3)
#use rs232(FORCE_SW, baud=9600, xmit=PIN_D6,rcv=PIN_D7, STREAM=ID4)
...
putc("C",ID1);
...
puts("Put data to software RS232 stream id 1",ID1);
...
getc(ID1); //Get data from software RS232 stream id 1
...
gets(buff,ID1); //Get data from software RS232 stream id 1
...
fprintf(ID1,"String formated to software RS232 stream id 1");
|
Cảm ơn bạn, mình đã hiểu rồi, nhưng mà nếu mình dùng một rs232 sẵn có của phần cứng và một rs232 bằng phần mềm có đc ko bạn?
|
|
|