Answer to Question #143578 in Assembler for Promise Omiponle

Question #143578
Describe the details of initializing the PIT (timer) to generate interrupt requests, as used
in lab. Be sure to describe all control register bits that must be set and/or cleared to
enable interrupts and why each bit/field must have the value that you indicate. (Omit
details of any PIT initialization not specifically associated with enabling the interrupts
used in lab.)
1
Expert's answer
2020-11-19T16:49:03-0500

The Intel 8254 is a Programmable Interval Timer (PTI) designed to address common timing control problems in microcomputers. It provides three independent 16-bit counters. The programmer configures the 8254 according to his requirements and programs one of the counters for the desired delay. On command, it starts decrementing the counter until it reaches 0, then generates a pulse that can be used to interrupt the CPU.


Programming is carried out through two I/O ports:

Control Port 0x43 - command and channel selection (in example, channel 0)

Data Port 0x40 - command data (each channel has its own Data Port.0x40 is used for the 0th)


Mode 0 - Interrupt on Timer Count. Allows 8254 to be used as an events counter.

 

CW = 00 11 000 0                                                     

00       Select Counter 0

11       Read/Write least significant byte first, then most significant byte

000     Mode 0

0         Binary counter

 

OUT 0x43, 00110000b           ; CW - Control Word

OUT 0x40, 12              ; Write least significant byte first

OUT 0x40, 34              ; then most significant byte


Control Word Format:

D7 D6 D5 D4 D3 D2 D1 D0

SC1 SC0 RW1 RW0 M2 M1 M0 BCD


SC - Select Counter M - Mode BCD

SC1 SC2 M2 M1 M0 0 Binary counter

0 0 Select Counter 0 0 0 0 Mode 0


RW - Read/Write

RW1 RW2

1 1       Read/Write least significant byte first, then most significant byte



 

 


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS