Presentation on theme: "Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: Vlastimil."— Presentation transcript:
Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: Vlastimil Vlček Projekt Anglicky v odborných předmětech, CZ.1.07/1.3.09/04.0002 je spolufinancován Evropským sociálním fondem a státním rozpočtem České republiky.
Peripheral devices are parts of the equipment connected to the input or output ports of a microcontroller (LED diodes, displays, relays, keyboard). The devices connected to the input ports are read by a microcontroller, whereas the devices connected to the ports in an output mode are being written in. It is desirable to ensure that careless handling with the ports of a microcontroller resulting in their damage (due to static electricity, careless plugging in of a microcontroller, etc.) does not occur. ATTENTION ! Maximum permitted output current of one pin is 25mA! The sum of currents of all output pins of one port is 90mA at the most !!! Microcontroller and the surrounding world Connection of peripheral devices
Button as an input device Metal contact = bouncing, oxidation, dirt, wear Metal gilded contact = bouncing, dirt Rubber with a carbon layer = dirt, wear Electronic switch (Hall probe) = faultless
PORT A = input PORT B = output 1st cycle2nd cycle3rd cycle4th cycle RB0HLLL RB1LHLL RB2LLHL RB3LLLH For 16 buttons, 8 lines are sufficient: Keyboard as an input device (matrix circuit)
LED diode as an output device Triggering of L levels at the RB0 output Triggering of H levels at the RB0 output
ATTENTION! Do not forget the protection diode D1! Relay as an output device
LED display as an output device (common anode circuit)
A quad of LED displays as an output device (multiplex control)
A quad of LED displays as an output device (serial data input)
Scheme of a preparation used for teaching microcontrollers (PIC16F883)
Summary of the subject matter What is a peripheral device? How do you connect a button to a microcontroller? How do you connect a relay with the pull-up current of 50mA to a microcontroller?
Summary of the subject matter Explain the principle of display multiplex control! How do you ensure that the ports of a microcontroller are protected from damage due to careless handling or static electricity? What is the function of a protection diode in a relay?
Datasheet Microchip PIC16F882/883/884/886/887 DS41291E (http://www.microchip.com) Jiří Hrbáček: Mikrořadiče PIC16CXX a vývojový kit PICSTART (BEN – technická literatura, Praha 2001 3. dotisk 4. vydání) Jiří Hrbáček: Komunikace mikrokontroléru s okolím 1 ((BEN – technická literatura, Praha 2002) References
Your consent to our cookies if you continue to use this website.