You are on page 1of 11

Programmable Keyboard/Display Interface - 8279

A programmable keyboard and display interfacing chip. o Scans and encodes up to a 64-key keyboard. o Controls up to a 16-digit numerical display. Keyboard has a built-in F F! " character buffer. #he display is controlled from an internal 16$" %A& that stores the coded display information.

Pinout Definition 8279


A'( Selects data )'* or control+status )1* for reads and ,rites bet,een micro and "-./. 01( !utput that blanks the displays. C2K( 3sed internally for timing. &a$ is 4 &56. C7+S#( Control+strobe8 connected to the control key on the keyboard. CS( Chip select that enables programming8 reading the keyboard8 etc.

10.-10'( Consists of bidirectional pins that connect to data bus on micro. %9( nterrupt re:uest8 becomes 1 ,hen a key is pressed8 data is a;ailable. !3# A4-A'+04-0'( !utputs that sends data to the most significant+least significant nibble of display. %1)<%*( Connects to micro=s !%C or %1 signal8 reads data+status registers. %>S>#( Connects to system %>S>#. %2.-%2'( %eturn lines are inputs used to sense key depression in the keyboard matri$. Shift( Shift connects to Shift key on keyboard. S24-S2'( Scan line outputs scan both the keyboard and displays.

8279 Interfaced to the 8088

Keyboard Interface of 8279

Keyboard Interface of 8279 #he keyboard matri$ can be any si6e from -$- to "$". ?ins S2--S2' se:uentially scan each column through a counting operation. o #he .42S14" dri;es '=s on one line at a time. o #he "-./ scans %2 pins synchronously ,ith the scan. o %2 pins incorporate internal pull-ups8 no need for e$ternal resistor pull-ups.

3nlike the "-C@@8 the "-./ must be programmed first. D7 D D! ' ' ' "unction &ode set Purpose Selects the number of display positions8 type of key scan...

' ' ' 1 1 1 1

' 1 1 ' ' 1 1

1 ' 1 ' 1 '

Clock %ead F F! %ead 1isplay <rite 1isplay Clear

?rograms internal clk8 sets scan and debounce times. Selects type of F F! read and address of the read. Selects type of display read and address of the read. Selects type of ,rite and the address of the ,rite. Clears the display or F F!

1isplay ,rite inhibit Allo,s half-bytes to be blanked.

1 >nd interrupt Clears the %9 signal to the microprocessor. o #he first 4 bits of A sent to control port selects one of " control ,ords. Keyboard Interface of 8279 First three bits gi;en belo, select one of " control registers )opcode*.

'''11&&& o &ode set( !pcode '''. 11 sets displays mode. &&& sets keyboard mode. 11 field selects either( "- or 16-digit display <hether ne, data are entered to the rightmost or leftmost display position.
o

DD

"unction

'' "-digit display ,ith left entry '1 16-digit display ,ith left entry 1' "-digit display ,ith right entry 11 16-digit display ,ith right entry Keyboard Interface of 8279 o &&& field( DD "unction ''' >ncoded keyboard ,ith --key lockout ''1 1ecoded keyboard ,ith --key lockout '1' >ncoded keyboard ,ith 7-key rollo;er '11 1ecoded keyboard ,ith 7-key rollo;er 1'' >ncoded sensor matri$ 1'1 1ecoded sensor matri$ 11' Strobed keyboard8 encoded display scan 111 Strobed keyboard8 decoded display scan o >ncoded( Sl outputs are acti;e-high8 follo, binary bit pattern '-. or '-1@. o 1ecoded( S2 outputs are acti;e-lo, )only one lo, at any time*. ?attern output( 111'8 11'18 1'118 '111.

Strobed( An acti;e high pulse on the C7+S# input pin strobes data from the %2 pins into an internal F F! for reading by micro later. --key lockout+7-key rollo;er( ?re;ents - keys from being recogni6ed if pressed simultaneously+Accepts all keys pressed from 1st to last.

Interface of 8279 ''1????? o #he clock command ,ord programs the internal clock dri;er. o #he code ????? di;ides the clock input pin )C2K* to achie;e the desired operating fre:uency8 e.g. 1''K56 re:uires '1'1' for a 1 &56 C2K input.

'1'B'AAA o #he read F F! control ,ord selects the address )AAA* of a keystroke from the F F! buffer )''' to 111*. o B selects auto-increment for the address. '11BAAAA o #he display read control ,ord selects the read address of one of the display %A& positions for reading through the data port.

1''BAAAA o Selects ,rite address -- B selects auto-increment so subse:uent ,rites go to subse:uent display positions. Interface of 8279 1'1'<<00 o #he display ,rite inhibit control ,ord inhibits ,riting to either the leftmost 4 bits of the display )left <* or rightmost 4 bits. o 00 ,orks similarly e$cept that they blank )turn off* half of the output pins. 11''CCFA o #he clear control ,ord clears the display8 F F! or both o 0it F clears F F! and the display %A& status8 and sets address pointer to '''. f CC are '' or '18 all display %A& locations become ''''''''. f CC is 1'8 --C ''1'''''8 if CC is 118 --C 11111111. 111'>''' o >nd of nterrupt control ,ord is issued to clear %9 pin in sensor matri$ mode.

1* Clock must be programmed first. f 4.' &56 dri;es C2K input8 ????? is programmed to 4' or 1111'. Interface of 8279 -* Keyboard type is programmed ne$t. o #he pre;ious e$ample illustrates an encoded keyboard8 e$ternal decoder used to dri;e matri$.

4* ?rogram the F F!. !nce done8 a procedure is needed to read data from the keyboard. o #o determine if a character has been typed8 the F F! status register is checked. o <hen this control port is addressed by the 7 instruction8 the contents of the F F! status ,ord is copied into register A2(

Interface of 8279 Code gi;en in te$t for reading keyboard.

1ata returned from "-./ contains ra, data that need to be translated to ASC (

o o

%o, and column number are gi;en the rightmost 6 bits )scan+return*. #his can be con;erted to ASC using the D2A# instruction ,ith an ASC code lookup table. #he C# and S5 indicate ,hether the control or shift keys ,ere pressed. #he Strobed Keyboard code is Eust the state of the %2$ bits at the time a 1 ,as Fstrobed= on the strobe input pin.

o o

#i$ Digit Display Interface of 8279

Programmable Inter%al &imer' 82!( #hree independent 16-bit programmable counters )timers*. o >ach capable in of counting in binary or 0C1 ,ith a ma$imum fre:uency of 1'&56.

3sed for controlling real-time e;ents such as real-time clock8 e;ents counter8 and motor speed and direction control. 3sually decoded at port address 4'5-445 and has follo,ing functions( Generates a basic timer interrupt that occurs at appro$imately 1".-56. o nterrupts the micro at interrupt ;ector " for a clock tick. Causes 1%A& memory system to be refreshed. o ?rogrammed ,ith 1@us on the ?C+D#. ?ro;ides a timing source to the internal speaker and other de;ices.

82!( "unctional Description

82!( Pin Definitions A18 A'(#he address inputs select one of the four internal registers ,ith the "-@4 as follo,s(

C2K( #he clock input is the timing source for each of the internal counters. o t is often connected to the ?C2K signal from the bus controller. CS( Chip Select enables the "-@4 for programming8 and reading and ,riting.

G( #he gate input controls the operation of the counter in some modes. !3#( A counter output is ,here the ,a;e-form generated by the timer is a;ailable. %1+<%( %ead+<rite causes data to be read+,ritten from the "-@4 and often connects to the !%C+ !<C. 82!( Programming >ach counter is indi;idually programmed by ,riting a control ,ord8 follo,ed by the initial count.

#he control ,ord allo,s the programmer to select the counter8 model of operation8 binary or 0C1 count and type of operation )read+,rite*.

82!( Programming >ach counter may be programmed ,ith a count of 1 to FFFF5. o &inimum count is 1 all modes e$cept - and 4 ,ith minimum count of -.

>ach counter has a program control ,ord used to select the ,ay the counter operates. o f t,o bytes are programmed8 then the first byte )2S0* stops the count8 and the second byte )&S0* starts the counter ,ith the ne, count. #here are 6 modes of operation for each counter( &ode '( An e;ents counter enabled ,ith G. o #he output becomes a logic ' ,hen the control ,ord is ,ritten and remains there until 7 plus the number of programmed counts.

82!( )odes &ode 1( !ne-shot mode. o #he G input triggers the counter to output a ' pulse for Fcount= clocks. o Counter reloaded if G is pulsed again.

&ode -( Counter generates a series of pulses 1 clock pulse ,ide. o #he seperation bet,een pulses is determined by the count. o #he cycle is repeated until reprogrammed or G pin set to '.

82!( )odes &ode 4( Generates a continuous s:uare-,a;e ,ith G set to 1. o f count is e;en8 @'H duty cycle other,ise !3# is high 1 cycle longer.

&ode 4( Soft,are triggered one-shot )G must be 1*.

&ode @( 5ard,are triggered one-shot. G controls similar to &ode 1.

You might also like