Realbasic Serial Communication Cable

суббота 07 мартаadmin

Shop a wide variety of Serial Adapter and Extension Cables from StarTect, Belkin and more! Newegg offers the best prices, shipping and customer service! Test communication availability, it will probably also set the DTR output to indicate its own state. This is true for at least 99% of all serial communication software. This implies that at least 99% of all serial communication software is capable of faking its own DSR check with this null modem cable. The same trick is used with the CTS input.

RS Serial Communication Basics. Firewire RS 232 is well-known due to popularity oftoday's PC's. However, as it is designed in 1950's, DTE and DCE becamemind-boggling names now. As far as I know, the serial port of my laptop is amale socket and so, it must be a DTE.So, it's straight forward that those two sockets(mail and female) could be connected by a straight cable ( in which pin1 to pin1, pin2 to pin2. And pin 9 to pin 9).

In that way, one end's RTS and theother's CTS is in the same wire. TD and RD are also in such a case.& RS-422So, what is the main difference between RS 232and RS 422 & 485? The RS 232 signals are represented by voltage levels withrespect to ground.

There is a wire for each signal, together with the groundsignal (reference for voltage levels). This interface is useful forpoint-to-point communication at slow speeds. For example, port COM1 in a PC canbe used for a mouse, port COM2 for a modem, etc. This is an example ofpoint-to-point communication: one port, one device. Due to the way the signalsare connected, a common ground is required.

This implies limited cable length -about 30 to 60 meters maximum. (Main problems are interference and resistance ofthe cable.) Shortly, RS 232 was designed for communication of local devices, andsupports one transmitter and one receiver.RS 422 & 485 uses a different principle: Eachsignal uses one twistedpair (TP) line - two wires twisted around themselves.We're talking 'Balanced data transmission', or 'Differential voltagetransmission'. Simply, let's label one of the TP wires 'A' and the other one'B'. Then, the signal is inactive when the voltage at A is negative and thevoltage at B is positive. Otherwise, the signal is active, A is positive and Bis negative.

Of course, the difference between the wires A and B matters. For RS422 & 485 the cable can be up to 1200 meters (4000 feet) long, and commonlyavailable circuits work at 2.5 MB/s transfer rate.What is the difference between RS 422 and RS485? Electrical principle is the same: both use differential transmitters withalternating voltages 0 and 5V. However, RS 422 is intended for point-to-pointcommunications, like RS 232. RS 422 uses two separate TP wires, data can betransferred in both directions simultaneously. RS 422 is often used to extend aRS 232 line, or in industrial environments.RS 485 is used for multipoint communications:more devices may be connected to a single signal cable - similar to e.g.ETHERNET networks, which use coaxial cable.

Most RS 485 systems use Master/Slavearchitecture, where each slave unit has its unique address and responds only topackets addressed to this unit. These packets are generated by Master (e.g. PC),which periodically polls all connected slave units.( Ethernet 802.3)RJ-45 connector is widely used to connectcomputers in a Ethernet, and to hub (layer1 device), bridges and switches(layer 2device) and routers (layer 3). In 10base-T, pin 1and 2 are used for TXand 3-6 are for Rx. Differential signals are used.

That's why we need a pair ofwires for one direction.Use only four of the eight pins. Pins 1 and 2 must be a pair, and pins 3 and6 must be a pair. Function Pin# Pin#-TX+ 1 1TX- 2 2RX+ 3 3RX- 6 6-STRAIGHT THOUGH CABLETo allow for a straight-through cable, the hubprovides an internal transmit/receive crossover function.

Thank you!Donna ThompsonI was a little skeptical (okay, a lot skeptical actually) but I figured I’d give the service a try (for $7.99 it seemed like an affordable gamble - and being the instant gratification junkie that I am decided to pay up rather than wade through the offers). Free locking software. I give it 10/10. Easy to use, prompt and totally awesome.

This means thetransmit circuit of the network adapter is connected to the receive circuit ofthe hub and vice versa.Pinout for the RJ45 Connector PINOUT FOR RJ45 CABLE CONNECTOR:- -1 - 8 - 2 - 7 - 3 -6 - 4 - 5 - 5 - 4 - 6 -3 - 7 - 2 - 8 - 1 -END TOPPin Name And Function. Transmit Data Plus. The positive signal forthe TD differential pair. This signal contains the serial output data streamtransmitted onto the network. Transmit Data Minus. The negative signal forthe TD differential pair. This contains the same output as pin 1.

