680 likes | 813 Views
TECHKRITI LECTURE SERIES. Communication BY: Ashutosh Kumar. C ommunication. Telephones and Cell Phones. Scope of Communication. Internet. Scope of Communication. Wireless networks. Scope of Communication. Satellite Networks. Scope of Communication. Essentials of Communication.
E N D
TECHKRITI LECTURE SERIES Communication BY: Ashutosh Kumar
Telephones and Cell Phones Scope of Communication
Internet Scope of Communication
Wireless networks Scope of Communication
Satellite Networks Scope of Communication
Essentials of Communication But this simple model requires many guarantees. Sender Communication Link Receiver Data
Guarantees in Communications • The communication link exists. • The communication link is sound. • The sender and receiver are the correct nodes. • The sender is sending the correct data. • The receiver is able to correctly interpret the incoming data.
Protocols in Communication • The standard rules that defines the parameters of communications and ensures these guarantees are called protocol.
Advantages of Protocols • Standardized, so interoperability is ensured. • Usually include error-detection and error-correction mechanisms. • Are available as implemented chips that can be directly used.
Types of Protocols • There are different ways of categorizing protocols • First Categorization : • Second Categorization : Serial Mode Transfer Parallel Mode Transfer Synchronous Mode Transfer Asynchronous Mode Transfer
Serial and Parallel Mode SENDER PARALLEL MODE SERIAL MODE RECIEVER
Serial Vs Parallel Mode Parameter Reliability Speed Power Cost Complexity Range Serial Mode Parallel Mode Reliable Unreliable Slow Fast Low High Low High High Low Long Short Serialiser/Deserialiser
Synchronous and Asynchronous Mode • Pertains to sender-receiver synchronization. • Sender sends data at a certain speed. For flexibility, protocols allow for multiple speeds.
Need of Synchronization T T/2 1 1 1 1 1 1 1 1 1 1 1 1 RECEIVER SENDER 0 0 0 0 0 0 0 0 0 Suppose Sender sends data with a Time Period of T What if Receiver doesn’t know the speed and assume it to be say T/2 The Data received will be
Synchronous Mode • Sender sends a clock signal along with data at every rising / falling edge of the clock, the data value is read by the receiver. SENDER 1 0 1 0 SENDER CLOCK 0 1 0 1 RECIEVER
Asynchronous Mode • There is no clock signal. • The receiver and the sender communicate at a predetermined speed (bauds or bits per second). • Baud Rate : Baud Rate is a measurement of transmission speed in asynchronous communication. The devices that allows communication must all agree on a single speed of information 'bits per second'.
Synchronous Vs Asynchronous Mode Parameter Reliability Cost Complexity SynchronousAsynchronous Reliable Error Prone Expensive Inexpensive Complicated Simple
Transmission Modes SENDER RECIEVER Simplex Only one way transmission takes place
Transmission Modes SENDER RECIEVER Half-Duplex Two way transmission takes place but only one end can communicate at a time
Transmission Modes SENDER RECIEVER Full-Duplex Two way transmission takes place and both end can communicate simultaneously
popular serial communication standards RS-232 (using UART) Serial peripheral interface (SPI) System management bus (SMBus) Serial ATA (SATA) UART: Universal asynchronous receiver/transmitter
Asynchronous Serial Communication Terms • Start bit—indicates the beginning of the data word • Stop bit—indicates the end of the data word • Parity bit—added for error detection (optional) • Data bits—the actual data to be transmitted • Baud rate—the bit rate of the serial port • Throughput—actual data transmitted per sec (total bits transmitted-overhead) • Example: 115200 baud = 115200 bits/sec • If using 8-bit data, 1 start, 1 stop, and no parity bits, the effective throughput is: 115200 * 8 / 10 = 92160 bits/sec
Asynchronous Serial Communication • Serial communication implies sending data bit by bit over a single wire • Asynchronous transmission is easy to implement but less efficient as it requires an extra 2-3 control bits for every 8 data bits. • This method is usually used for low volume transmission
Connections Device1 RX TX GND TX Device2 RX GND
ERROR DETECTION • •Parity bit is HIGH when number of 1’s in the Data is odd. • •Respectively, it is LOW when number of 1’s in the Data is even
CODING Two simple commands : • putchar(char); sends 8-bit characters through UART • getchar(); receives 8-bit characters via UART
WHAT is a X-BEE XBee is the brand name from Digi International for a family of form factor compatible radio modules.
How does the XBee work / how to control it? • Every XBee works as a wireless serial connection (or -network) and can be used like a normal COM port. • You can easily hook up the XBee to a laptop or an arduino and you can send and receive data over long range. In fact, the only thing you need to do is connect power and connect one wire to the XBee for data receive or data send (or two if you want both).
How to configure XBee using X-CTU? • XCTU is a small utility program written by Digi/Maxstream. • You can download this utility from the Digi website, www.Digi.com , under Supports/Drivers. • Download the latest drivers onto you PC.
How to program a XBee • Connect the Xbee to the usb wireless module or the breakout board or Xbee Explorer. • Connect the board to the PC/laptop. • Open X-CTU. • And select PC Settings Tab from the Tabs Menu on the top of the page.
QUERY Select USB COMM. Port to the value of A-B Cable, display in the Device Manager setting. Set the setting to the values of A-B Cable. Click the Test/Query button If the Com test / Query Modem dialogue appear with an error message: Check if you have set the baud rate, flow control, data bits, parity and stops bits in the dialogue same as the Cable settings. If everything goes well, you will see the dialogue displayed as in step 4 in the picture below. You should take note of the firmware version displayed in the dialogue. This is important for upgrading your firmware later. Then click OK.
Now, let's move on to do the configuration on the XBee. 1. Select the Modem Configuration Tab on the Main Tab Menu. 2. Click Read button, if this is your first time running the XCTU software, you will see the Question dialogue appear, and it asks if you want to update the configuration files, which is recommended. 3. If you click Yes button, You will see the Get new versions dialogue pop up
1. Then click the Web/file button. XCTU will start loading all the available firmware to your PC. 2. When XCTU is done with uploading, click the Done button. The Update Summary dialogue will pop up, displaying all the firmware for the XBee module. 3. Click OK.
Baud Rate 1. With the Modem Configuration Tab Menu still selected, 2. click the Read button again. You will see all the current settings show up in the display area. 3. Scroll down to find Serial Interfacing folder. 4. Change the baudrate to 57600 bit/s. (This is the prefered value we are using .You can use any value you like.) 5. Click the Write button, (the one next to Read button), to save the setting.
PAN ID • To set the PAN ID or Personnal Area Network ID, which is the unique number to assign to XBee so XBee can talk to the right Xbee in the same Network Area. • For example, if you are building a robot, and using only two XBees to communicate to each other, and you may want to avoid others that also using XBees for communication to be in the same Network Area. • You can specify any number from 0000 to FFFF for your PANID. The factory PANID default value is 3332. • 1. Still select the Modem Configuration Tab, • 2. scroll up to the top of display area, • 3. Click at the PAN ID to change the value. • 4. Then click the Write button again to save the • PAN ID setting to the XBee flash memory.
Ready to use • Now, you are set, the XBee modem is ready to use. • If you have another XBee, you can repeat the steps to configure the modem. • You are now ready to move to the next step for upgrading the firmware. • In case, you want to update your XBee firmware without using the XCTU utility program, you can use the Terminal program to do that as well.