Concept explainers
LAB4 – Using the 8051 Timers in polling mode
Overview
The purpose of this lab is to control and
Steps
First, configure and initialize the required parallel ports; Timer 0 to mode 1, and Timer1 to mode 1. The Main program starts at code memory address 40H, the main program only function is reading P0, updating P1 and P2, and displaying the two overflow flags on port 3 two bits.
Second, in the main program configure the two timers, Timer0 and Timer1, for Mode 1 with maximum delay time. Start Timer0, read port P0, and display its value on P1. Continue updating port P1, P2, and the status of TF0 & TF1 on P3.0 and P3.1 at the requested rate. Make sure to clear P3.0 while T0 is running and same for P3.1.
Third, configure the debugger display to include the Timer0, Timer1, P0,P1, P2, P3, and the Clock Control windows. Make sure that the Timers windows are configured for no external interrupts and no external pin clocks. The clock window can be used to control the CPU clock speed, which can help during the debugging process.
Fourth, set port 0 (P0) to the desired input value for the updating on port 1 (P1) and port 2 (P2). Run the program and monitor all displayed windows. Verify the operation of the two timers, TF0 & TF1, and the two display ports. Repeat for different initial P0 value and a varying value during the program execution.
Test and debug your program. Also document and submit your final report along with the well documented list file. You can slow the Timers and Ports update by controlling the MC clock using the clock window in the PREPHERALS selection.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps
- To which register does the control unit look to determine whether the rt or rd register should serve as the result register?arrow_forwardDevelop a PIC18F4321 Interrupt based program to measure the power in watt absorbed by a resistor R2 = 60 resistor and input voltage Vs = 5V when the switch S1 is closed in the below figure. Write a C-code to configure INTO to trigger the Interrupt and use the ISR to calculate the power. + IT Vs T IT TO PIC S1 IR2 IR1 R2 R1arrow_forwardThe 8051 has two 16-bit timers. The high byte for timer one is at address ___ please explain and provide coarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education