![]() |
|
Tài trợ cho PIC Vietnam |
English forum on PICs Forum for foreigners -only English in this forum - Do not need to register or login |
![]() |
|
Ðiều Chỉnh | Xếp Bài |
|
![]() |
#1 | |
Đệ tử 5 túi
Tham gia ngày: Oct 2005
Bài gửi: 117
: |
Trích:
Syntax: #use rs232 (options) Elements: Options are separated by commas and may be: STREAM=id Associates a stream identifier with this RS232 port. The identifier may then be used in functions like fputc. BAUD=x >> Set baud rate to x XMIT=pin >> Set transmit pin RCV=pin >> Set receive pin FORCE_SW >> Will generate software serial I/O routines even when the UART pins are specified. Example: #use rs232(Stream = HWRS232,9600,xmit = PIN_C6,rcv = PIN_C7) // #1 HW #use rs232(Stream = SWRS232_1,9600,xmit = PIN_B0,rcv = PIN_B1) // #2 #use rs232(Stream = SWRS232_2,9600,xmit = PIN_B2,rcv = PIN_B3) // #3 #use rs232(Stream = SWRS232_3,9600,xmit = PIN_B4,rcv = PIN_B5) // #4 /* In your program, when you want to send some data to your specification rs232 port, use function fputc(), fgetc(), fprintf() */ fprintf(HWRS232,"This is 1st 232 Port"); fprintf(SWRS232_1,"This is 2st 232 Port"); fprintf(SWRS232_2,"This is 3st 232 Port"); fprintf(SWRS232_3,"This is 4st 232 Port"); I used this method for my project, expand from 1 RS232 port to 4 RS232 port using PIC16F876A. For the successfull with this, please refer to HELP of CCS to get more informations. Good luck.
__________________
CallerID, Ethernet-RS232, PICWEB, Cảnh báo BTS Giải pháp toàn diện giám sát - điều khiển từ xa qua GSM/Internet 0988006696 http://linhnc308.blogspot.com linhnc308@gmail.com |
|
![]() |
![]() |
![]() |
|
|