EET 2261 Unit 8 Seven-Segment Displays

Slides:



Advertisements
Similar presentations
Floyd, Digital Fundamentals, 10 th ed EET 2261 Unit 7 Indexed Addressing Mode Read Mazidi, Chapter 6. Homework #7 and Lab #7 due next week. Quiz next week.
Advertisements

Seven Segment Display. What's A 7-Segment Display? A 7-segment display is a package with 7 bar-shaped LEDs arranged to allow the display of many useful.
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
CHAPTER 4 I/O PORT PROGRAMMING. I/O Port Pins The four 8-bit I/O ports P0, P1, P2 and P3 each uses 8 pins All the ports upon RESET are configured as input,
Bits and Bytes + Controlling 8 LED with 3 Pins Binary Counting and Shift Registers.
EET 2261 Unit 8 Seven-Segment Displays; S19 Records; System Clocks
LOGIC DESIGN AND CIRCUITS SEVEN SEGMENT LED DISPLAY Res. Assist. Hale İnan 1.
EET 2261 Unit 13 Controlling Stepper Motors and Servos  Read Almy, Chapter 21.  Lab #13 due next week.  Final Exam next week.
Counter Circuits and VHDL State Machines
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Chapter 4 Gates and Circuits.
EET 2261 Unit 2 HCS12 Architecture
EET 2261 Unit 7 I/O Pins and Ports
OTHER COMBINATIONAL LOGIC CIRCUITS
BCD to 7-Segment Display
Digital Outputs 7-Segment Display
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Lecture 3. Error Detection and Correction, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Chapter 9 Hardware Addressing and Frame Type Identification 1.Delivering and sending packets 2.Hardware addressing: specifying a destination 3. Broadcasting.
Microcontrollers Module 3: Digital Display. 7 – Segment Display A seven-segment display (SSD), or seven- segment indicator, is a form of electronic display.
Seven Segment Displays
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Seven Segment Displays
EET 2261 Unit 13 Enhanced Capture Timer
EGR 2131 Unit 4 Combinational Circuits: Analysis & Design
Seven Segment Displays
Fundamentals of Computer Engineering
Segment Identification
Figure 1.1 The Altera UP 1 CPLD development board.
Objectives Overview Differentiate among various styles of system units on desktop computers, notebook computers, and mobile devices Identify chips, adapter.
EET 1131 Unit 11 Counter Circuits
Combinational Circuits
OCR AS Level F451: Data transmission
Serial I/O and Data Communication.
EET 1131 Unit 6 Exclusive-OR and Exclusive-NOR Gates
Introduction to Handshaking Communication with SSC-32
A Level Computing Component 2
Digital Fundamentals Floyd Chapter 6 Tenth Edition
Part III Datalink Layer 10.
Seven Segment Displays
Seven Segment Displays
EET 2261 Unit 11 Controlling LCD and Keypad
Seven Segment Displays
Seven Segment Displays
ECET 330 Innovative Education--snaptutorial.com
ECET 230 Innovative Education--snaptutorial.com
Chapter 4 Gates and Circuits.
Packetizing Error Detection
EET 2261 Unit 11 Controlling LCD and Keypad
Packetizing Error Detection
Seven Segment Displays
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Parallel communication interface 8255
Programmable Configurations
EET 1131 Unit 6 Exclusive-OR and Exclusive-NOR Gates
EET 2261 Unit 12 Controlling Stepper Motors and Servos
Fundamentals of Data Representation
Packetizing Error Detection
Arduino 7 Segment Display Lab
CHAPTER 4 I/O PORT PROGRAMMING.
Registers and Counters
Shift registers and Floating Point Numbers
EGR 2131 Unit 12 Synchronous Sequential Circuits
Arithmetic Circuits.
EET 2259 Unit 8 Other Structures; Local Variables
Presentation transcript:

EET 2261 Unit 8 Seven-Segment Displays Read Almy, Appendix B. Lab #8 due next week. Handouts: Quiz 7, Unit 8 practice sheet, and slides 8 and 11 on using two seven-segment displays.

Seven-Segment Displays Recall that a seven-segment display has LEDs named a through g (and possibly one or two LEDs for decimal points) that can be lit up to display characters. This topic is discussed in the textbook’s Appendix B.

Common-Cathode or Common-Anode? Every seven-segment display is either: Common-cathode: each LED has its own anode pin, and all LEDs share a single cathode pin. Or common-anode: each LED has its own cathode pin, and they all share a single anode pin. The Dragon12’s are common-cathode. So to show a 3, what logic level do we need to send to each of the pins shown above? Do page 1 of Grogean worksheet and page 1 of first program on page 2.

