Electronics / Water analogy Water Electronics Energy - Energy Pressure - Voltage Flow - Current Volume - Charge Resistor U = R * I 1 Capacitor U 1 i dt C U L di dt Inductance Turbine Flywheel
Diode Transistor U V F ; i = 0 U = V F ; i 0 I V F U NPN C B E U BE V F ; I C = 0 (Not conducting, strypt) U BE = V F ; 0 I C h FE * I B ; U CE = 0 (saturated, bottnad) U BE = V F ; I C = h FE * I B ; U CE 0 (active) Problem 1 Use an npn-transistor and resistors to turn on a LED when a TTL (5V logic) output is high. The LED should have I F = 10 ma but the output can only source 1 ma @ 5 V (logic high) and sink 1 ma @ 0V (logic low). +5V supply is available. V F for the LED is 2.0 V. LTSpice: Circuit simulator http://www.linear.com/designtools/software/#ltspice 2
Problem 2 Optocoupler In the same situation as in Problem 1 the LED should be turned on when the output is false. Use a pnp-transistor and resistors to solve this. I F CTR = I Cmax / I F I C Problem 3 Increasing the current Analyze the input circuit for the optocoupler part of the serial port optoisolator. How much does the diode current vary over the voltage range? Darlington MOSFET IGBT 3
Solid State Relay Mechanical Relay Power optocoupler Low voltage and current TRIAC output (AC) e.g. 230V 25A Zero crossing (current) turnoff Turn Off Inductive Load In a few weeks: Loopback test setup + i Freewheeling diode needed Hardware: prototype boards Hyperterminal test first followed by C-program under CYGWIN 4
The Serial Port History DTE / DCE Accessing remote locations before LAN and Internet: Telephone line and modem The information has to be transferred in a serial way From this scenario we have the terms DTE and DCE DTE : Data Terminal Equipment DCE : Data Communication Equipment RS232 / V24 Modem DTE DCE Telephone line DTE / DCE continued RS-232 IBM defined the PC as a DTE An input pin on a DCE is an output on a DTE and vice versa The signal definitions were made in the Recommended Standard RS232 Standardized by EIA/TIA EIA-232 or later TIA-232 with a following letter for the version The use was soon extended to printers and other peripherals Great confusion in the usage over the years 5
RS-232C RS-232C continued Defines a 25 pole D-sub connector About 20 signals for communication and synchronization Actual communication uses 3 pins TxD (transmitt data) DTE out RxD (receive data) DCE out SG (signal ground) - Handshaking pins e.g. RTS (request to send) DTE out CTS (clear to send) DCE out DSR (data set ready) DCE out DCD (data carrier detect) DCE out DTR (data terminal ready) DTE out RS-232C signals Connecting DTE/DCE Voltage Bipolar signals 1 is -3..-25 V 0 is +3..+25 V A DTE is connected to a DCE pin to pin DTE:s are most common today A DTE can connect to another DTE using a null modem cable In this cable the wires are crossed so that input meets the corresponding output. 6
The serial port on the PC Why Use this Dinosaur? In the beginning the full 25-pole RS232C was used Later the 9-pole version was defined EIA/TIA-574 Low voltage definitions EIA/TIA-562 USB is intended to replace but - Implementing USB is a huge task Serial port relies on simple definitions and is easy to use both on the software and hardware sides Encapsuled chip-solutions for using USB exist but uses the serial port definitions on both sides The asynchronous serial format About the asynchronous format LSB MSB 1 0 1 0 0 0 1 1 1 start idle parity Logical levels shown stop Character oriented (maximum 8 bits) Agreement on the speed (bits/s) Standardized Baud rates Synchronization for each character/byte A UART (Universal Asynchronous Receiver Transmitter) handles the conversion to/from serial format 7
Handshaking ASCII character encoding Receiver may be choked by too much data Hardware pins can be used e.g. RTS-CTS XON/XOFF characters can be used if only characters are transmitted American Standard code for Information Interchange 8