Architecture and PIC Flashcards

Lecture 2 (64 cards)

1
Q

What is a micro-controller (MCU)?

A

A self-contained computing unit that can:
* Communicate with other logic devices via standard serial protocols (I2C, SPI)
* Interface with analogue sensors and actuators through GPIO ports
* Perform real-time control or monitoring tasks
* Include a power management unit to reduce power consumption

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What can an MCU not do by default unlike an normal computer?

A

Drive a video output device or read from an input device such as a QWERTY keyboard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What components are typically found inside a micro-controller (MCU)?

A

A micro-controller typically includes:
* Central Processing Unit (CPU)
* Memory including program stores (FLASH/ROM) RAM (SRAM)
* Firmware (Timers, ADCs, DACs, Communication modules)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a CPU?

A

Central Processing Unit which runs programs and performs task.

To do this it needs to know:
– Where the next instruction can be found
– Where the data to be processed can be found
– How data (numbers) are represented.
– What to do with the data
– How to perform simple arithmetic/ logic operations
– How to sequence execution of the program

These are fuffiled by other parts of the microcontroller

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Fetch-Decode-Execute cycle?

A

A cycle used by a CPU to run programs, consisting of:
* Fetch an instruction from the program store
* Decode the instruction
* Execute the task of the instruction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the function of the Program Counter in a CPU?

A

It tells the CPU where to find the next instruction to fetch. The next instruction will be fetched into the instruction register

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the role of the Address Decoder in a CPU?

A

Based on the address field of the instruction being decoded, determines the physical (hardware) position in memory where a given address is located

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the Instruction Decoder do?

A

This makes sense of the opcode (instruction) stored in the instruction register and configures the control lines & ALU to perform the task of that instruction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the function of the Clock in a CPU?

A

It controls how fast data is transferred between the CPU and memory and how fast instructions are executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are File Registers in a CPU?

A

Memory locations that work at the speed of the processor core, used to store the value of variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are Accumulators used for in a CPU?

A

Registers that temporarily store the result computed by the ALU and can be used as intermediaries to move data around memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the Arithmetic Logic Unit (ALU) do?

A

Performs computations, comparisons, and logic operations such as:
* +, -, /, *
* AND, OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a Control Line in a CPU?

A

A 1-bit signal used to configure the behavior of hardware elements within a computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a Bus in computer architecture?

A

A collection of wires logically grouped to transmit more than 1 bit
A bus consisting of ‘n’ wires is called an “n-bit bus” and can transmit n-bits at any given instance of time

Types of buses include:
* Address Bus
* Data Bus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a good way to send data quickly between two points locally?

A

Multi-bit (parallel) bus connection whcih are parallel communication channels where several bits can be transmitted at the same time to send data to different parts of an MCU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is RAM (Random Access Memory)/Data Store?

A

Volatile memory primarily used to store variable and sensor data as the program is running. This memory is implemented using Static RAM hardware (SRAM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is ROM(Read Only Memory)/Program Store?

A

Non-volatile permanent memory often used as a program store (program instructions).

A program store is implemented using:
* EEPROM – Electrically Erasable Read Only Memory
* EPROM – Erasable Read Only Memory
* FLASH – Similar to EEPROM, but you can update just parts of the memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is RISC and CISC?

A

Reduced Instruction Set Computer
Complex Instruction Set Computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the main difference between RISC and CISC architectures?

A

RISC has small, fast instructions that fit into a single binary word typically take the same time to execute (the same amount of instruction cycles). Majority of these instructions can access any point of memory.

While CISC has large, slow instructions that can perform complex tasks efficiently. These instructions may need multiple fetches and have an unknown amount of instruction cycles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

True or False: A RISC machine generally requires more CPU clock cycles to run an individual instruction.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

True or False: A RISC machine requires more instructions to perform a task.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What’s the difference between 8-bit, 16-bit or 32-bit MCU?

A

It is the maximun amount of binary values a MCU can handle
i.e. 32-bit MCU can only handle a 32-bit number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

List the types of memory used within a micro-controller.

A

There are two main types of memory:
* Program store (non-volatile)
* Data store (volatile)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the purpose of a memory map?

A

It indicates where data can be placed or found within memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Examples of configurable hardware (Firmware)?
* Built in Analogue to Digital Converters (ADCs) * Timers * Built in Digital to Analogue Converters (DACs) * Serial I/O ports
26
What distinguishes Harvard architecture from Princeton architecture?
Harvard architecture has separate memory storage for instructions and data, while Princeton architecture uses a single memory for both.
27
What is the impact of word-length on memory addressing?
The maximum number of unique addressable memory locations is linked to the word-length of its address field, allowing access to up to 2^n locations.
28
What is the main purpose of the architectural diagram of a microcontroller?
It serves as a road map of how the microcontroller is built and organized.
29
What is the function of the Program Counter in the PIC16fxx?
It points to the next instruction to fetch from program memory.
30
What is the structure of the stack in the PIC16fxx?
An 8-Level stack that is a Last In First Out (LIFO) memory structure.
31
What are Special Function Registers (SFR) used for?
* Configure the input/output ports * Operate internal peripherals * Handle interrupts * Hold values used by firmware.
32
In the context of the PIC16f877a, what does the instruction 'MOVF 0x0E,d' utilize?
A 7-bit address for direct addressing.
33
What is the significance of memory banking in Mid-Range PICs?
It extends the addressable memory space beyond the limitations of the address bus.
34
How many RISC instructions does the PIC16f877a have?
35 RISC instructions.
35
What are the three main categories of instructions in the PIC16f877a instruction set?
* Byte commands * Bit commands * Literal commands.
36
What does the opcode in a byte command typically represent?
An ALU-based instruction such as ADD or SUBTRACT.
37
How do you switch to bank 1 in the PIC16fxx architecture?
BSF STATUS,RP0 followed by BCF STATUS,RP1.
38
What does the STATUS register in the PIC16fxx hold?
* Addressing bits , , * Startup state bits , * ALU condition bits , , .
39
Fill in the blank: The PIC16f877a uses a _______ to hold up to 8 different Program Counter values.
8-Level stack.
40
True or False: The program memory map of the PIC16fxx is divided into pages.
True.
41
What are the two special positions in the program memory known as?
* Reset Vector * Interrupt Vector.
42
What is the function of the PORTx registers in the PIC16fxx?
* Store the bit value to be output on the PORTx GPIO pins * Store the bit value read from the PORTx GPIO pins.
43
What is the purpose of the 'MOVLW' instruction?
It loads a literal value into the WREG register.
44
List the key directives used in MPASM.
* LIST * END * EQU * ORG * #include * _CONFIG.
45
What does the instruction 'BSF 0x0D,6' do?
Sets bit 6 of register 0x0D.
46
How is direct addressing implemented in the PIC16f877a?
Using a 7-bit address, which is not sufficient for all RAM values.
47
How many banks does the PIC16f877a have?
4 banks.
48
What is the full address format used in the PIC16f877a for selecting memory banks?
Combines the address bus bits with banking bits to form a 9-bit address space.
49
What does the LIST directive do in MPASM?
Tells assembler to target a specific PIC device.
50
What is the purpose of the END directive?
Tells the assembler that the end of a program has been reached.
51
What is the function of the EQU directive?
Equates a constant to a label.
52
What does the ORG directive do?
Forces the instruction immediately after the ORG instruction to be stored at a specific memory address.
53
What is the purpose of the #include directive?
Includes the standard header file definitions into the program.
54
What does the _CONFIG directive set?
Sets the configuration word value.
55
What does the $ directive return?
Returns the address of the current instruction position to the assembler.
56
What is the function of the BANKSEL directive?
Sets or clears the appropriate RPx banking bits in the STATUS register for access to a specified register.
57
In the empty skeleton program, what does the org 0x00 instruction indicate?
It indicates the reset vector position.
58
What is the significance of using labels in assembly programming?
Labels make it more obvious what the code will do.
59
True or False: The use of the goto instruction is always clear in assembly code.
False.
60
Fill in the blank: The _______ directive helps abbreviate the code in assembly programming.
$
61
What improvements are made in part 6 of the good coding practice?
Sets CONFIG fuse bits and includes the LIST directive.
62
What does the command movlw 0x0a do in the arithmetic code example?
Loads the literal value 0x0A into the W register.
63
What is MPLABX?
An IDE that supports various microcontroller devices and enables emulation, simulation, and programming.
64
What can the ICD or PICKIT tool read from a microcontroller?
Internal register values and I/O pin values.