Question: Calculate a value for N so that the following subroutine generates a delay of 1ms. You should also include the time required to execute

  • Calculate a value for N so that the following subroutine generates a 

Calculate a value for N so that the following subroutine generates a delay of 1ms. You should also include the time required to execute the call instruction in your calculation. Assume that the oscillator rate is 4MHZ, which would give a clock cycle of 1s. 01: N EQU 02: 03: DELAY 1MS: movlw 04: D LOOP: addlw 05: 06: 07: 08: nop btfss goto return d'???' N -1 STATUS, Z D_LOOP Describe how the subroutine could be updated to give a delay of exactly 2ms assuming that the value for N remains unchanged.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To calculate the value of N for a 1ms delay we need to consider the clock cycle and the number of cl... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!