Developing Delay in a PIC16F84A based System
The objectives of this experiment are
- To understand the execution timing of an assembly language instruction of PIC16F84A microcontrollers.
- To develop a procedure to cause a pre-determine delay for a PIC16F84A based system.
- To utilized the stopwatch simulation tool of MPLAB for testing and verification of a timing program.
- BACKGROUND INFORMATION
PIC16F84A is a high performance, 8-bit, single-chip microcontroller. In this Microcontroller, an instruction cycle isequal to 4 clock cycle. If you are using a Resonator Frequency of 20Mhz (the one used on the PIC trainer board), then, each Instruction cycle will be 0.2μs long.
It takes one instruction cycle to execute an instruction in PIC16F84A, except for branching. If jump occurs, then it takes two clock cycles.
III. PRELAB PREPARATION
In the “Pre-Lab” section of your lab report include the following:
- Find number of cycles for the execution of the following instructions:
INSTRUCTION CLOCK CYCLE
- Find the execution time for the above program if the clock frequency is 20Mhz
- PROBLEM STATEMENT
Develop subroutines that cause one millisecond and one second delay.
- Write the instruction sets that will cause one millisecond delay
- Develop an Excel spread file to verify your calculation for the above instruction set
- Develop a subroutine to cause one millisecond delay
- Develop a subroutine that causes one second delay
- Develop a subroutine that causes multiple second delays.
- Draw flowcharts for the above subroutines
Last Updated on