📝 Program Clock of 8279 (10 MCQs)
Programmable Clock Division for Internal Timing
The 8279 uses a programmable clock prescaler to derive the internal timing frequency required for keyboard scanning, debounce validation and display refreshing. Its Program Clock command allows software to select a division factor between 2 and 31. The resulting internal clock is determined by dividing the externally supplied CLK frequency by the selected prescaler value.
Prescaler Field and Command-Word Organization
The Program Clock command uses the format 001PPPPP. The upper three bits identify the command, while the five lower bits specify the prescaler value. The programmed number determines the relationship between the external clock and the internal timing signal, allowing the controller to operate with different input clock frequencies.
Calculating the Internal Clock Frequency
The internal clock frequency is calculated using fINT = fCLK/P, where fCLK is the external clock frequency and P is the programmed prescaler. A suitable division factor is selected to obtain approximately 100 kHz internal timing, providing the required keyboard scan and debounce intervals in typical operation.
Example of Programming a Two-Megahertz Clock Input
Suppose the external clock frequency is 2 MHz and the desired internal frequency is 100 kHz. The required prescaler is 2,000,000 divided by 100,000, giving 20. The five-bit binary value is 10100, producing command word 00110100B or 34H.
Influence on Keyboard Debouncing and Display Refresh
The internal timing chain derives the periodic signals used for matrix scanning, debounce intervals and display multiplexing. An unsuitable prescaler changes these timing intervals and may affect peripheral response or display behaviour. Proper clock programming therefore ensures that the keyboard and display circuitry operates at appropriate rates for the external clock source.
Misconceptions About the Programmable Prescaler
'The prescaler multiplies the external frequency' is incorrect because it divides the input clock. 'A larger division value increases the internal frequency' reverses the frequency relationship. 'The 100 kHz timing value is an external CLK requirement' is incorrect because it is a typical internal frequency obtained after division.
Prescaler and Clock-Frequency Calculation Questions
Practise calculating internal frequency and the required division factor from a given external clock. Convert the five-bit prescaler into a complete 001PPPPP command word. Understand the effect of changing the divisor on scan and debounce timing, and distinguish external CLK from the internally derived timing frequency.
Clock Division and Prescaler Terminology
- CLK - External clock input.
- Prescaler - Divides the external clock frequency.
- Program Clock - Configures the prescaler value.
- fINT - Internal operating frequency.
- Debouncing - Validates mechanical key transitions.
- 100 kHz - Typical internal timing frequency.
📝 All Program Clock of 8279 MCQs
Q1. Which pin is the ground terminal for the 8253 chip
📖 Explanation: The ground terminal is the reference point for all circuit voltages and it is labeled Pin 12 on the 8253 device. Pin 10 actually carries the output of counter 0 not a power reference. Pin 21 is the chip select line which controls device enabling. Pin 24 supplies the positive five volt supply not ground. Using the correct ground pin ensures stable operation and prevents floating voltage errors.
Q2. What purpose does the active low CS signal serve in the 8253 timer
📖 Explanation: The CS (chip select) pin must be driven low to allow the 8253 to respond to bus commands. When CS is high the chip is placed in a high‑impedance state and ignores any read or write operations. It does not generate a clock pulse and it does not choose which counter is addressed; the address lines A0 and A1 perform that function. Therefore the low level is essential for activation and proper communication with the CPU.
Q3. In the control signal table which combination results in loading counter 2
📖 Explanation: Loading counter 2 requires CS low RD high WR low and the address bits selecting counter 2 which are A1 high and A0 low according to the table. Option B matches that pattern. Option A selects counter 1 because A1 low A0 high points to counter 1. Options C and D both have WR high which corresponds to read or no‑operation not loading. Understanding the binary address mapping is critical for programming the correct counter.
Q4. A designer connects Pin 10 to a LED and wants the LED to blink at 1 kHz using counter 0 which additional pin must be driven low to allow the counter to start counting
📖 Explanation: Counter 0 starts counting when its gate input (Pin 11) receives a low level allowing the clock pulses to pass through. Pin 10 provides the output waveform but does not control counting. Pin 14 is the gate for counter 1 not relevant to counter 0. Pin 21 is the chip select line and Pin 22 is the read line; neither directly start the counter. Therefore the gate pin must be asserted low for operation.
Q5. If a microprocessor writes a mode word to the 8253 while CS is low WR is low RD is high and address lines select counter 1 what action occurs
📖 Explanation: Writing a mode word requires CS low WR low RD high and the address bits set to 1 1 which selects the control word register rather than a specific counter. The address lines A1 = 1 and A0 = 1 indicate the mode register. Therefore the device interprets the bus data as a mode configuration and stores it. Loading a counter would need WR low with the address bits pointing to that counter. Reading needs RD low. No operation occurs when both RD and WR are low.
Q6. During a read operation the CPU sets CS low RD low WR high and address bits to 00 which pin will carry the read data out of the 8253
📖 Explanation: Reading counter 0 uses address 00 and the output of counter 0 is provided on the OUT 0 pin which is Pin 10. Pin 13 is the output for counter 1 Pin 17 is the output for counter 2 and Pin 21 is the chip select input not a data output. The read control signals cause the current count value to be placed on the data bus and the corresponding OUT pin reflects the timing waveform. Hence Pin 10 is the correct data line for this operation.
Q7. Which address lines are used to select one of the three counters and the control word register
📖 Explanation: The 8253 uses the two least significant address lines labeled A0 and A1 to choose between counter 0 counter 1 counter 2 and the mode register. A2‑A7 are not connected to the device for selection purposes. Selecting the correct lines allows the CPU to target the desired counter or the control word register. This mapping is essential for proper programming of the timer.
Q8. A system requires the 8253 to be placed in a high‑impedance state during a power‑down sequence which pin state achieves this condition
📖 Explanation: Setting the chip select (CS) pin to a high level disables the device placing all its pins into a high‑impedance three‑state condition. This prevents the timer from driving the bus while power is removed. Driving CS low enables the chip while pulling RD or WR low initiates read or write cycles not a full disable. Therefore raising CS is the proper method to achieve a safe high‑impedance state.
Q9. What role does the CLK1 pin play in the operation of counter 1
📖 Explanation: The CLK1 pin receives the external clock signal that increments counter 1 on each pulse assuming the gate input is active. It does not enable the counter that function belongs to the gate pin. The output of the counted value appears on OUT 1 (Pin 13) not on CLK1. Selecting the counter is done by the address lines not by the clock pin. Thus the clock input is essential for timing the count increments.
Q10. After configuring counter 2 with a mode word a programmer reads the current count by setting CS low RD low WR high and address bits to 10 which pin will show the count value during the read
📖 Explanation: Counter 2 is selected with address bits A1 = 1 and A0 = 0 which corresponds to the OUT 2 pin. The output of counter 2 is Pin 17 and during a read cycle the current count is placed on the data bus while the pin reflects the timing waveform. Pin 10 and Pin 13 belong to counters 0 and 1 respectively and Pin 21 is the chip select input. Therefore Pin 17 is the correct pin for observing the read value of counter 2.