Receive Data Plus. The positive signal forthe RD differential pair. This signal contains the serial input data streamreceived from the network. not connected. not connected.

Receive data minus. The negative signal forthe RD differential pair. This signal contains the same input as pin 3. not connected.

not connectedA detailed graph for coloring scheme (EIA-568)is:Why the Gigabit Ethernet need all 8 pins? It isbecause it use 4 pairs (each transmits 250Mbps duplex) of wires. So, it issomewhat like parallel transmissions. The 250Mbps speed is realized by use5-level signaling which has a 6db less than 3-level signaling used in 100MEthernet. However, this will be compensated by an FEC scheme which resides uponthis PHY layer. Seems, only very short distance (25-100m) can be supported inthis kind of wiring and a common ground has to be assumed.Why it is null-modem?

Because, when PC connectsto a modem, PC is a DTE, and modem is DCE. When Modem is null, we have toconnect 2 DTEs. The purpose of a null-modem cable is to permit two RS-232 'DTE'devices to communicate with each other without modems or other communicationdevices (i.e., 'DCE's) between them. It is as same as a cross-overcable linking 2 serial ports of computers.

2 female sockets in both ends of theline.To achieve this, the most obviousconnection is that the TD signal of one device must be connected to the RD inputof the other device (and vice versa).Use this female-to-female cable in anyapplication where you wish to connect two DTE devices (for example, twocomputers). A male-to-male equivalent of this cable would be used to connect twoDCE devices.For input devices like keyboards and mouse, PS/2is not compatible with RS-232 ( think a mouse who connected to the serial portof some old workstations ). It has 6 pins which only has 4 functional pins: DATA, Ground, VCC and clock.The PS/2 mouse and keyboard implement abidirectional synchronous serial protocol. The bus is 'idle' when both linesare high (open-collector). This is the only state where the keyboard/mouse isallowed begin transmitting data. The host has ultimate control over the bus andmay inhibit communication at any time by pulling the Clock line low.The device always generates the clock signal.If the host wants to send data, it must first inhibit communication from thedevice by pulling Clock low.

The host then pulls Data low and releases Clock.This is the 'Request-to-Send' state and signals the device to start generatingclock pulses.Summary: Bus StatesData = high, Clock = high: Idle state.Data = high, Clock = low: Communication Inhibited.Data = low, Clock = high: Host Request-to-SendAll data is transmitted one byte at a time andeach byte is sent in a frame consisting of 11-12 bits. These bits are:.

1 start bit. This is always 0. 8 data bits, least significant bit first. 1 parity bit (odd parity). 1 stop bit. This is always 1. 1 acknowledge bit (host-to-devicecommunication only)The parity bit is set if there is an even numberof 1's in the data bits and reset (0) if there is an odd number of 1's in thedata bits.

The number of 1's in the data bits plus the parity bit always add upto an odd number (odd parity.) This is used for error detection. Thekeyboard/mouse must check this bit and if incorrect it should respond as if ithad received an invalid command.Data sent from the device to the host is read onthe falling edge of the clock signal; data sent from the host to thedevice is read on the rising edge. The clock frequency must be inthe range 10 - 16.7 kHz. This means clock must be high for 30 - 50 microsecondsand low for 30 - 50 microseconds. If you're designing a keyboard, mouse, orhost emulator, you should modify/sample the Data line in the middle of eachcell. 15 - 25 microseconds after the appropriate clock transition.Again, the keyboard/mouse always generates the clock signal, but the hostalways has ultimate control over communication.

Timing is absolutely crucial.For very short distance, less than 5m, ahigh-speed serial transmission up to 480Mbps is possible. The USB cable has 2type, Socket A is connect to computers (hosts) for upstream traffic and B isconnect to device (digital cameras, etc) for downstream traffic.Tr ansmission Process:When the host powersup, it queries all of the devices connected to the bus and assigns each one anaddress. This process is called enumeration - devices are alsoenumerated when they connect to the bus.

The host also finds out from eachdevice what type of data transfer it wishes to perform:. Interrupt - A device like a mouse or a, whichwill be sending very little data, would choose the interrupt mode. Bulk - A device like a printer, whichreceives data in one big packet, uses the bulk transfer mode. A block of datais sent to the printer (in 64-byte chunks) and verified to make sure it iscorrect. Isochronous - A streaming device (suchas ) usesthe isochronous mode. Data streams between the device and the host inreal-time, and there is no error correction.The host can also send commands or queryparameters with control packets.As devices are enumerated, the host is keepingtrack of the total bandwidth that all of the isochronous and interrupt devicesare requesting. They can consume up to 90 percent of the 480 Mbps of bandwidththat is available.

