Figure 9-28 shows how an 8254 could be used to provide a programmable sample
rate generator for an A/D subsystem.
An initialization sequence for the system is given in Fig.9-29.The sequence
assumes that the addresses associated with the 8254 are 0070 through 0073;
LCNT,MCNT and NCNT contain L,M and N;and L and N are less than 256.
MOV AL,00010100B ;OUTPUT COUNTER 0
OUT 73H,AL ;CONTROL-MODE 2
MOV AL,LCNT ;OUTPUT COUNTER 0
OUT 70H,AL ;INITIAL COUNT-BINARY
MOV AL,01110011B ;OUTPUT COUNTER 1
OUT 73H,AL ;CONTROL-MODE 1
MOV AX,MCNT ;OUTPUT COUNTER 1
OUT 71H,AL ;INITIAL COUNT-BCD
MOV AL,AH
OUT 71H,AL
MOV AL,10010110B ;OUTPUT COUNTER 2
OUT 73H,AL ;CONTROL-MODE 3
MOV AL,NCNT ;OUTPUT COUNTER 2
OUT 72H,AL ;INITIAL COUNT-BINARY
.
.
.
Figure 9-29 Initialization of counters for the A/D example
| PRETHODNA FOLIJA | SADRZAJ | SLEDECA FOLIJA |