4. The cortex M3 microcontroller Flashcards

1
Q

What is high performance 32 bit RISC CPU?

A

Uses a reduced instruction set computer (RISC) processor with most instructions executing in a single CPU cycle.

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

What is the opposite of RISC? and what is most common in embedded systems, why?

A

CISC - complex instruction set computer. RISC processors tend to be simper, consume less power and be faster. RISC is dominant in embedded systems.

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

What is an example of the use of CISC?

A

In order to maintain x86 compatibility, intel’s processors (eg Atom) are CISC.

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

What does 32 bit mean?

A

32 bit means the microcontroller can carry out operations on 32 bit wide packets of data. Instructions aren’t necessarily 32 bit wide.

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

What type of bugging does the Cortex M3 use?

A

Advanced debugging with coresight - the cortex m3 allows a low-cost debugger to step through the program slowly, set break points and view the content of memory on the fly (without halting the program).

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

How much memory can the cortex m3 address?

A

Up to 4G of memory. The SAM3X8E has 2-256 Kbytes of flash memory, which is mainly used to store the program, though it can also be used to store data. It also has 96 Kbytes of SRAM, organised as 64 Kbytes SRAM0 and 32 Kbytes SRAM1.

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

What is interrupt handling?

A

An ‘interrupt’ causes the mC to stop what it is doing, carry out an urgent task, then return to its original operation. For example, do this while the button is not pressed, if the button gets pressed do this and then return to what you were doing before.

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

What are the different clocks used by the mC?

A

Fast - used for the system in normal operation (84 MHz)
Intermediate - 4-12MHz, used for ast start-up mode, and generating the fast clock signal
Slow - used in backup mode (very low power). Exactly 32.768KHz if using a crystal

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

What are the types of oscillators that can be used to create the clocks?

A

External quartz crystal - used when accuracy is important e.g. a real clock.
Internal oscillator - cheap (free!) and saves 2 pins, accuracy about 3%

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

What is power saving back-up mode?

A

