Question
To be done in the assembly language, using a PIC16f886, source code attached below #include #define SW2 PORTB, 5 __CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF &
To be done in the assembly language, using a PIC16f886, source code attached below
#include
; banksel INTCON ; CLRF INTCON ; bsf INTCON, 7 ; bsf INTCON, 4 ; bcf INTCON, 1
LED4OnLoop: banksel PORTB call Delay_1s call Delay_1s call Delay_1s bsf PORTB, 3 bcf PORTB, 0 bcf PORTB, 1 bcf PORTB, 2 banksel PORTB btfsc SW2 goto LED4OnLoop call Delay_1s goto IntLoop IntLoop: banksel PORTB btfsc SW2 goto IntLoop bcf PORTB, 3 call Delay_1s bsf PORTB, 0 call Delay_1s bcf PORTB,0 call Delay_1s bsf PORTB, 1 call Delay_1s bcf PORTB,1 call Delay_1s bsf PORTB, 2 call Delay_1s bcf PORTB, 2 call Delay_1s bsf PORTB, 3 call Delay_1s bcf PORTB,3 goto LED4OnLoop Delay_1s: nop decfsz D1,f goto Delay_1s nop decfsz D2,f goto Delay_1s return end ;
Pre-lab Preparation (a) Connect the 28-Pin LIN Demo Board to your computer. (b) Write the code in ASSEMBLY language and program your development board to perform the following functions: (1) The on-board LED DS4 will be initially off (2) After a short period of time, LED DS4 will come on and stay on for the duration of operation (3) Utilizing the SW2 push-button, the one on Bank B, trigger an interrupt which causes functionality of the LEDS to change. - First: DS4 LED should turn off - Second: DS1 LED should blink once - Third: DS2 LED should blink once - Fourth: DS3 LED should blink once - Fifth: DS4 LED should blink once (4) Upon resuming normal operation, the DS4 LED should still be on and stat that way for the duration of operationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started