How can I using C Compiler in order to communication between 8051 with PC via serial port using RS232. I want to have an Example for Keil C for 8051 and an example Visual basic for Receive/transmitter on PC.Thank You very much.
For the 8051, grab my free UART driver at http://www.embeddedfw.com and then be sure it works with HyperTerm. Then pull up VB and drop a COMM object onto a form and configure it for the correct baud rate, etc.
Sir, do you know how to handle 9 bit mode with visual basic?? thanx for your help
The UART inside a PC is not well suited to receiving 9 bit mode. If you are receiving bytes slowly, you might be able to try setting the port to s81 mode ("space parity", 8 data, 1 stop), which might generate a parity error when the ninth bit is high, but you would have to detect and process this before the next data byte arrived (or you would not know which byte the error applied to), so the normal input buffering for VB would be useless. Responding to events in real time under Windows is not guaranteed either, so you might need to use something external to the PC to translate your data into standard 8 bit serial.
How can I using transmite and receive 8051 network via SN75176? I want to use bit SM2 for multiprocessor communication but difficult for me.Using serial interrupt to transmittion and Receive data. Help me!
Hmm, you know, UART of PC is able to support 11-bit mode without problems. We use such mode in our API, really (= For example, to send ninth bit as zero you should do next (here we define PORT value as 0x3F8 for COM1): _outp(PORT+3, (32+16+8+2+1)); //set mode: 8 data bits, 1 stop bit, parity bit always is zero _outp(PORT+0, data); //sending one start bit, 8 data bits, parity bit as 0 and one stop bit To send ninth bit as 1 do next: _outp(PORT+3, (32+8+2+1)); // parity bit always is 1 _outp(PORT+0, data); To read COM port with 11-bit mode you should use next routine: int ReadByte (unsigned int time_out) { unsigned int data, timeout = time_out; unsigned char status; _outp(PORT+3, (32+8+2+1)); // wait for parity bit as 1 while (! ((status = _inp(PORT+5)) & 1)) { if (! timeout--) return (-1); // timeout } data = (int)_inp(PORT+0); if (status & 8) return (-2); // frame error if (!(status & 4)) data += 256; return (data); // ninth bit of data is TB8 } Btw, it is only example; we use different routine (based on COM interrupt). Anyway these examples are worked; we tested it on Win98 with 115200 baudrate. Good days!