ECE 353 Introduction to Microprocessor Systems - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

ECE 353 Introduction to Microprocessor Systems

Description:

This is very common when people type on keyboards especially good touch typists ... LEDs are long-life, high-efficiency devices. Temperature/vibration tolerant ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 37
Provided by: mikem53
Category:

less

Transcript and Presenter's Notes

Title: ECE 353 Introduction to Microprocessor Systems


1
ECE 353Introduction to Microprocessor Systems
Week 12
  • Michael G. Morrow, P.E.

2
Topics
  • Digital Inputs
  • Mechanical switches
  • Keypads and keyboards
  • Rotary encoders
  • Displays
  • LED displays
  • LCD displays

3
Mechanical Switches
  • Types of switches
  • Poles
  • Throws
  • Contact action
  • Converting switch position to a logic level
  • Mechanical contact bounce
  • Debouncing in Hardware
  • RS latch
  • Integrator/Schmitt-trigger
  • Dedicated ICs (MAX6816/7/8)

4
Mechanical Switches
  • Debouncing in Software
  • How to do?
  • Exercise
  • Develop an algorithm for debouncing of a single
    switch. (Assume 0 when pressed.)
  • Draw a flowchart to implement your algorithm in
    an ISR that will be invoked by a periodic timer
    interrupt.
  • Implementing repeat and acceleration.

5
Keypads and Keyboards
  • Switch connections
  • Linear
  • Matrix
  • Matrix scanning algorithm (keypad example)
  • Drive columns (rows) low one at a time.
  • Read the rows (columns), any low rows (columns)
    correspond to pressed switches in the column
    (row).
  • Matrix Circuit Requirements
  • Pull-up resistors to ensure that open rows
    (columns) are high.
  • Use open-drain/open-collector driver on each
    column (row) to avoid contention issues with
    multiple presses.

6
Switch Matrix Issues
  • Switch Ambiguities
  • If more than two switches are pressed, may see
    more switches active than there really are.
    (phantom switches)
  • Can be solved in hardware by placing a series
    diode at each switch. (keypad example)
  • Handling Roll-Over
  • Another switch is pressed before the current key
    is released
  • This is very common when people type on keyboards
    especially good touch typists
  • A keyboard provides N-key roll-over if N switches
    can be recognized simultaneously

7
Rotary Encoders
  • Convert angular position to digital value
  • Encoding schemes
  • Single channel incremental encoders
  • Quadrature Encoders
  • Absolute Encoders
  • Indexed Encoders
  • Interfacing
  • Software
  • Using interrupts or periodic polling
  • Hardware
  • Design logic or use dedicated devices

8
LED Basics
  • LEDs are long-life, high-efficiency devices
  • Temperature/vibration tolerant
  • Electrical characteristics
  • Typical small LEDs have IF of 5-20mA
  • IF in high powered LEDs can be much more
  • Driver requirements for small LEDs
  • Current limiting must be provided when driving
    LEDs from a voltage source
  • Many logic gates cannot directly drive LEDs
  • Simple transistor switches with current limiting
    resistors are the simplest solution

9
Multiplexed LED Displays
  • Display types
  • Driving multi-segment displays
  • Multiplexed displays
  • Driver circuits
  • Refresh rate
  • Duty cycle
  • Intensity control
  • Display driver ICs

10
LCD Display Characteristics
  • Numeric, text and/or graphic displays
  • Extremely low power
  • Passive
  • Temperature sensitive
  • Complex drivers required to create segment
    waveforms
  • Require no net DC offset on segments on single
    polarity systems this adds to driver complexity

11
LCD Technology
  • http//www.sharp.co.jp/sc/library/lcd_e/indexe.htm
  • Natural state
  • Molecules are arranged in a loosely ordered
    fashion with their long axes parallel.
  • Aligned state
  • When coming into contact with a finely grooved
    surface (alignment layer), molecules line up in
    parallel along the grooves.

12
LCD Technology
  • When liquid crystals are sandwiched between upper
    and lower plates, they line up with grooves
    pointing in directions 'a' and 'b,' respectively.
    The molecules along the upper plate point in
    direction 'a' and those along the lower plate in
    direction 'b,' thus forcing the liquid crystals
    into a twisted structural arrangement. (figure
    shows a 90-degree twist) (TN type liquid crystal)

