Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assuming “INT0” is enabled and “INT1” is set to Low priority, show the first ins

ID: 3866851 • Letter: A

Question

Assuming “INT0” is enabled and “INT1” is set to Low priority, show the first instruction executed after each simultaneous occurance of “INT 0” and “INT1” in the following code segment: (PIC 18F1220)

An explanation of the answer, so I can do the next one on my own, would be extremely helpful! Thank you!

3U. Assuming "INTO" is enabled and "INT1" is set to Low priority, show the first instruction executed after each simultaneous occurance of "INT 0" and "INT1" in the following code segment. org Goto 0x000 Init org BRA 0x8 Int first 0x18 Int2nd or GOTO Intfirst CLRF PORTA ; Initialize PORTA - Int_2nd CLRF PORTB ; Initialize PORTB Init MOVLW MOVWF MOVLW 0x7F ADCON1 0x00 ; Set all A/D Converter Pins as ; digital I/O pins ; Value used to initialize data direction

Explanation / Answer

Hello.

An interrupt is usually a signal from the external world or a command from the internal program (called software interrupt), which forces the

processor to pause its current activities and then jump to another location to execute another set of predefined activities.All the interrupts,

when evoked serves or executes a particular set of predefined activities known as “Interrupt Service Routines(ISR)”.

Interrupts are serviced according to it’s priority order.Here INT0 has higher priority and INT1 comes with lower priority. The order of priority

works like this –Here in this case where two interrupts are raised at the same time – one from INT0 and another from INT1 interrupt. Now

which one would be served first? In such a case, processor would serve the interrupt according to it’s priority. In our case INT0 is of high

priority (priority order 1)and INT1 interrupt is of low priority (priority order 4). So processor will execute ISR of INTO first and then later,after

finishing ISR of INT0, processor will begin executing ISR of INT1 interrupt.

Here in this code,
movlw ->literal to work register
movwf ->'f' is a file register i.e. somewhere in ram.

Here by first GOTO statement the controll will jump to Init and then this statement will execute first
"MOVLW 07F ;Set all A/D Converter pins"

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote