13.07.2015 Views

Figure 1: Keypad interface with the 8279. - FET

Figure 1: Keypad interface with the 8279. - FET

Figure 1: Keypad interface with the 8279. - FET

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Figure</strong> 1: <strong>Keypad</strong> <strong>interface</strong> <strong>with</strong> <strong>the</strong> <strong>8279.</strong>


• The base address for 8279 is 0FFE8HaddressA1 Address allocated to0FFE8H 0 Data0FFEAH 1 Control• Programming <strong>the</strong> key padThere are eight types of control words provided for programming <strong>the</strong> operating modes of <strong>the</strong> 8279 only <strong>the</strong>following commands are used in <strong>the</strong> exercises:1. Mode set command2. Program clock3. Status Word1. Mode set command (D7, D6, D5= 0 , 0 , 0)Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit00 0 0 0 0 M M M2. Program clock command (D7, D6, D5= 0 , 0 , 1)Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit00 0 1 P P P P PPPPPP is <strong>the</strong> prescaler value ( from 2 to 31)( prescaler = 2 if PPPPP=00000 OR 00001).Example: When <strong>the</strong> control word set to 2Ch (00101100b), <strong>the</strong> program clock command is enabled (001) and <strong>the</strong>prescaler value = 12 (01100b).At <strong>the</strong> result, <strong>the</strong> internal clock of <strong>the</strong> 8279 is equal to ( 2.4576 MHz /12=204.8 KHz).3. Status WordBit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0X X X X F N N NWhen <strong>the</strong> control port is addressed by <strong>the</strong> IN instruction, <strong>the</strong> contents of <strong>the</strong> FIFO status word is copied into registerAL. NNN indicates <strong>the</strong> number of characters in <strong>the</strong> FIFO. Use <strong>the</strong>se 3 bits to determine if <strong>the</strong>re are any charactersstored in FIFO. F indicates that <strong>the</strong> FIFO is full (8 characters) or not.


• To write a program:CODESEGMENTASSUME; Constants.CS: CODE, DS: CODESTART:MOV SP, 2000HMOV AX, CSMOV DS, AX; Mode set command using OUT instruction <strong>with</strong> Control Address; Program clock command (prescaler) using OUT instruction <strong>with</strong> Control AddressAGAIN:; An instruction sequence traps program execution until a key(s) is pressed on <strong>the</strong> keypad.; (Read Status Word using IN instruction <strong>with</strong> Control Address).; Read <strong>the</strong> pressed key (Hex value*) from FIFO using IN instruction <strong>with</strong> Data Address; Rest of your code.JMP AGAINCODE ENDSEND START____________________________________________________________________*MTS-86C Key Value in FIFO0 00H1 01H2 02H......F0FH. 10H, 11H- 12H+ 13H: 14HREG15H

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!