After 90 percent is used up, the host denies access to anyother isochronous or interrupt devices. Control packets and packets for bulktransfers use any bandwidth left over (at least 10 percent).The Universal Serial Bus divides the availablebandwidth into frames, and the host controls the frames. Frames contain1,500 bytes, and a new frame starts every millisecond. During a frame,isochronous and interrupt devices get a slot so they are guaranteed thebandwidth they need. Bulk and control transfers use whatever space is left. Thetechnical links at the end of the article contain lots of detail if you wouldlike to learn more.FirewireConvertersReference Link:. writings are including excerpts from otheronline tutorials.

Serial Communication – IntroductionHey folks! It’s now time for one of the most desired tutorials on maxEmbedded – the Serial Communication series! In these series, we will discuss the basic concepts of serial communication; the loopback test, the USART/UART of AVR and then we will proceed towards implementing the SPI and I2C in AVR.This post will cover the basics of serial communication and will be mostly a theoretical topic. We will do some practical stuff from next tutorial onwards. Lets have a glance at the contents. Contents.What is Communication?Before we move on to serial communication, lets discuss a bit about communication in general.

In simple terms, communication is an exchange of ideas between two individuals. Ideas can be anything and in any form – they could be written/spoken words, in form of media like audio/video, or if you like sci-fi, then it can also in form of telepathy!;)But what does communication between two microcontrollers mean? An exchange of data (bits)! There are many protocols for communication (which would be discussed later) but all of them are based on either serial communication or parallel communication.Why do we need Communication?Lets take an example.

As kids, we all must have played with those remote controlled toy cars and airplanes. It was pretty fun and fascinating at that time. I am sure that most of us at that time didn’t try to figure out how it was possible! How could the remote control device in your hand control the car or the aeroplane?

Well, of course, the device in your hand sends some data, which is received by the car/aeroplane. There is a microcontroller onboard the toy, which interprets the signals and acts accordingly.

So far so good, but now it doesn’t end here. As grown ups, there are a few more questions which should arise!

Like how does the device send the signal? From where is the signal being sent?

What is actually being sent? Who receives it? How is it processed?Lets take another example. This one’s a more common example. You have a file in your mobile and you would like to share it with your friend who is sitting next to you?

How would you do it – Bluetooth, IR, NFC, LAN or email? Mostly people would use Bluetooth. IR is obsolete, NFC is still in developmental phase and isn’t available in most devices, LAN needs a WiFi/LAN network whereas email requires an active Internet connection. The same questions can be put forth here as well – how is it send, from where is it sent and to where, what is being sent and how is it processed?!Well, this is why communication is required!

And to answer all those questions, several communication protocols have been developed! Now lets discuss a little about serial and parallel communication.Serial Communication. Parallel TransferParallel communication is the process of sending/receiving multiple data bits at a time through parallel channels. It is like you are firing using a shotgun to a target – where multiple bullets are fired from the same gun at a time!;)Serial vs Parallel CommunicationNow lets have a quick look at the differences between the two types of communications. Serial CommunicationParallel Communication1. One data bit is transceived at a time1.

Multiple data bits are transceived at a time2. Less number of cables required to transmit data3. Higher number of cables required.

Serial vs ParallelSo these were the basic differences between serial and parallel communication. From the above differences, one would obviously think that parallel communication is far better than serial communication. But wait, these are just the basic differences. Before we proceed further, we need to be acquainted with a few terminologies:. Bit Rate: It is the number of bits that are transmitted (sent/received) per unit time. Clock Skew: In a parallel circuit, clock skew is the time difference in the arrival of two sequentially adjacent registers. To explain it further, let us take the machine gun example again.

When, say around 5 people are firing at the same time, there is bound to be a time difference in the arrival of the bullet from the first shooter and that from the second shooter and so on. This time difference is what we call clock skew. This is better illustrated in the picture below: There is a time lag in the data bits through different channels of the same bus. Clock skew is inevitable due to differences in physical conditions of the channels, like temperature, resistance, path length, etc. Crosstalk: Phenomenon by which a signal transmitted on one channel of a transmission bus creates an undesired effect in another channel. Undesired capacitive, inductive, or conductive coupling is usually what is called crosstalk, from one circuit, part of a circuit, or channel, to another. It can be seen from the following diagram that clock skew and crosstalk are inevitable.Major Factors Limiting Parallel CommunicationBefore the development of high-speed serial technologies, the choice of parallel links over serial links was driven by these factors:. Speed: Superficially, the speed of a parallel link is equal to bit rate.number of channels.

