Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include p16f8a.inc cblock Ox20 cl endc W org 00 loop call hwDelay goto loop w hwDelay banksel OPTION_REG movlw Ox03 movwf OPTION REG movlw d'150
#include p16f8a.inc cblock Ox20 cl endc W org 00 loop call hwDelay goto loop w hwDelay banksel OPTION_REG movlw Ox03 movwf OPTION REG movlw d'150 movwf cl s2 banksel TMRO movlw d'156' movwf TMRO sl btfss INTCON, 2 goto si bcf INTCON, 2 decfsz cl, F goto s2 return w ww end Q1 [2 Marks]: Calculate the delay produced by the assembly code Q2 [3 marks]: Use the calculated delay in Q1, and use the MPLAB to write an assembly code to run a software delay. . Q3 (5 marks]: Based on 16F84A, use the MPLAB to write an assembly program that does the following: When an external interrupt occurs on rising edge, make PORTA reads input signal. When an external interrupt occurs on falling edge, make PORTA writes output signal #include p16f8a.inc cblock Ox20 cl endc W org 00 loop call hwDelay goto loop w hwDelay banksel OPTION_REG movlw Ox03 movwf OPTION REG movlw d'150 movwf cl s2 banksel TMRO movlw d'156' movwf TMRO sl btfss INTCON, 2 goto si bcf INTCON, 2 decfsz cl, F goto s2 return w ww end Q1 [2 Marks]: Calculate the delay produced by the assembly code Q2 [3 marks]: Use the calculated delay in Q1, and use the MPLAB to write an assembly code to run a software delay. . Q3 (5 marks]: Based on 16F84A, use the MPLAB to write an assembly program that does the following: When an external interrupt occurs on rising edge, make PORTA reads input signal. When an external interrupt occurs on falling edge, make PORTA writes output signal
Step 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