0% found this document useful (0 votes)
27 views

Assignment 3-1

This document contains an assignment on PIC16F84A microcontroller registers and instructions. It asks the student to identify register sizes, addresses, and functions. It also asks the student to determine the outcomes of various instructions by performing them by hand and in MPLAB X. The final questions asks the student to determine the contents of the W and Temp registers after a series of instructions.

Uploaded by

Alexis Mason
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Assignment 3-1

This document contains an assignment on PIC16F84A microcontroller registers and instructions. It asks the student to identify register sizes, addresses, and functions. It also asks the student to determine the outcomes of various instructions by performing them by hand and in MPLAB X. The final questions asks the student to determine the contents of the W and Temp registers after a series of instructions.

Uploaded by

Alexis Mason
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment 3 CPEG 208 Name:

1. Indicate the size of each of the following registers in PIC16F84A:(2 Points)

STATUS = 8 bits WREG= 8 bits

2. What is the starting address of the General Purpose Registers in PIC16F84A? (1 Point)
The address for the GPR is 0x0C to 0x4F and 0x8C to 0x8F

3. What is the SFR and what are the addresses of the following SFR: (5 Points)

SFR: SFR stands for Special Function Register. This specific hardware register controls
various functions or that of peripheral modules within the microcontroller. These registers are
memory mapped, meaning they appear at specific addresses in the device memory map.

PORTB= 0x06 PCLATH= 0x0A TIMER0= 0x01


TRISB= 0x86

4. Identify a multiplexed pin in PIC16F84A microcontroller? (4 Points)


Pin RA4 is multiplexed with the TMR0

5. What are the outcomes of the following instructions? (6 Points)

Instruction Before After Affected flags

MOVLW 0X0C WREG=0x03 W=0x0C N/A

WREG=0XBB, W=0xBB
MOVWF 0X1C N/A
GPR 0X1C=0X00 GPR 0X1C=0x0BB

ANDLW 0X0F WREG=0X55 W=0x05 Z

BSF STATUS, 05 STATUS=0x18 STATUS=0x19 N/A

BCF TRISA,3 TRISA=0X0F TRISA=0x01 N/A

6. What are the contents of W and Temp after executing the following program? (12 Points)

Instructions By Hand By MPLAB X


Assignment 3 CPEG 208 Name:

W Z DC C STATU W Z DC C
S
MOVLW 0X42 0x42 N/A N/A N/A N/A N/A N/A N/A N/A

MOVWF TEMP 0x42 N/A N/A N/A N/A N/A N/A N/A N/A

MOVLW 0XF0 0xF0 N/A N/A N/A N/A N/A N/A N/A N/A

ANDWF TEMP,1 0X40 0 N/A N/A 18 N/A 0 N/A N/A

MOVLW 0X42 0X42 N/A N/A N/A N/A N/A N/A N/A N/A

MOVWF TEMP 0X42 N/A N/A N/A N/A N/A N/A N/A N/A

MOVLW 0XFA 0XF N/A N/A N/A N/A N/A N/A N/A N/A

ADDWF TEMP,0 A

0x3C 0 0 0 0x19 M/A 0 0 1

MOVLW 0X42 0X42 N/A N/A N/A N/A N/A N/A N/A N/A

MOVWF TEMP 0X42 N/A N/A N/A N/A N/A N/A N/A N/A

BCF TEMP,3 N/A N/A N/A N/A 0x1B N/A 0 1 1

You might also like