Current-Limiting Resistors Recall that LEDs will burn out if you pass too much current through them. Each LED should always be connected in series with its own current-limiting resistor, typically between 220 Ω and 470 Ω. So if you wire a seven-segment display, you’ll need about eight of these current-limiting resistors: one for each segment and decimal point. (This is already done for us on the Dragon12 board.)

Banks of Seven-Segment Displays Often we use banks of several seven-segment displays to show several digits. Example: For a clock that displays hours, minutes, and seconds, we’d need six seven-segment displays. The result: a lot of connections and a lot of current-limiting resistors (if you take the “brute-force” approach described below).

Two Approaches to Controlling a Bank of Seven-Segment Displays Brute force approach Simple, but eats up a lot of resources (such as I/O ports on the HCS12). Multiplexing approach Harder to understand, but much more efficient in its use of limited resources (such as I/O ports). This approach is described on pages 24-26 of Dragon12 manual and in the textbook’s Appendix B.

Approach #1: Brute Force Connect a seven-segment display’s eight anode pins through current-limiting resistors to one of the HCS12 chip’s ports. Also connect the display’s common cathode pin to ground. Driving several displays in this way will use several of the I/O ports on our HCS12 chip—we’ll need an 8-bit port for each seven-segment display.

Implementing Approach #1 (Brute Force) for Two Displays Connect left a anode pin through a current-limiting resistor to the HCS12’s PA0. Connect left b anode pin through a resistor to the HCS12’s PA1. And so on for the other anode pins. Similarly for the right display, using PORTB.

Approach #2: Multiplexing In the second approach, we use a single HCS12 port to drive the anode pins on all of the displays. We also connect the common-cathode pins to another HCS12 port. This lets us turn a particular display on (by making the common-cathode pin LOW) or off (by setting the common cathode pin HIGH).

Approach #2: Multiplexing (Cont.) We sequence quickly through the displays, turning each one on for an instant: Send out the code for the first display’s digit. Turn the first display on by setting its cathode LOW and setting all of the other cathodes HIGH. Brief delay. Send out the code for the second display’s digit. Turn the second display on by setting its cathode LOW and setting all of the other cathodes HIGH. And so on for each of the other displays. Repeat the entire sequence from Step 1.

Implementing Approach #2 (Multiplexing) for Two Displays Connect All a anode pins through a current-limiting resistor to the HCS12’s PB0. All b anode pins through a current-limiting resistor to the HCS12’s PB1. And so on for the other anode pins. The first display’s common-cathode pin to the HCS12’s PTP0. The second display’s common-cathode pin to the HCS12’s PTP1. And so on for any other displays.

Seven-Segment Displays on the Dragon12 Trainer Our trainer board uses the multiplexing approach for its four seven-segment displays. See Schematic Diagram 4 and pages 24-26 of Dragon12 manual. On the schematic diagram, note signal names “DIG0”, “DIG1”, etc. which are connected to outputs of the 74367 buffer/driver chip below it.

Reminder: You Must Configure Ports as Inputs or Outputs We’ve seen that the seven-segment displays’ anode pins are wired to Port B and their common cathode pins are wired to Port P. So to use the seven-segment displays, we must first configure Ports B and P as outputs.

Downloading a Program from CodeWarrior to the HCS12 When CodeWarrior downloads a program to the HCS12, it does so using a widely used standard called the Motorola S19 file format. (http://en.wikipedia.org/wiki/S19_(file_format)) In Lab #3 you briefly examined an S19 file for a program that you were downloading. One line (or “record”) of that file looked like this: S109200086038B0520FE9F See next slide for analysis of this record.

Analyzing a Record from an S19 File We can break the record into five pieces: S1 09 2000 86038B0520FE 9F Address: The starting address in memory where the following data bytes are to be located. Record type: Identifies this record as a data sequence record containing a two-byte address. Data: The data bytes being downloaded. In our case, this is the machine code for a simple program. Checksum: For error-checking. It’s similar to the parity bits that are sometimes attached to data for error-checking. Byte Count: Tells how many bytes follow in this record.

Checksums A checksum byte is an extra byte appended to data that is being transmitted. Its purpose is to allow error checking by the receiver. (Similar to a parity bit.) There are different ways to compute checksum bytes. They’re all effective, as long as the sender and the receiver are using the same method. See next two slides for the checksum method used in S19 files.

Generating the Checksum in an S19 Record The sender uses the following method to calculate the checksum byte: Add the byte count, the address bytes, and the data bytes, discarding any carries. Take the one’s-complement of the sum. The result of Step 2 is the checksum byte for this record. Do it for the record shown previously.

Checking the Checksum in an S19 Record The receiver uses the following method to check for errors: Add the byte count, the address bytes, the data bytes, and the checksum byte, discarding any carries. The result should equal $FF. If it does not equal $FF, an error has occurred during transmission. -Do Practice Questions 1 through 4.