1 / 24

Communications How to get something to almost talk to something else

Communications How to get something to almost talk to something else. Raffi Krikorian MAS.863 1 December 2003. Getting stuff from A to B. Over wires Traces on a PCB, wire from peripheral to computer… Over the air Optical pules, radio waves… Inter-media Putting it all together.

issac
Download Presentation

Communications How to get something to almost talk to something else

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CommunicationsHow to get something to almost talk to something else Raffi Krikorian MAS.863 1 December 2003

  2. Getting stuff from A to B • Over wires • Traces on a PCB, wire from peripheral to computer… • Over the air • Optical pules, radio waves… • Inter-media • Putting it all together

  3. Over wires

  4. Wiring two PICs together (v1.0) • Parallel connection • As many wires as “simultaneous” bits • To transmit a 0xF, bring the lower four wires high, & the rest low

  5. Wiring two PICs together (v2.0) • Serial connection • Using minimal number of wires to transmit “in time” • To transmit 0xF (low bit first), send high for 4 time units, then 4 low

  6. Really fast Usage of large numbers of pins Requires bigger ICs Large number of wires/traces Space requirements on board (imagine modella) Large bundle of wires if off board Minimum number of pins (1 to 3) and wires Requires inter-device agreements and synchronization Speed (baud rate) Bit framing Requires extra software or hardware (USART) Parallel vs. Serial

  7. Synchronous Serial • Clock on one wire, and synchronized data on other • Usually used to connect microcontrollers/processors to peripherals • SPI (Serial Peripheral Interface) -- 1 wire for each dir + 1 clock wire • I2C (Inter IC) -- 1 wire for bidirectional data (direction is handled by protocol) + 1 clock wire

  8. Asynchronous Serial • Remove the clock wire • Need way to synchronize clocks due to clock drift • Agree on a speed • Use start bit to start running clocks • Transmit/Receive data • Stop clocks

  9. Asynchronous Serial Framing • Agree on how the bytes/bits are to be sent • 8N1 : 8 data bits, no parity bit, 1 stop bit • Parity bits are the check against error • Stop bit indicate how long the line has to be quiet between bytes • Transmit least significant bit (LSB) first • Above transmitting b’11010110’

  10. Serial standards and ICs • RS-232 • MAX202 (pref. 203) • 12V levels • 15m max cable length • P2P between devices • RS-485 • LTC1481 • 5V differential signals • Kms max cable length • Can be used as multi-drop between devices

  11. Serial from the IC • Hardware USART good • PIC16F876 has it built in • Can use external peripheral • and use some other wired communication from microcontroller/processor to peripheral) • “Bit bang” the serial line • Rely on a compiler to do this work

  12. USB • Universal Serial Bus • 12 Mbit/sec • 5m cable length • Use http://www.dlpdesign.com/usb/ • Have USB ICs • Premade boards that have a parallel (DLP-USB245M) and serial (DLP-USB232M) interface that convert to USB

  13. Over the air

  14. Radio • Modulate a carrier frequency with data • AM modulation takes a carrier frequency and plays with its amplitude • FM plays with the instantaneous frequency of the carrier • AM is relatively simple • but most “natural noise” is AM

  15. Don’t build a radio! • Get a chip and just send serial data • Nordic VLSI nRF401 • Single chip 433MHz • 200 kbps @ 100 meters • Texas Instruments TRF6900 • Mostly single chip 900MHz • 38.4 kbps @ 100 meters • rfPIC Microcontrollers • PIC with built in FM transmitters

  16. Infra-red • Use IR transmitter (diode) and IR receiver (photoresistor) • Hook it up like a LED and just turn it on and off • Problems with surrounding noise and base illumination levels

  17. Don’t rebuild IrDA! • Unless you are doing something really simple • Hook IR transceiver to a USART • MAX3120 • Single chip IRDA modulator : hook one end to USART other end to IR transceiver • 115 kbps @ 1 m

  18. 802.11b • Wireless LAN • 2.4 GHz • Internet Protocol based radio • 11 Mbit/sec @ 30 m • Spoof a PCMCIA bus and just wire yourself into a Orinoco Gold card • Saves you from having to get the analogs right • IOSoft 802.11b development kit for the PIC • http://www.iosoft.co.uk/wlan2.php

  19. Inter-media

  20. Internet Protocol • Unreliable packet based protocol • IPv4 = RFC791 • Addressing • IPv4 addresses are 4 bytes wide • Obtain address either statically or via DHCP • Not necessarily globally unique due to NAT (waiting for IPv6) • Routing

  21. IPv4 packet • The beginning of every IP packet starts with 20 bytes of this header (the options and the padding are optional) • “Data” immediately precedes this header

  22. User Datagram Protocol (RFC768) • Unreliable packet layer on top of IP • UDP allows for fast access to send packets • Packets are small • Packets are “one-offs”, you send the bytes and are done • No flow control, no congestion control, no guarantees • Trivial as an implementation

  23. Transmission Control Protocol (RFC793) • Creates a virtual “stream” on top of the Internet • Reliable, in-order packets • Uses bandwidth responsibly • Non-trivial for implementation • Still areas of research to make it efficient, determine whether it is a “stable” system

  24. Using IP • Using IP protocols • Serial line (over RS-232 or RS-485) or simple radio • Probably the best and easiest bet • SLIP (RFC1055) as packet framing or, • PPP (RFC 1661) as a control protocol • Ethernet (CS8900) and 802.11 • Need to implement ARP (RFC826)

More Related