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.
Hello To All People That Them Liking ((8051) . And So No Liking. My Name Is Mohsen Ilkhani (( Vahid Is My Nick Name )) And Looking For Good Friends All Of The Word. I Am Iranian Boy And ... My Enjoyement Is 8051,Hardware Designing And .... My Email Address Is v_Ilkhani@yahoo.com
"AND 4. a 232 interface chip such as the MAX232 to interface with the PC" Strictly, that is irrelevant to the 8051 UART - the UART just transmits a bitstream out of its Tx pin, and receives a bitstream on its Rx pin. Whether those bitstreams are on a direct connection to another chip, via an RS232 transceiver, via an RF link or whatever is entirely irrelevant to the operation of the UART. Of course, if you were foolish enough to connect RS232 signal levels (+/-12V) direct to an 8051 pin, you'd probably damage it...!
salman khan, Did you actually read Stefan's post of 1/23/03 3:45:18 which appears immediately above yours?
salam vahid, adrese khodet ra baraye man beferest. Ma bayad ba hamdigar tamase mostaghim dashte bashim. Shoma dar kodam shahr zendegi mikonid ? Kodahafez
I Am Iranian Boy And In This Country We Dont Have Enough Refrence Please Help Meeeee huh? If you have internet access, you can get almost any reference you could possibly require! What is your actual question?
I Am Iranian Boy And In This Country We Dont Have Enough Refrence Please Help Meeeee
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!
You use serial port as UART "9600" baud rate. then use c++ conio.h. function outp will sent data to com port of pc. by good lock
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!
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.
Sir, do you know how to handle 9 bit mode with visual basic?? thanx for your help
Sir can u please send me serial communication using 8051 and PC code, diagram and other useful information.Please thank u
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.
Take a look to the board schematics of a Keil MCB eval board (i.e. http://www.keil.com/mcb517). As a second step use the example programs that come with a Keil Eval Version (for example: ..\C51\Examples\Measure). When you do this together with Hyperterm you get an impression of what you need to do.
View all questions in Keil forum