Developing Delay in a PIC16F84A based System

posted in: Term Paper Writing Service | 0

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.




Execution Timings


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.




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




Develop subroutines that cause one millisecond and one second delay.




  1. Write the instruction sets that will cause one millisecond delay
  2. Develop an Excel spread file to verify your calculation for the above instruction set
  3. Develop a subroutine to cause one millisecond delay
  4. Develop a subroutine that causes one second delay
  5. Develop a subroutine that causes multiple second delays.
  6. Draw flowcharts for the above subroutines


Share if you Care!

Leave a Reply

Your email address will not be published. Required fields are marked *