Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011...

43
Chapter 8 Digital and Analog Interfacing Methods

Transcript of Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011...

Page 1: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

Chapter 8

Digital and Analog

Interfacing Methods

Page 2: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education2

Lesson 5

8279-

Keyboard cum Display

Controller

Page 3: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education3

8279 Features

Page 4: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education4

Required Features in Keyboard cum

display unit

•Scan lines and encoded scan lines through

counter a continuous scan - 8279 Yes

•Return lines and encoded return lines -

8279 Yes

•Debouncing - 8279 Yes

Page 5: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education5

•FIFO for keyed inputs - 8279 Yes

•N-key rollover and two key lockout -

8279 Yes

•Hardware interface to parse keys - 8279

Yes

• LED arrays and Multi digits display and

display refresh - 8279 Yes

•Seven segments - 8279 Yes

Page 6: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education6

8279 Keys

• Connects up to 64 keys or sensors

• 8 return lines

• Four scan lines direct mode and encoded

mode

• Control key/strobe key

• One shift line to effectively give8 scan

rows (H-lines)

Page 7: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education7

• 8 Bytes FIFO buffer for keys or 64

sensors array RAM

• Interrupt driven IO mode on each FIFO

entry to enable processor read the FIFO

buffer

8279 FIFO/Sensor Array RAM

Page 8: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education8

•Two key lockout (default) or N-key

rollover mode setting

• Scan and return lines programmable

for sensor modes not encoded, encoded

in keyboard mode

8279 Key parsing

Page 9: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education9

•16× 8 Internal display RAM

• Programmable for refresh eight 16

segment characters display or sixteen

eight-segment displays

• Programmable for blinking display and

BCD numbers display

• Programmable Right side entry in number

entry and left side entry in characters entry

Page 10: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education10

8279 subunit and blocks

Page 11: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education11

8279 Processor

Interface block

Keyboard/ Sensors and Display control block

control and timing registers

IO control logic

FIFO/ Sensor Array RAM Status

Data Buffer

IORD, IO

W, A0, CS

IRQ

Page 12: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education12

Keyboard/Sensors control block

8 x 8 FIFO/ Sensor RAM

control and timing registers

keyboard debounce and control

Return lines

IORD, IO

W, A0, CS

shift

control/STB

Scan Counter

Page 13: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education13

Timing control and Display block

Timing and Control

control and timing registers

16x 8 Display RAM/Sensor Array RAM

display address

Display Registers

BDOut A0-A3 Out B0-B3

Page 14: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education14

Tables 8.7, 8.8 and 8.9

Subunits and Block Functions

Page 15: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education15

8279 Pins

Page 16: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education16

8279

VCC

RL1, RL0

IRQ

CLK

IOWR

OutB0-OutB3

CNT/STB, Shift

RL2,RL3

OutA0-OutA3

VSSCS

SL3-SL0

IORD

A0

RL4 to RL7

D0-D7 BD

Page 17: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education17

Tables 8.10- Pin signals

Page 18: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education18

8279 Interfacing

Page 19: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education19

8279

CS

RD,WR

D0 to D7A0

Decoder

(WR, IOWR or P3.7) and (RD, IORD or P3.6) or R/W and NOT(R/W)

A1 to An

CLK

Reset

Latch

AD0 to AD7

A0 to An

ALE

Page 20: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education20

8279

VCC

RL1, RL0

IRQ

CLK

IOWR

OutB0-OutB3

CNT/STB, Shift

RL2,RL3

OutA0-OutA3

VSSCS

SL3-SL0

IORD

A0

RL4 to RL7

AD0-AD7 BD

R/W

Decoder

P3.7, P3.6 Latch

AD0-AD7

ALE

Page 21: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education21

8279 to keyboard Interfacing

Page 22: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education22

Matrix Keyboard

cnt

shift

CNT/STB, Shift

RL2,RL3

SL3-SL1

RL4 to RL7

1:8 decoder encoded

SL0

RL1,RL0

Page 23: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education23

8279 to display system Interfacing

Page 24: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education24

Display 16-characters

BD

Out B3-

SL3-SL0

outA3-A0

1:16 decoder

encoded

Refresh Registers and thus displayed digits

out B0

Page 25: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education25

Table 8.11- Port Addresses for a typical interface circuit

Page 26: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education26

8279 Programming

Page 27: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education27

Programming the 8279 Mode and

sending commands to 8279

When CS = 0, C/D (A0)= 1, and WR = 0 then 8279 gets Command bytes

Page 28: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education28

Bytes after reset

1. Initialisation Command keyboard Instruction

2. Initialisation display Command Instruction

4. RAM start address

3. Initialisation clock Command Instruction

Page 29: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education29

5. Read Instruction

6. Inhibiting and blanking format

Page 30: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education30

= 01 sixteen 8-bit Char display left side entry

1. b4, b3 = 11 sixteen 8-bit Char display, right side entry

= 10 eight 8-bit Char display, right side entry

= 00 eight 8-bit Char display left side entry

Write keyboard/Display mode instruction b7,b6, b5 = 0

Page 31: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education31

= 101 decoded scan with 2 key lockout

2. b2, b1, b0 = 111 strobe input decoded display

= 110 strobe input encoded display

= 100 eight decoded scan sensor matrix

Write keyboard/Display mode instruction b7,b6, b5 = 0

Page 32: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education32

b2, b1, b0 =

= 001 decoded keyboard scan with 2 key lockout

= 011 encoded scan sensor matrix

= 010 encoded scan with N-key rollover

= 000 encoded scan keyboard with two key lockout

Page 33: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education33

1. b4-b0 five bits divisor of clock input

Write Program clock mode instruction b7,b6 = 00, b5 = 1

Page 34: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education34

= 010 read sensor RAM address 010

1. b4 = auto increment flag

2.b2-b0 = FIFO/Sensor RAM address

= 100 read sensor RAM address 100

Write Read FIFO/Sensor mode instruction b7 = 0, b6 = 1, b5 = 0,b3= 0 or 1

Page 35: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education35

Reading Display RAM b7,b6, b5 = 0

= 0001 address = 0001

b4 = 1 means auto address increment

b3-b0 = Display RAM

= 000 address = 0000

Page 36: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education36

1. b3-b2 IW-IW A3-A0, B3-B0 refer text

Write Display write inhibit/blanking mode instruction b7,b5 = 11, b6 = 0, b4 = 0 or 1

= 10 means A port blanking display

2. b1-b0 = BL,BL = 11 means both port blanking display

= 01 means B port blanking display, = 00 means none

Page 37: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education37

Programming Examples

Examples 8.9 (i) to (iv)

Page 38: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education38

Summary

Page 39: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education39

8279 Features

We learnt

Page 40: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education40

FIFO

8279- A keyboard cum Display conbtroller

Display RAM

We learnt

Page 41: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education41

8279 Programmability

1.Clock divisor

2. Blanking

3. Display RAM address

4. Left entry/right entry

5. Encoded mode, sensor mode

We learnt

Page 42: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education42

End of Lesson 5

8279-

Keyboard cum Display

Controller

Page 43: Digital and Analog Interfacing Methods - Devi Ahilya …€¦ ·  · 2011-07-142011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 2 Lesson 5 8279-Keyboard cum Display

2011 Microcontrollers-... 2nd Ed. Raj Kamal

Pearson Education43

THANK YOU