Download presentation
Presentation is loading. Please wait.
Published byBarrie Jefferson Modified over 9 years ago
1
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Hybrid I/O – Pulses
2
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Digital or Analog? 0 V +5 V It depends on how data is encoded.
3
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Analog Signals that Look Awfully Digital… Pulse Generation Pulse-Width Modulation (PWM) Pulse-Width Measurement (PWM) Event counting Period Measurement Input capture Output compare For a microcontroller – all involve creative use of clocks and counters
4
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Applications of These Signals Applications: Pulse Generation (sensors, motors, general control) Pulse-Width Modulation (PWM) (DC Motors) Pulse-Width Measurement (PWM) (sensors) Event counting Period Measurement (frequency measurement/modulation) Input capture (pattern recognition) Output compare (timed patterns)
5
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Magnetic Fields Direction of Field: North South
6
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Right Hand Rule Electric Currents Magnetism!
7
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Right Hand Rule Electric Currents Magnetism!
8
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Electromagnet North/South Pole?
9
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Stepper Motor
10
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Stepper Motor
11
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Stepper Manipulation Controlling a stepper involves turning these electromagnets on and off This must be done in order to create rotation. –i.e. can’t go from top one high to bottom one high Microcontroller will want to set up its outputs to go through these steps in order by generating pulses on multiple pins Number of steps (resolution) can actually be doubled with creative pulsing –i.e. top and right on give you a position going “NE”
12
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Force Current Magnetic Field Right Hand Rule # 2 Electric Currents & Magnetism Force
13
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Force in a Conductor
14
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Force in a Conductor
15
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Diagram of a Simple DC Motor
16
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Commutator
17
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst DC Motor Velocity The velocity of the motor is (roughly) proportional to the force exerted The power of the force acting on the motor is directly proportional to the magnetic field that is causing the force The magnetic field intensity is directly proportional to the current that creates it (from running through the wires) The current is directly proportional to the Voltage across the lines (V = IR) Therefore: The speed of the motor is directly proportional to the Voltage How do I output a voltage?!?
18
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Pulse Width Modulation (PWM) Effective Voltage = Duty Cycle x Supply Voltage
19
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Single Pulse Applications Sensors: –Ultrasonic range-finders require a pulse to start ranging, and report results based on a pulse length Servo Motors: –Pulse width describes position
20
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Generating Pulsed I/O on the MPC555 “Obvious” answer is to use straight GPIO (digital I/O), like the port we used in the QADC, then use the PIT to do timings –While possible, to do a continuous pulse we have to interrupt the processor every ½ period! –Timing is also slightly less accurate (going to an ISR takes time) The MPC555 has a “MIOS” unit (Modular Input/Output System) –Combines counters and clocks to generate a wide range of pulse widths and periods. –Does so without the need for interrupts
21
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst
22
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst MDASM Modes Disable mode Pulse width measurement Period measurement Input capture mode Single pulse generation Continuous pulse generation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.