12.07.2015 Views

Tutorial - FET

Tutorial - FET

Tutorial - FET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 1: Keypad interface with the 8279.


• The base address for 8279 is 0FFE8HaddressA1 Address allocated to0FFE8H 0 Data0FFEAH 1 Control• Programming the key padThere are eight types of control words provided for programming the operating modes of the 8279 only thefollowing commands are used in the 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 the prescaler value ( from 2 to 31)( prescaler = 2 if PPPPP=00000 OR 00001).Example: When the control word set to 2Ch (00101100b), the program clock command is enabled (001) and theprescaler value = 12 (01100b).At the result, the internal clock of the 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 the control port is addressed by the IN instruction, the contents of the FIFO status word is copied into registerAL. NNN indicates the number of characters in the FIFO. Use these 3 bits to determine if there are any charactersstored in FIFO. F indicates that the 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 with Control Address; Program clock command (prescaler) using OUT instruction with Control AddressAGAIN:; An instruction sequence traps program execution until a key(s) is pressed on the keypad.; (Read Status Word using IN instruction with Control Address).; Read the pressed key (Hex value*) from FIFO using IN instruction with 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!