hello everyone, i have some question i wanna ask....btw can i use RS232 connection to communicate with non-PC system (ex microcontroller and CMUcam), and if it can, what do i need to make that connection work??
thx 4 answering :D
Wiki RS-232 is a good starting point for learning about RS-232 communications.
Yes, you can use RS-232 for lots of device to device communications.
Note that RS-232 refers to the signals used for the transmission.
RS-232 uses a bi-polar signaling voltage.
Logic 1 = -3 to -15 volts.
Logic 0 = +3 to +15 volts.
In theory, the -3 to + 3 voltage range is not defined / invalid.
In practice, to save money, many lap tops and other devices cheated on the spec, and use 0 volts as a Logic 0, and +5V as a Logic 1. This avoids the requirement for a bi-polar power supply.
The typical micro UART puts out logic level, (e.g. 0V / 5V), serial communications.
One feeds this into a Max232 chip, or equivalent, to convert it to an RS-232 (bi-polar) signal, for transmission over a three wire cable, (TxD to RxD, RxD to TxD, and Gnd to Gnd).
The Baud Rate and the Data Format must also be decided upon, and the devices at both ends need to use the same parameters, (e.g. Baud Rate 9600, Format N81 No Parity, 8 data bits, 1 stop bit, (1 start bit assumed)).
Note that there are expected tolerances for the baud rate, and a non-calibrated AVR Mega or Tiny can be out of spec in this regard, (but in spec for the uC per its data sheet). One can calibrate the internal RC oscillator, (clock), or use an external Crystal, or an external clock source, to make sure the UART is transmitting at the correct rate. The AVR XMegas have an internal RC Osc which is of a tigher tolerance than the others, and can be used for serial communications using RS-232 without special calibration or using an external Crystal or clock source.
Hope this helps to get you started.
thanks for the brief explanation...
but is it ideal for a microcontroller (ATMEGA for example) to connect to non-PC devices (for example like CMUcam or mcu board)using RS232 instead of using TTL connection?
thx again for the answer :D
UART has TTL level and RS232 level. If you dont need to communicate to your PC, you can use TTL level (as most devices just use TTL). If both your uC and the devices you connect to are using TTL UART, then you dont have to convert to RS232 unless you need longer transmission distance.
It is not ideal or not, just can it solve your problem or not....
I'm happy ytd, today, and tmr :)
hmmm thanks again for the answers....
btw, what IC do i have to use to make that connection (connect using RS232 from mcu to non-PC devices/other mcus) work, anyway?
One feeds this into a Max232 chip, or equivalent
A few more comments..
1. What data rate do you need to send? What is the distance? In embedded systems you need to determine if you have enough processor time to handle the data rate or use a UART that has a FIFO buffer so you can service it less often but still get all you data.
As for connections, you can use RJ11 style connectors and the flat cable made for those. Cheap and you can get the tools to crimp the connector on at Radio Shack or Mouser.
Remember that the TX signal from one device goes to the RX input on the other end and vice versa.
© 2022 Microchip Technology Inc.