Professional Documents
Culture Documents
Asynchronous Communication
In Asynchronous communication the sender and receiver decide a data rate before communication. They decide upon signaling used for start & stop of data transmission. Both sender & receiver use a precise timing reference internally to divide serial received data into bits.
start bit.
The last bit followed by data bits will always be 1(or 0) after which it requires start bit for transmission of next word. This bit is called stop bit
CTS
Clear To Send. Upon received RTS from DTE (PC), the modem (DCE) asserts CTS high whenever it is ready to receive data. Ring Indicator. It is set by modem to indicate the PC that a ringing signal has been detected on line.
RI
Writing a C Program to Send Serial Data to Micro-Controller for Motor Control #include <stdio.h>
#include <conio.h> #define PORT1 0x3F8 void main(void) { int c; outportb(PORT1+1,0);/* Turn off interrupts*/ /* of Port1 to use software testing mode*/ /* Now we set baud rate to 2400 bps */ outportb(PORT1+3,0x80); /* SET DLAB ON */ outportb(PORT1+0,0x30); /*Divisor Latch Low Byte */ outportb(PORT1 + 1 , 0x00); /*Divisor Latch High Byte */
outportb(PORT1+3,0x03); /* 8 Bits, No Parity, 1 Stop Bit */ printf("\n Motor Speed Control Program\n"); printf(" Enter 27 to quit \n"); do { printf("\n Please enter a number between 0 to 255 except 27 : "); scanf("%d",&c); printf("\n"); outportb(PORT1,c); /* Send the input number to Serial Port */ } while (c !=27); /* Quit when 27 is entered */ }