Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5-5 BlinkAlive subroutine. Change the BlinkAlive subroutine of Figure 5-6 so that it simply toggles the LED every 2.5 seconds. Change it so that it

image text in transcribed
image text in transcribed
5-5 BlinkAlive subroutine. Change the BlinkAlive subroutine of Figure 5-6 so that it simply toggles the LED every 2.5 seconds. Change it so that it briefly (and, therefore, faintly) blinks the LED once per second. 5.6 Macros. Write the definition for a macro called BCOPY that copies one bit in one regis- ter to a different bit in a different register without changing any of the other bits of either reg- ister. Begin the macro definition with BCOPY macro source, sbit.dest,dbit Minimize the instructions generated by each invocation of this macro. As an example of its use BCOPY PORTD, RD, PORTA, RA1 and BCOPY PORTD, RD1, PORTA, RA2 will copy the two outputs of the "RPG" of Figure 4-2a to two of the LEDs on the QwikFlash board so that the state of the RPG can be monitored by eye. Ulode Part # 1 Set upt resistor Explain voltage Program Development (P1 Template) ive subroutine :::::::::::::::::::::::::::::::::::::::::::::::: : This subroutine briefly blinks the LED next to the PIC every 2.5 : seconds. ;Turn off LED ;Decrement loop counter and return if not zero BlinkAlive bsf PORTA, RA4 decf ALIVECNT,F bnz BAend MOVLF 250, ALIVECNT bcf PORTA, RA4 BAend return ; Reinitialize ALIVECNT ;Turn on LED for 10 milliseconds every 2.5 sec Figure 5-6 BlinkAlive subroutine. 5-5 BlinkAlive subroutine. Change the BlinkAlive subroutine of Figure 5-6 so that it simply toggles the LED every 2.5 seconds. Change it so that it briefly (and, therefore, faintly) blinks the LED once per second. 5.6 Macros. Write the definition for a macro called BCOPY that copies one bit in one regis- ter to a different bit in a different register without changing any of the other bits of either reg- ister. Begin the macro definition with BCOPY macro source, sbit.dest,dbit Minimize the instructions generated by each invocation of this macro. As an example of its use BCOPY PORTD, RD, PORTA, RA1 and BCOPY PORTD, RD1, PORTA, RA2 will copy the two outputs of the "RPG" of Figure 4-2a to two of the LEDs on the QwikFlash board so that the state of the RPG can be monitored by eye. Ulode Part # 1 Set upt resistor Explain voltage Program Development (P1 Template) ive subroutine :::::::::::::::::::::::::::::::::::::::::::::::: : This subroutine briefly blinks the LED next to the PIC every 2.5 : seconds. ;Turn off LED ;Decrement loop counter and return if not zero BlinkAlive bsf PORTA, RA4 decf ALIVECNT,F bnz BAend MOVLF 250, ALIVECNT bcf PORTA, RA4 BAend return ; Reinitialize ALIVECNT ;Turn on LED for 10 milliseconds every 2.5 sec Figure 5-6 BlinkAlive subroutine

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the difference between productivity and efficiency.

Answered: 1 week ago