In practice, clock skew reduces the speed of every link to the slowest of all of the links. Cable length: creates interference between the parallel lines, and the effect only magnifies with the length of the communication link. This limits the length of the communication cable that can be used.These two are the major factors, which limit the use of parallel communication.Advantages of Serial over ParallelAlthough a serial link may seem inferior to a parallel one, since it can transmit less data per clock cycle, it is often the case that serial links can be clocked considerably faster than parallel links in order to achieve a higher data rate. A number of factors allow serial to be clocked at a higher rate:.

Clock skew between different channels is not an issue (for un-clocked asynchronous serial communication links). A serial connection requires fewer interconnecting cables (e.g. Wires/fibers) and hence occupies less space. The extra space allows for better isolation of the channel from its surroundings. Crosstalk is not a much significant issue, because there are fewer conductors in proximity.In many cases, serial is a better option because it is cheaper to implement. Many ICs have serial interfaces, as opposed to parallel ones, so that they have fewer pins and are therefore less expensive. It is because of these factors, serial communication is preferred over parallel communication.How is Data sent Serially?Since we already know what are registers and data bits, we would now be talking in these terms only.

If not, I would recommend you to first take a detour and go through the introduction of by Mayank.When a particular data set is in the microcontroller, it is in parallel form, and any bit can be accessed irrespective of its bit number. When this data set is transferred into the output buffer to be transmitted, it is still in parallel form. This output buffer converts this data into Serial data ( PISO) ( Parallel In Serial Out), MSB ( Most Significant Bit) first or LSB ( Least Significant Bit) first as according to the protocol. Now this data is transmitted in Serial mode.When this data is received by another microcontroller in its receiver buffer, the receiver buffer converts it back into parallel data ( SIPO) ( Serial In Parallel Out) for further processing. The following diagram should make it clear. Data Transfer in Serial CommunicationThis is how serial communication works!

But it is not as simple as it looks. There is a catch in it, which we will discuss little later in the same post.

For now, lets discuss about two modes of serial data transfer – synchronous and asynchronous.Serial Transmission ModesSerial data can be transferred in two modes – asynchronous and synchronous.Asynchronous Data TransferData Transfer is called Asynchronous when data bits are not “synchronized” with a clock line, i.e. There is no clock line at all!Lets take an analogy. Blue break beats vol 2 rar.

Imagine you are playing a game with your friend where you have to throw colored balls (let’s say we have only two colors – red (R) and yellow (Y)). Lets assume you have unlimited number of balls.

You have to throw a combination of these colored balls to your friend. So you start throwing the balls. You throw R, then R, then Y, then R again and so on. So you start your sequence RRYR and then you end your round and start another round. How will your buddy on the other side know that you have finished sending him first round of balls and that you are already sending him the second round of balls??

He/she will be completely lost! How nice it would be if you both sit together and fix a protocol that each round consists of 8 balls! After every 8 balls, you will throw two R balls to ensure that your friend has caught up with you, and then you again start your second round of 8 balls. This is what we call asynchronous data transfer.Asynchronous data transfer has a protocol, which is usually as follows:. The first bit is always the START bit (which signifies the start of communication on the serial line), followed by DATA bits (usually 8-bits), followed by a STOP bit (which signals the end of data packet). There may be a Parity bit just before the STOP bit.

The Parity bit was earlier used for error checking, but is seldom used these days. The START bit is always low (0) while the STOP bit is always high (1).The following diagram explains it. Asynchronous Data Transfer Timing DiagramSynchronous Data TransferSynchronous data transfer is when the data bits are “synchronized” with a clock pulse.We will take the same analogy as before. You are still playing the throw-ball game, but this time, you have set a timer in your watch such that it beeps every minute.

You will not throw a ball unless you hear a beep from your watch. As soon as you hear a beep from your watch, you and your friend, both know that you are going to throw a ball to her. Both of you can keep a track of time using this; say you start a new round after every 8 beeps.

Isn’t it a much better approach? This approach is what we call synchronous data transfer.The concept for synchronous data transfer is simple, and as follows:. The basic principle is that data bit sampling (or in other words, say, ‘recording’) is done with respect to clock pluses, as you can see in the timing diagrams. Since data is sampled depending upon clock pulses, and since the clock sources are very reliable, so there is much less error in synchronous as compared to asynchronous. Synchronous Data Transfer Timing DiagramSerial Communication TerminologiesNow its time to learn about some new words, which we will use frequently in the next few posts. There are many terminologies, or ‘keywords’ associated with serial communication.

