Question: please show full details step A program written in assembly language targeted for PIC18F microcontroller is listed as below ORG 0000H CNT EQU 0x70 CLRF
please show full details step

A program written in assembly language targeted for PIC18F microcontroller is listed as below ORG 0000H CNT EQU 0x70 CLRF TRISC, 1 CLRF PORTC MOVLW 0x64 MOVWF CNT MOVLW 0xFF XORWF PORTC, 1, 0 DECF CNT, 1, 0 BNZ LOOP2 BRA LOOP1 i 0x70 is the location for CNT : Set Port C to output Clear Port d LOOP1 : Put 0x64 into CNT i Put 0xFF into W register Toggle Port C i Decrement cCNT ; Jump to LOOP2 if not zero i Jump to LOOP1 i End of program LOOP2: END: Program 1 Given that the crystal frequency is 8 MHz and each instruction takes 4 cycles to execute, analyze the program in details and: (i) Identify the bit used as output bit in PORT C (ii) Explain the function of XORWF PORTC, 1, 0 (iii) Calculate the duration of the output pulse of Port C based on LOOP2. [5 marks] [2 marks] marks A program written in assembly language targeted for PIC18F microcontroller is listed as below: ORG 0000H CNT EQU 0x70 CLRF TRISB 1 CLRF PORTB MOVLW Ox64 MOVWF CNT i 0x70 is the location for CNT : Set Port B to output Clear Port B LOOP1 : Put 0xC8 into CNT i Put 0xFF into W register XORWF PORTB, 1, 0XOR W and Port B DECF CNT, 1, 0 BNZ LOOP2 BRA LOOP1 LOOP2: i Decrement CNT : Jump to LOOP2 if not zero iJump to LOOP1 i End of program END: Program 1 Given that the crystal frequency is 8MHz and each instruction takes 4 cycles to execute, analyze the program in detail and: (i) Calculate the duration of the output pulse of Port B based on LOOP2. [5 marks] i) Sketch and label the output waveform of pin RB0 of Port B for two cycles [4 marks] A program written in assembly language targeted for PIC18F microcontroller is listed as below ORG 0000H CNT EQU 0x70 CLRF TRISC, 1 CLRF PORTC MOVLW 0x64 MOVWF CNT MOVLW 0xFF XORWF PORTC, 1, 0 DECF CNT, 1, 0 BNZ LOOP2 BRA LOOP1 i 0x70 is the location for CNT : Set Port C to output Clear Port d LOOP1 : Put 0x64 into CNT i Put 0xFF into W register Toggle Port C i Decrement cCNT ; Jump to LOOP2 if not zero i Jump to LOOP1 i End of program LOOP2: END: Program 1 Given that the crystal frequency is 8 MHz and each instruction takes 4 cycles to execute, analyze the program in details and: (i) Identify the bit used as output bit in PORT C (ii) Explain the function of XORWF PORTC, 1, 0 (iii) Calculate the duration of the output pulse of Port C based on LOOP2. [5 marks] [2 marks] marks A program written in assembly language targeted for PIC18F microcontroller is listed as below: ORG 0000H CNT EQU 0x70 CLRF TRISB 1 CLRF PORTB MOVLW Ox64 MOVWF CNT i 0x70 is the location for CNT : Set Port B to output Clear Port B LOOP1 : Put 0xC8 into CNT i Put 0xFF into W register XORWF PORTB, 1, 0XOR W and Port B DECF CNT, 1, 0 BNZ LOOP2 BRA LOOP1 LOOP2: i Decrement CNT : Jump to LOOP2 if not zero iJump to LOOP1 i End of program END: Program 1 Given that the crystal frequency is 8MHz and each instruction takes 4 cycles to execute, analyze the program in detail and: (i) Calculate the duration of the output pulse of Port B based on LOOP2. [5 marks] i) Sketch and label the output waveform of pin RB0 of Port B for two cycles [4 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
