Embedded Exam 1 Flash Cards

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/322

encourage image

There's no tags or description

Looks like no tags are added yet.

323 Terms

1
New cards

What is a microcontroller?

A complete (or mostly complete) solution for embedded applications: one or more CPU cores, RAM, ROM, I/O ports, and timers

2
New cards

What is the Raspberry Pi 4 made up of?

Broadcom BCM2711 SoC processor, additional SDRAM, USB controller, Ethernet controller, WiFi controller, peripheral I/O

3
New cards

Why is the RP4 called an embedded subsystem?

It is a microcontroller plus additional support controllers

4
New cards

What important function is the RP4 missing?

An RTC (real time clock)

5
New cards

RP4 SoC key functions

4x ARM 64-bit Cortex-A72 cores, SDRAM controller, video decode (H.265/H.264), OpenGL ES 3.0 graphics, L1 and L2 cache, HDMI display interface, many I/O (DMA, USB, UART, SDIO, PWM, PCM/I2S, SPI, GPIO)

6
New cards

ESP32 compared to the RP4

Tensilica 32-bit core (1 or 2), onboard RTC, onboard ROM and RAM, onboard crypto engines, onboard RF logic, many I/O interfaces

7
New cards

Three things a CPU core does

1) Moves data 2) Manipulates data 3) Is controlled by instructions

8
New cards

Internal organization of a computer

CPU, memory, and I/O (input and output)

9
New cards

Memory capacity

The number of bits a memory can store (e.g. 128 Kbits, 256 Mbits)

10
New cards

Memory organization

How the locations are organized, e.g. 128 x 4 = 128 locations of 4 bits each

11
New cards

Memory access time

How long it takes to get data from memory; depends on location and interface speed

12
New cards

Access time: L1 cache vs L2 cache vs external RAM

L1: CPU clock speed. L2: multiple CPU clocks. External RAM: dozens to 100+ CPU clocks

13
New cards

RP4 clock speed

1.5 GHz (older), 1.8 GHz for the latest version. Study guide answer: 1.5 GHz

14
New cards

Three buses connecting CPU to memory and I/O

Address bus, data bus, control bus (read/write)

15
New cards

Memory control signals CS, WE, OE

Chip Select, Write Enable, Output Enable (read)

16
New cards

Port-mapped I/O

An IO/MEM select bit gives I/O its own independent address space

17
New cards

Memory-mapped I/O

I/O devices share the same address space as memory; a logic circuit (address decoder) enables CS for the right address range

18
New cards

Is the RP4 memory mapped or port mapped?

Everything is memory mapped, including I/O

19
New cards

Steps to design an address decoder

1) Write the address range in binary 2) Separate the fixed part of the address 3) Design a logic circuit whose output activates when the fixed bits appear

20
New cards

Address decoder for addresses 0 to 15 (8-bit address)

Fixed bits a7-a4 = 0000; CS (active low) asserted when a7..a4 are all 0

21
New cards

Address decoder for 300H to 3FFH

Fixed bits a11-a8 = 0011; decode those four bits to drive CS

22
New cards

Harvard architecture

Separate memory and buses for code and data

23
New cards

Von Neumann architecture

One shared memory and bus for code and data

24
New cards

Harvard pros and cons

More pins, power and area; more complex; faster with parallel/simultaneous instruction and data access; special purpose; used for registers and L1 cache

25
New cards

Von Neumann pros and cons

Fewer pins and less power; simpler; slower due to bottleneck; general purpose; used for L2, L3, main memory and storage

26
New cards

Program Counter (PC)

Special register inside the processor that stores the address of the next instruction

27
New cards

Stored program computer operation

Step 1: fetch the instruction at the address in the PC and increment the PC. Step 2: execute the instruction, repeat

28
New cards

Most powerful thing a computer can do

Repeat a set of operations until some condition is met

29
New cards

What is branching?

Setting the PC to a specified instruction location rather than the next instruction

30
New cards

Levels of program code

High-level language (C++, Rust, Python) -> assembly language (text form of instructions) -> hardware representation (binary opcodes)

31
New cards

What language does a processor actually run?

Binary machine code (opcodes)

32
New cards

What does a compiler do?

Converts high-level language to assembly/machine code for a specific processor architecture

33
New cards

RISC

Reduced Instruction Set Computing: operations as simple as possible, usually one instruction per clock. ARM, MIPS

34
New cards

CISC

Complex Instruction Set Computing: operations as powerful as possible, 1 to many clocks per instruction. x86

35
New cards

Hybrid (GPU) architecture

Vector or SIMD (single instruction multiple data); data-flow based. SSE, CUDA

36
New cards

Direct addressing

The operand is an address (a mailbox); the data is what is inside that location

37
New cards

Immediate addressing

The operand is a constant number, e.g. #3

38
New cards

Opcode

The fixed-size code in an instruction that identifies which operation to perform

39
New cards

Why do compilers/assemblers take multiple passes?

To resolve addresses of labels and variables that are not known on the first pass

40
New cards

RP4 pins you cannot control

3.3 V, 5 V and GND

41
New cards

Are the 5V and 3.3V PWR pins inputs?

No. They power external devices and are not for input voltage

42
New cards

Default state of GPIO 0-8

High, with a pullup resistor