We will discuss all of them one by one:. MSB/LSB: this stands for Most Significant Bit (or Least Significant Bit). You can refer to Mayank’s post for more information on MSB and LSB. Since data is transferred bit-by-bit in serial communication, one needs to know which bit is sent out first: MSB or LSB. Simplex Communication: In this mode of serial communication, data can only be transferred from transmitter to receiver and not vice versa. Half Duplex Communication: this means that data transmission can occur in only one direction at a time, i.e.

Either from master to slave, or slave to master, but not both. Full Duplex Communication: full duplex communication means that data can be transmitted from the master to the slave, and from slave to the master as the same time! Types of Transmission.

Baud Rate: according to, baud is synonymous to symbols per second or pulses per second. It is the unit of symbol rate, also known as baud or modulation rate. However, though technically incorrect, in the case of modem manufacturers baud commonly refers to bits per second.Importance of Baud RateFor two microcontrollers to communicate serially they should have the same baud rate, else serial communication won’t work. This is because when you set a baud rate, you direct the microcontroller to transmit/receive the data at that particular rate.

So if you set different baud rates, then the receiver might miss out the bits the transmitter is sending (because it is configured to receive data and process it with a different speed!)Different baud rates are available for use. The most common ones are 2400, 4800, 9600, 19200, 38400 etc. You cannot choose any arbitrary baud rate, there are some fixed values which you must use like 2400, 4800, etc. Please note that the unit of baud rate is bps (bits per second).The Catch in Serial CommunicationNow it’s all clear to you. You have data. You decide how to send your data (synchronous/asynchronous).

Serial

You send your data by following proper protocols. The transmitter converts your parallel data to serial, sends it across the channel, then the receiver converts your serial data to parallel. But that’s not sufficient for a proper serial communication. There are two things which still needs to be taken care of:. Baud Rate: Unless the baud rate of both the transmitter and receiver are the same, serial communication cannot work. The reason is specified in the previous section.

Address: If you are trying to send multiple data together over the same channel and/or you are sharing the same channel space with other users sending their own data, then you need to take care to properly address your data. We won’t discuss about it in this post, but we will surely discuss about it in one of our upcoming posts.If you take care of these two factors, your serial communication will be established perfectly and your data will go through properly. These are the two main reasons for unsuccessful serial link.UART and USARTUART stands for Universal Asynchronous Receiver Transmitter, whereas USART stands for Universal Synchronous Asynchronous Receiver Transmitter.

They are basically just a piece of computer hardware that converts parallel data into serial data. The only difference between them is that UART supports only asynchronous mode, whereas USART supports both asynchronous and synchronous modes.

Unlike Ethernet, Firewire etc., there is no specific port for UART/USART. They are commonly used in conjugation with protocols like RS-232, RS-434 etc. (we have specific ports for these two!).In synchronous transmission, the clock data is recovered separately from the data stream and no start/stop bits are used.

USB Pins. RS-232 – Recommended Standard 232: The RS-232 is typically connected using a DB9 connector, which has 9 pins, out of which 5 are input, 3 are output, and one is Ground. You can still find this so-called “Serial” port in some old PCs. In our upcoming posts, we will discuss mainly about RS232 and USART of AVR microcontrollers.So that is it for now folks!

We will be discussing about RS-232 and its basics in the next post! Don’t forget to post your comments and questions down below! And yes, subscribe to maxEmbedded and stay tuned!:)Written By-Yash TambiVIT University, Velloretambi@maxEmbedded.comQC and Mentorship By-Mayank PrasadArizona State Universitymax@maxEmbedded.com.

Hello Sunil,You’ll need to encode the data somehow. You can use only one single transmitter to transmit data from six sources.

So you’ll have to figure out how you’re gonna go about that. You can transmit only one byte of data at a time, so may be you can use multiplexing. Or if something better strikes you, go with that!You’ll need only one timer to control multiple servos. The idea is to have a master timer and then wiggle the values of individual pins in order to generate the PWM output. The CPU won’t do it for you, you’ll have to do it manually. You might try using the Procyon AVR library.

It has a servo library which can control up to 8 RC servos. I haven’t used it, may be you could let me know if it works out for you or not! Keep me posted!