13
LCD Technology
  • Light passes through liquid crystals, following
    the direction in which the molecules are
    arranged. When the molecule arrangement is
    twisted 90 degrees as shown in the figure, the
    light also twists 90 degrees as it passes through
    the liquid crystals.

14
LCD Technology
  • The molecules in liquid crystals are easily
    rearranged by applying voltage or another
    external force. When voltage is applied,
    molecules rearrange themselves vertically (along
    the electric field) and light passes straight
    through.

15
LCD Technology
  • Light passes when two polarizing filters are
    arranged with their axes aligned (left).
  • Light is blocked when two polarizing filters are
    arranged with their axes perpendicular (right).

16
LCD Technology
  • A combination of polarizing filters and twisted
    liquid crystal is used to create a liquid crystal
    display.

17
LCD Character Modules
  • Based on Hitachi LCD-II controller protocol
  • 1 to 4 lines, 8-20 characters per line
  • 4 or 8 bit parallel interface
  • Motorola style control signals
  • 256 character font
  • 8 user defined characters (CGRAM)
  • Controllable cursor
  • 2 read/write registers
  • Instruction/status
  • data

18
LCD Character Modules
  • Standard Hardware Interface
  • Contrast adjustment
  • Temperature considerations
  • Control bus connections
  • Register addressing
  • Bus Timing Requirements
  • Often slower than processor may require wait
    states
  • Sequential operations often require delay
  • Can drive LCD module bus from I/O pins and
    manipulate to get proper waveforms (bit-banging)
  • Backlights
  • LED
  • CCFL/EL

19
LCD Commands
  • Commands
  • Display Clear
  • Cursor Home
  • Entry Mode Set
  • Display On/Off Control
  • Cursor/Display Shift
  • Function Set
  • Set CGRAM Address
  • Set DDRAM Address
  • Using BUSY Flag

20
Designing a Software Interface
  • What procedures would you write in order to
    create a higher-level software interface to the
    LCD display?
  • Build a hierarchy using low-level procedures as
    building blocks
  • LCD Initialization
  • Send Command (pass command)
  • Send Data (pass data)
  • Check if Busy (return state)
  • Wait until Ready
  • Write Character at Location (pass char, location)
  • Write Character String (pass address)
  • Write Character String at Location (pass addr,
    location)

21
Wrapping Up
  • Homework 6 due Wednesday, November 25th.
  • Quiz 3 on Thursday, December 3rd at 715pm in
    1106ME.
  • Coverage is over Modules 5 and 6.
  • Same rules as other quizzes, except calculators
    will be permitted for numeric calculations.

22
Matrix-Connected Switches
  • Each switch connected between a row line and a
    column line.
  • More complicated circuitry required to poll
    switches.
  • Why connect in a matrix? Think about keyboard
    with 100 keys...

Back
23
74C923 20-Key Encoder
Back
24
Maxim MAX6816/7/8
Back
25
Quadrature Rotary Encoders
There are normally many electrical cycles for
each mechanical revolution.
Back
26
Indexed Rotary Encoders
  • Rotary encoder A/B outputs typically go through
    many electrical cycles for a single revolution of
    the encoder shaft.
  • The absolute shaft position is unknown.
  • An indexed rotary encoder is essentially a
    quadrature encoder that has an additional output
    that provides a single pulse during each
    mechanical revolution.
  • This reference signal provides a way to determine
    the absolute shaft position.

Back
27
Absolute Rotary Encoders
  • The n-bit output is directly proportional to the
    angular position.

Back
28
Rotary Encoder with Interrupts
Back
29
Typical LED Characteristics

Back
30
LED Displays

Back
31
MAX7219Multiplexed Display Driver
Back
32
MultiplexedDisplay
LED current limiting resistors
Back
33
HW Switch Debouncing
  • RS Latch

Back
34
HW Switch Debouncing
  • RC Integrator with Schmitt-trigger gate
  • Debounces both press and release

Back
35
KeypadExample
Back
36
PhantomSwitch
Back
Write a Comment
User Comments (0)
About PowerShow.com