Microprocessor systems (week 2) Flashcards

1
Q

what are microprocessors?

A

Brain of mechatronic system. Processes the data and does all the arithmetic. In this module, only concerned with embedded microprocessors (human intervention not required, self starting, self contained)
e.g. Atmel ATMega family

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

What is the composition of microprocessors ?

A

1) Arithmetic and logic unit - ALU
2) Registers
3) Control unit
4) Buses

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

Microprocessor - What is/What does ALU?

A

-Performs mathematical/logic operations
-most important part when deciding computing power of microprocessor
-different types of ALUs;
1) 8, 16, 32, 64 bits
2) nb of cycles for operation
3) floating point vs fixed point.
MATHEMATICAL BRAIN OF COMPUTER. Handles all numerical operations ( adding, subtracting, incremental). It can build components out of logic gates

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

Microprocessor- What are registers ?

A

They are memory locations to store data WITHIN microprocessor

2 categories:

  • SPECIAL FUNCTION REGISTERS (SFRs), used to control the microprocessor itself or perform specific functions.
    SFRs include
    a) accumulator or working register (operands for ALU)
    b) Flag registers (contains info - code- about latest ALU operation)
    c) Program counter (controls flow of code)
    d) Instruction register (stores next instruction to be executed)
    e) stack pointer ( used to manage subroutines and interrupts)
  • GENERAL PURPOSE REGISTERS
    usually, memory locations available for the user.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Microcontroller- What are the two main architectures of memory in the microcontrollers ?

A

TWO MAIN ARCHITECTURES:
-Von Neumann ( data AND instructions -code- in same memory), called the SHARED MEMORY

  • Harvard ( memory split up between “data memory” and “code memory”.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Microcontroller - What are the common types of Memory ?

A

1) ROM:
‘read only’, data stored during manufacturing process, cannot be written by user, not lost when power removed
2) EEPROM
electrically erasable programmable ROM-can be written with special devices/procedures but not modified by code. Power removed and no lost content.
3) RAM :
‘ Random Access Memory’ Used to store temporary data, loses content when power is removed.

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

Microcontroller- what application of Memory LOCATIONS

A

ROM -> Firmware
EEPROM -> code
RAM-> User data

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

Microprocessor- CONTROL UNIT (CU), what is it?/ what does it do ?

A

Controls timing and sequence of operations (generates clocks for other components, fetches instructions from memory, executes instructions by controlling other units).

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

Microprocessor-CU- How the number of clocks varies upon CU architecture ?

A

1) CISC: Complex Instruction set computing- Each instruction can take more than one cycle time, and different instructions can have different amount of clock cycles ( cycle time VARIES)

RISC: Reduced Instruction set computing - All instruction takes a=FIXED amount of clock cycles. (1/2)

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

Microprocessor - BUSES, what are they ?

A

Just like real bus they transport elements, in this case, DATA.

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

What are the different types of buses ?

A

1) DATA BUS: transport a word (number of bits) from/to the CPU and the memory of the I/O peripherals

2) ADDRESS BUS: Selects memory location to load data from or store data in. Can also be used to address peripherals (only in specific architectures—memory-mapped I/O).

3) CONTROL BUS :
carries clocks signals to synchronize other units/ peripherals

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

Microcontrollers-peripherals-What are peripherals ?

A

They are devices to exchange data with the external world, also called PORTS

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

Microcontrollers-PERIPHERALS-what are the two main types of peripherals ?

A
  • DIGITAL I/O: Data is in BINARY form, each pin controls one bit. (0=low, 1=high).

-ANALOG I/O: data is a continuous voltage between 0 and a max value. Attached to one or more A/D converters inside microcontroller.

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

Microcontrollers-PERIPHERALS-what are the two main architectures of peripherals?

A

1) Memory-mapped I/O:
data from peripherals is mapped to SFRs, address bus used both for memory AND peripherals, code can access such data in the same way it does with memory locations.

2) Port-mapped I/O
A separate bus connect CPU with peripherals. CPU must have dedicated instructions to access I/O devices (REQUIRES CISC architecture).

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

Arduino platform-applications of Microcontrollers ?

A

used extensively in automotive
used in cost sensitive mechanical and electrical products. Their uses range from engine management systems, machine tools, chemical plant…consumer white goods (e.g washing machine & robotic vacuum cleaner, automatic camera, mobile phone, peripherals).

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

Arduino platform-Microcontroller type in this module, why?

A

They are several producers of microcontrollers. In this module, we focus on the Arduino platform. These are simple, cheap devices, with built in tech which allows user to reprogram many times over.

17
Q

Arduino Platform, what is it ??

A

Open-source computing platform. Based on simple microcontroller board+environment for writing software for the board. We will use Arduino Nano platform.

18
Q

Arduino platform. Why ?

A

1) LOW COST
2) CROSS PLATFORM: Runs on different operating systems (Windows, Macintosh OSX, Linux)
3) Simple programming environment :
easy-to-use for beginners. Flexible enough for advanced users
4) Open source/extensible software :
language can be expanded through C++ libraries.
5) The Arduino is based on Atmel’s ATMEGA8 AND ATMEGA168 microcontrollers.

19
Q

What Arduino programming language is based on ?

A

IT is based on Processing, a C-like language.

20
Q

Main features of Arduino programming?

A

1) every line ends with semicolon

2) every block running altogether is put in curly brackets

3) Every variable needs to be declared before being used and there are several types.

21
Q

Main features-What are the types of variables ?

A

3)
- Boolean :
-Binary (true/false, on/off, High/low)
-Char 8-bit signed number (-128, 127)
-byte 8-bit unsigned number (0-255)
-int or short 16-bit signed number
-word (unsigned int) 16 bit unsigned number
-long 32-bit signed number
-unsigned long 32-bit unsigned number
-float or double 32-bit floating point number

22
Q

Main features-What is the standard C constructs to control execution of code?

A

1) Conditional execution

if (condition)
(
//action to be executed when condition is true
)
else
(
//action to be executed when condition is false
)

2) REPEAT BLOCK OF CODE FOR N TIMES
for (I=1; I<=N ; I++)
(
//action to be repeated N times
)

3)REPEAT BLOCK UNTIL CONDITION IS FASE

While (condition)
(
//action to be repeated until condition ==FALSE
)
do
(
//action to be repeated until condition == FALSE
) while (condition)

23
Q

Features - What are some standard comparison and Boolean operators ?

A

== (equal to )
!= (not equal to)
&& (and)
I I (or)
! (not)

24
Q

Features, What are the instructions to read sensors ?

A

val = digitalRead(pin)

val= analogRead(pin). reads value from analogue pin, using a 10 bit A/D converter

val=pulseIn (pin, value, timeout). reads a pulse (high/low) on a pin. Val is the pulse length. E.G: if value = HIGH, waits for pin to go HIGH, starts timing and stop timing when it goes LOW. val =0 if no pulse in specified timeout

25
Q

Features, what are the instructions to WRITE on outputs ?

A

digitalWrite(pin, value)

analogWrite(pin, value). Generates square wave with specified duty cycle (value=0-255) until next writing.

tone(pin, frequency, duration). Generates square wave with specified frequency, 50% duty-cycle, on a pin.

26
Q

Features-insert delays instructions?

A

delay (ms) insert delay of ms
delayMicroseconds
millis (): return number of milliseconds since Arduino board began running current program
micros (): // microseconds //

27
Q

Features - MAIN STRUCTURE

A

definition of labels (declaration of pins)
initialisation (void setup)
void loop (main program)