43
New cards

Default state of GPIO 9-27

Low, with a pulldown resistor

44
New cards

Default internal pullup/pulldown value

About 50 kohm (weak)

45
New cards

Pullup value on GPIO 2 and 3

1.8 kohm, to meet the I2C spec

46
New cards

Typical external pullup/pulldown value

About 10 kohm; a stronger external resistor overrides the internal one

47
New cards

50 kohm pullup in parallel with 10 kohm

8.33 kohm

48
New cards

Max current for one GPIO

16 mA

49
New cards

Max current per pin when using multiple GPIOs

3 mA per I/O

50
New cards

Total GPIO current limit

Stay below about 51 mA (17 outputs at 3 mA each)

51
New cards

What happens if you overdrive the RP4 GPIOs?

The RP4 may reboot due to voltage drop

52
New cards

Ways to debounce a switch

Analog RC filter (0.1 uF capacitor), buffering, digital logic (cross-coupled NANDs / SR latch), software

53
New cards

Output good practices: datasheet items to check

Current, voltage, and time constraints (setup, hold, period)

54
New cards

BJT LED driver: purpose of RB and RC

RB limits current drawn from the Pi; RC limits current through the LED

55
New cards

Python call to force a pulldown on an input

GPIO.setup(gpio_number, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

56
New cards

Extra capabilities some GPIOs have

PWM, I2C, serial ports, etc.

57
New cards

Primary function of the assembler

Convert readable assembly into binary machine code (.s files to .o files)

58
New cards

Why are assemblers multi-pass?

To resolve loop/label dependencies, variable name dependencies, register renaming and reordering

59
New cards

Linker

Combines multiple object files, resolves symbol references and relocates data sections

60
New cards

objcopy

Translates object output from one format to another

61
New cards

objdump

A disassembler that gives readable output of the final result

62
New cards

What does the compiler (GCC) take in?

A mix of assembly (.s), C files (.c), object files (.o) and library files to generate a combined executable with the linker

63
New cards

GCC

GNU C Compiler; common compiler for Linux and bare-metal systems

64
New cards

Bare metal

No operating system; the processor runs only the code the user wrote

65
New cards

EABI (Lecture 3)

Embedded Application Binary Interface; often used for bare-metal programming

66
New cards

ELF

Executable (and Linkable) Format; often used for assembly programs run in a Linux environment

67
New cards

What is the makefile?

A file read by the Make utility that describes how to build the program

68
New cards

What does Make do?

Controls generation of executables, uses the makefile as input, automatically uses the files it needs based on what changed, helps with file management, automates the build

69
New cards

Primary tools for assembly on the RP4 under Linux

GCC and GDB

70
New cards

GDB

GNU Project Debugger

71
New cards

Flag needed to debug with GDB

-g, e.g. as -g prog.s -o prog.o

72
New cards

GDB: set a breakpoint

b

73
New cards

GDB: run the program

r

74
New cards

GDB: show registers

i r

75
New cards

GDB: step

s (or s 100 for 100 steps)

76
New cards

Who coined "debugging"?

Admiral Grace Hopper, Harvard, 1940s, after a moth was found in the computer

77
New cards

Examples of IDEs

VSCode, Geany, Eclipse

78
New cards

What are flowcharts and pseudocode for?

Giving structure to a program: validate the algorithm, find key functions/macros, break a big job into chunks, divide work among teams, communicate with stakeholders

79
New cards

Flowchart characteristics

Symbolic/pictorial, too much detail is bad, hard to modify when large, fixed set of symbols, more straightforward to understand, best for smaller code jobs

80
New cards

Pseudocode characteristics

Natural text, flexible level of detail, easy to modify, open-world structure, can be more complex to follow, best for larger code jobs

81
New cards

Common flowchart symbols

Start/End, Input/Output, Process, Connector, Direction of flow, Decision/condition, Delay

82
New cards

When are flowcharts useful?

At the start of a project to think through architecture, and at the end to document the code

83
New cards

Advantage of pseudocode with real code

It can morph along with the code and become the comments

84
New cards

One hex digit equals how many bits?

4 bits (a nibble)

85
New cards

Convert from a base to base 10

Multiply each digit by base^position and add

86
New cards

Convert from base 10 to another base

Divide repeatedly by the base; remainders are the digits, least significant first

87
New cards

How many values can n bits encode?

2^n

88
New cards

Powers of 2 from 2^0 to 2^10

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024

89
New cards

2^10, 2^20, 2^30 approximately

1 thousand, 1 million, 1 billion

90
New cards

2^32

4,294,967,296 (about 4.3 billion)

91
New cards

Bit

Can be 1 or 0

92
New cards

Nibble

4 bits

93
New cards

Byte

8 bits

94
New cards

Half word

16 bits

95
New cards

Word

32 bits

96
New cards

Kilobit (Kb) vs kilobyte (KB)

Kb = 1024 bits; KB = 1024 bytes = 8192 bits

97
New cards

Megabyte (MB)

2^20 bytes = 1,048,576 bytes

98
New cards

Binary: 1 + 1

10 (2)

99
New cards

Hex: 0x0A + 0x08

0x12 (18)

100
New cards

Prefixes for binary and hex

Binary: % or 0b. Hex: $ or 0x