Chapter 7 - v3.1 - Chapter 7 Parallel Input/Output This...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
68 Chapter 7 Parallel Input/Output This chapter presents the following I/O techniques: Simple, blind data transfers Strobed data transfers Data transfers with handshaking Simple, blind data transfers Example: (Switch-LED connection to PORTC) The circuit shows light emitting diode (LED) outputs and switch inputs connected to the port C pins. Each bit in the data direction register (DDRC) specifies the direction of the corresponding pin in port C. Each associated bit in the port C register will indicate the corresponding switch status or drive the corresponding LED. Driving an LED high will turn it off and driving it low will turn on the LED. When the switch is open, voltage at a port C input is 5 V. When a switch is closed, the corresponding port C input is pulled low to ground.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
69 Example: Seven-Segment display Each segment of a seven-segment display is an LED. A character can be displayed by illuminating some of the segments in the group of seven. Most displays include extra segments to be used as decimal points. There are two types of seven-segment LEDs: 1. Common anode connection 2. Common cathode connection ( current is sinking when bit is low) ( current is sinking when bit is high) x 0 0 1 1 0 0 1 g f e d c b a g f e d c b a 0: segment illuminated 1: segment illuminated ldp rdp a f b g e c d 5v a I R b0 b0 I R a x 1 0 0 1 1 1 1
Background image of page 2
70 In general instead of isolated current limiting resistors, drivers such as MC14495-1 Hexadecimal-to- seven Segment Latch/decoder ROM/driver are used. The MC14495-1 accepts a binary number, decodes it, and drives the appropriate segments to display the number. Example: Write a software to display the digit 5 when port C is connected to a noninverting buffer. The buffer drives a common anode seven-segment display. Assume no decimal point is connected (dp) g f e d c b a 1 0 0 1 0 0 1 0 = $92 DISP5 EQU $92 ; binary number for coding 5 REGBAS EQU $1000 ; register block pointer PORTC EQU $03 ; Port C register address offset DDRC EQU $07 ; Port C data direction register address offset BEGIN LDX #REGBAS ; point to registers block BSET DDRC,X $FF ; define portc as output LDAA #DISP5 ; load the number STAA PORTC,X ; send data to portc Example: If you do not use a hexadecimal-to-seven segment decoder, you have to do the conversion using a look-up table. LDY #REGBAS LDX #TABLE ; TABLE can be an EEPROM location to mark the ; beginning of 16-byte block LDAB DATA ; get single digit hex representation of data ABX LDAA $00,X STAA PORTC,Y MC 14495-1 7 segment display B0 B1 B2 B3 B4 LE
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
71 KEYBOARD INTERFACING 12-key keypad circuit Each key has a momentary contact switch that is connected to an intersection of row and column wires. When a key is released, an open circuit exists between all wires/terminals. When a key is pressed the contact closure connects the row and column wire. Thus, a short circuit exists between row and column wires when a key is pressed. To determine which key is pressed, a microcontroller must scan the rows and columns to identify the row and column intersection of the short circuit. A
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2011 for the course EE 447 taught by Professor Skst during the Fall '10 term at Middle East Technical University.

Page1 / 20

Chapter 7 - v3.1 - Chapter 7 Parallel Input/Output This...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online