Many systems spend most of their time doing nothing (e.g. a remote control) so it is useful if they can ‘go to sleep’. The purpose of back up mode is to achieve the lowest power consumption possible in a system which is performing periodic wake-ups to perform tasks but not requiring fast start up time (

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

What are WAKE and SLEEP modes?

A

these use more power than backup (current >= 15 microAmps) but which start up much more quickly (=10 microSecs)

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

What is the voltage supply tolerance in the SAM3X/A series?

A

Wide voltage supply tolerance - supports a 1.62-3.6 V single supply mode.

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

What is an ADC?

A

An analog to digital converter - converts an external voltage into a digital value, which the mC can process. There are 16 channels (different inputs) and the offset and gain of each can be varied.

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

What is a DAC?

A

Digital to analog converter, this is the other way around and has 2 channels

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

what is PWM?

A

Pulse width modulation - 8 channels with 16 bit accuracy. Useful for controlling analog devices (eg motors, lights)

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

How many pins?

A

The package has 144 pins. Each can be selected to be either an input or an output (I/O) and this can be changed while the device is operating.

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

What are general purpose I/O lines?

A

these are managed by parallel input/output controllers (PIO) and have a number of useful modes.

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

What are the modes of GPIO?

A

(general purpose I/O lines)

  1. Input schmitt triggers
  2. Debouncing
  3. Built in pull-up resistors
19
Q

What are input schmitt triggers?

A

many events are triggered by a rising or falling signal, eg from an analog sensor. If you are not careful the system can oscillate. The schmitt trigger can be used to clean up noisy signals: DRAW DIAGRAM.

20
Q

What is debouncing?

A

An input from a switch is often used (eg keyboard), but the signal is generally noisy and the switch may appear to change several times. The mC will automatically clean this up if requested.

21
Q

What forms of external connectivity are supported for the mC?

A

USB, ethernet, SPI, CAN, I2C

22
Q

How many timers does the mC have?

A

9

23
Q

Examples of uses of timers as inputs and outputs?

A

Timing inputs - when are 2 clicks of a mouse a doubleclick?
Frequency of inputs - a speedometer might count the frequency of pulses produced when a wheel rotates
Timing processes - the length of a wash in a washing machine
Generating given frequencies - different tones for tuning a guitar
Generating regular waveforms - control power to a heater or lamp using pulse width modulation

24
Q

What is the 3 stage pipeline for the SAM3X?

A
  1. Fetch - the next instruction is read from memory
  2. Decode - turns the instruction into a set of signals that drive the ALU
  3. Execute - actually carry out instruction
    Each happens once per clock tick
25
Q

what are CPU registers?

A

Registers used by the CPU for any kind of data processing such as addition or multiplication

26
Q

How is a register used?

A

Data has to be loaded into the register from the main memory, then the command is executed leaving the result in the register. Finally the result is moved back to main memory.

27
Q

Name/describe some special registers?

A

MSP: Main Stack Pointer - points to region of memory used for temporary data
LR: Link Register - stores return address on subroutine call
PC: program counter - address of next instruction
PSR: program status register - details later

28
Q

How many bits in the PSR? How are various status flags stored within the PSR?

A

32 bit, not all of which are currently used. SEE DIAGRAM

29
Q

What do N,Z,C and V stand for in program status register?

A

N - negative or less than flag: 0=operation results was positive, zero, greater than or equal
1= operation result was negative or less than
Z - zero flag: 0=operation result was not zero, 1=operation result was zero
C - Carry or borrow flag:
did add or subtract result in a carry bit?
V - overflow flag: did the operation result in an overflow?

30
Q

How is the memory space in the cortex m3 divided?

A

SEE DIAGRAM

31
Q

What is a binary digit?

A

a bit which hold the value 0 or 1

32
Q

How many bits in a byte?

A

8 bits in a byte

33
Q

What is the range of a byte?

A

from 00000000 to 11111111. In decimal this is the range of 0 to 255.

34
Q

How else can the value of a byte be interpreted?

A

to mean -128 … 127.

35
Q

What is the smallest unit that can be processed in most computers?

A

a byte

36
Q

How can a byte be divided?

A

Into 2 units of 4 bits, known as nibbles.. a nibble can range from 0000 to 1111 = 0 to 15 (decimal)

37
Q

How does hexadecimal (hex) notation work?

A

Each digit has a range of 16, values 0…15 in decimal, written 0-9 with A-F for 10-15. A prefix 0x is often used to indicate hex. One hex digit holds the value in a nibble 0000..1111 = 0x0…0xF. Thus the contents of one byte lie in the range 0x00…0xFF

38
Q

Max an min values of a 32bit number (4 bytes) as an 8digit hex number:

A

Min value: 0x00000000= 0(decimal)

Max value: 0xFFFFFFFF= 2^(32)-1 = 4G.

39
Q

What is memory mapped input and output viewed from the outside?

A

Digital input and output takes place through the pins that form ‘ports’ A to D. (number of pins: 30, 32, 32, 11)

40
Q

What is memory mapped input and output?

A

The input and output ports look like ordinary memory addresses to a program, with addresses like any other memory location Thus the ports can be accessed by reading and writing to the correct memory locations.

41
Q

What does reading a pin do?

A

Reading a pin returns the value on the pin of the mC, not a number that has been stored in memory

42
Q

What does writing do?

A

Writing or storing a bit in one of these locations puts the values on the pins of the mC if they are configured as outputs:
- a bit of 0 causes the mC to drive the pin to ground, VSS=0V
- a bit of 1 causes the mC to drive the pin to VDD (positive eg +3V)
SEE DIAGRAM

43
Q

What is an RISC?Compare with CISC?

A

RISC (reduced instruction set computer) is a microprocessor that is designed to perform a smaller number of types of computer instructions so that it can operate at a higher speed. Since each instruction type that a computer must perform requires additional transistors and circuitry, a larger list or set of computer instructions tends to make the microprocessor more complicated and slower in operation.

44
Q

Can you compare a 32 bit processor with an 8 bit processor?

A

A 32 bit processor can deal with 4* as much data in a single clock cycle than an 8 bit processor. For example, an 8 bit processor can deal with integers >255 but this will require 2 or more bytes to hold the data and several clock cycles to manipulate such data, since only 8 bits can be handled in a single step. This means that the 32 bit processor is faster than the 8 bit processor. Also the code is shorter and simpler for a 32 bit processor. Floating point numbers require at least 32 bits and so can be handled much more simply and quickly using a 32 bit processor.