Question: LAB5 Using the 8051 Counters in polling mode Overview The purpose of this lab is to control and program the MC8051 Counters of the micro-controller
LAB5 Using the 8051 Counters in polling mode
Overview
The purpose of this lab is to control and program the MC8051 Counters of the micro-controller in a given sequence. The program displays current count of Counter 0 on port 1 (P1) and Counter 1 on port 2 (P2). The initial TH0 value is F0H and TH1 is E1H. Counter0 and Counter1 are programmed in mode 2 using the polling mode, no interrupts. The status of TF0 and TF1 are displayed on Port 3 bit 0 (P3.0) and bit 1 (P3.1) respectively.
Steps
First, configure and initialize the required parallel ports; P1, P2, and P3. The Main program starts at code memory address 40H. The main program only function is updating P1 & P2 and displaying the two overflow flags on port 3.
Second, in the main program configure the two Counters for Mode 2 with the given initial two counts. Start Counterr0 & Counter1, initiate the external clock pulses on your Keil simulator, and display its accumulated count values on P1 & P2. Continue updating the status of TF0 & TF1 on P3.0 & P3.1.
Third, configure the debugger display to include the Timer0, Timer1, P1, P2, P3, and the Clock Control windows. Make sure that the Timers windows are configured for no external interrupts and external pin clocks. The clock window can be used to control the CPU clock speed, which can help during the debugging process.
Run the program and monitor all displayed windows. Verify the operation of the two Counters, TF0 & TF1, and the three display ports.
Test and debug your program. Also, document and submit your final report along with the well documented list file. You can slow the Counters and Ports update by controlling the MC clock using the clock window in the PREPHERALS selection.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
