Embedded Applications Midterm Study

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

1/148

encourage image

There's no tags or description

Looks like no tags are added yet.

149 Terms

1
New cards

True or False: Microcontrollers are normally less expensive than microprocessors.

True

2
New cards

When comparing a system board based on microcontroller and a general-purpose microprocessor, which one is cheaper?

A microcontroller-based system

3
New cards

A microcontroller normally has which of the following devices on chip:

(A) RAM (B) ROM (C) I/O (D) ALL OF THE ABOVE

(D)

4
New cards

A general-purpose microprocessor normally needs which of the following devices attached to it?

(A) RAM (B) ROM (C) I/O (D) ALL OF THE ABOVE

(D)

5
New cards

An embedded system is also called a dedicated system. Why?

It is dedicated because it does only one type of job.

6
New cards

What does the term embedded system mean?

Embedded system means that the application and the processor are combined into a single system.

7
New cards

List some of the 8-bit microcontrollers

AVR, PIC, 8051, HCS08

8
New cards

Name three features of the AVR

64K of RAM space, 8M of on-chip ROM, a larger number of I/O pins, ADC, and different serial protocols such as SPI, USART, I2C, ect.

9
New cards

The AVR is a(n) -bit microprocessor

8

10
New cards

Name the different groups of the AVR chips

- tiny

- mega

- xmega

- classic

- special purpose

11
New cards

Which group of AVR has smaller packages?

tiny

12
New cards

Give the size of RAM in each of the following:

(A) ATmega32 (A) ATtiny25

(A) 2K bytes (B) 128 bytes

13
New cards

Give the size of the on-chip program ROM in each of the following

(A) ATtiny84 (B) ATmega328 (C) ATtiny25

(A) 8K bytes (B) 32K bytes (C) 2K bytes

14
New cards

TRUE or FALSE: The I/O registers are used for storing data?

False

15
New cards

The GPRs together with I/O registers and SRAM are called ________.

Data memory

16
New cards

The I/O registers in the AVR are_______-bit

8

17
New cards

The data memory space in AVR is divided into _______ parts

3

18
New cards

The data memory space in the AVR can have a maximum of _____ bytes

64K

19
New cards

The standard I/O memory space in AVR is _______ bytes.

64

20
New cards

Write an instruction to copy the value 0x34 into the R29 register.

LDI R29, 0x34

21
New cards

Write an instruction to add the values 0x16 and 0xCD. Place the result in the R19 register.

LDI R18, 0x16

LDI R19, 0xCD

ADD R19, R18

22
New cards

True or False: No value can be moved directly into the GPRs.

False

23
New cards

What is the largest hex value that can be moved into an 8-bit register? What is the decimal equivalent of that hex value?

FF hex and 255 in decimal.

24
New cards

The vast majority of registers in the AVR are __ bit

8

25
New cards

True or False: No value can be loaded directly into internal SRAM.

True

26
New cards

Write instructions to load value 0x95 into the SPL I/O register.

LDI R20, 0x95

OUT SPL, R20

27
New cards

Write instructions to add 2 to the contents of R18.

LDI R19, 2

ADD R18, R19

28
New cards

Write instructions to add the values 0x16 and 0xCD. Place the results in location 0x400 of the data memory.

LDI R20, 0x16

LDI R21, 0xCD

ADD R20, R21

29
New cards

What is the largest hex value that can be moved onto a location in the data memory? What is the decimal equivalent of the hex value?

FF in hex or 255 in decimal

30
New cards

"ADD R16, R3" puts the result in _____

R16

31
New cards

What does "OUT OCR0A, R23" do?

It copies the contents of R23 into the OCR0A I/O register.

32
New cards

What is wrong with "STS OCR0A, R23"? What does it do?

The OCR0A presents the I/O address of the OCR0A register($27); but we should use the data memory address while using the STS instruction. The instruction copies the contents of R23 into the location with the data memory address of $27 (the DDRC I/O register).

33
New cards

The flag register in the AVR is called __________________.

SREG

34
New cards

What is the size of the flag register in the AVR

8 bits

35
New cards

FIND the C,Z, and H flag bits for the following code:

LDI R20, 0x9F

LDI R21, 0X61

ADD R20, R21

(C = 1), (H = 1), and (Z = 1)

36
New cards

FIND the C, Z, and H flag bits for the following code:

LDI R17, 0x82

LDI R23, 0x22

ADD R17, R23

(C = 0), (H = 0), and (Z = 0)

37
New cards

FIND the C, Z, and H flag bits for the following code:

LDI R20, 0x67

LDI R21, 0x99

ADD R20, R21

(C = 1), (H = 1), and (Z = 1)

38
New cards

What is the purpose of pseudo-instructions?

The real work is performed by instructions such as LDI and ADD. Pseudo-instructions, also called assembly directives, instruct the assembler in doing its job.

39
New cards

____ are translated by the assembler into machine code, whereas ______ are not

The instruction mnemonics, pseudo-instructions

40
New cards

True or False: Assembly language is a high level language.

False

41
New cards

Which of the following produces opcode? list all that do

(A) LDI R16,0x25

(B) ADD R23, R19

(C) .ORG 0x500

(D) JMP HERE

All except (C)

42
New cards

Pseudo-instructions are also called ________

Assembler directives

43
New cards

True or False: Assembler directives are not used by the CPU itself. They are simply a guide to the Assembler.

True

44
New cards

Which one of these is an assembler directive?

(A) LDI R16,0x25

(B) ADD R23, R19

(C) .ORG 0x500

(D) JMP HERE

(C)

45
New cards

Give two ways for hex data representation in the AVR assembler.

.EQU DATA1 = 0x9F

.EQU DATA2 = $9F

46
New cards

Show how to represent decimal 99 in formats: (A) hex, (B) decimal, and (C) binary in the AVR assembler.

.EQU DATA1 = 0x99

.EQU DATA2 =99

.EQU DATA3 = 0b10011001

47
New cards

What is the advantage in using the .EQU directive to define a constant value?

If the value is to be changed later, it can be done once in one place instead of at every occurrence.

48
New cards

Show the hex number value used by the following directives:

(A) .EQU ASC_DATA = '4'

(B) .EQU MY_DATA=0B00011111

(A) $34 (B) $1F

49
New cards

Give the value in R22 for the following:

.EQU MYCOUNT = 15

LDI R22, MYCOUNT

15 in decimal (0x0F in hex)

50
New cards

Give the value in data memory location 0x200 for the following:

.EQU MYCOUNT = 0x95

.EQU MYREG = 0x200

LDI R22, MYCOUNT

STS MYREG, R22

value of location 0x200 = (0x95)

51
New cards

Give the value in data memory location 0x63 for the following:

.EQU MYDATA = 12

.EQU MYREG = 0x63

.EQU FACTOR = 0x10

LDI R19, MYDATA

ADD R19, FACTOR

STS MYREG, R19

$0C + $10 = $1C will be in data memory location $63

52
New cards

True or False: The Atmel Studio IDE and Windows Notepad text editor both produce ASCII files.

True

53
New cards

True or False: The extension for the source file is "asm".

True

54
New cards

Which of the following files can be produced by a text editor?

(A) myprog.asm (B) myprog.obj (C) myprog.hex

(D) myprog.lst

(A)

55
New cards

Which of the following files is produced by an assembler?

(A) myprog.asm (B) myprog.obj (C) myprog.hex

(D) myprog.lst

(B), (C), and (D)

56
New cards

In the AVR, the program counter is, at most, ______ bits wide.

22

57
New cards

True or False: Every member of the AVR family, regardless of the program ROM size, wakes up at memory $0000 when it is powered up.

True

58
New cards

At what ROM location do we store the first opcode of an AVR program?

0x0000

59
New cards

The instruction "LDI R20, 0x44" is a _____ byte instruction

2

60
New cards

The instruction "JMP label" is a _____ byte instruction

4

61
New cards

True or False: All the instructions in the AVR are 2 or 4 byte instructions.

True

62
New cards

What do RISC and CISC stand for?

RISC (Reduced Instruction Set Computer) and CISC (Complex Instruction Set Computer).

63
New cards

True or False: The CISC architecture executes the vast majority of its instructions in 2, 3, or more clock cycles, while RISC executes them in one clock.

True

64
New cards

RISC processors normally have a ______ (large, small) number of general-purpose regesters.

Large

65
New cards

True or False. Instructions such as "ADD R16, ROMmemory" do not exist in RISC microcontrollers such as the AVR.

True

66
New cards

How many instructions does the ATmega have?

Around 130

67
New cards

True or False: While CISC instructions are of variable sizes, RISC instructions are all the same size.

True

68
New cards

Which of the following operations do not exist for the ADD instruction in RISC?

(A) register to register (B) immediate to register (C) memory to memory

(C)

69
New cards

True or False: Harvard architecture uses the same address and data buses to fetch both code and date.

False

70
New cards

The mnemonic BRNE stands for

branch if not equal

71
New cards

True or False: "BRNE back makes the decision based on the last instruction affecting the Z flag

True

72
New cards

"BRNE HERE" is a ____ byte instrcution

2

73
New cards

In "BREQ NEXT" which registers content is checked to see if its 0s

Z flag of SREG

74
New cards

JMP is a ___ byte instruction

4

75
New cards

True or False. In the AVR control can be transferred anywhere within. the 4M of code space by using the call instruction

True

76
New cards

The call instruction is a ____ byte instruction

4

77
New cards

True or False. In the AVR control can be transferred transferred anywhere within the 4M of code space by using the call instruction

False

78
New cards

With each CAL instruction the stack pointer register SP is _________

decrement

79
New cards

with each return instruction the SP is _____

incrmeent

80
New cards

on powerup the SP points to adress

0

81
New cards

How deep is the size of the stack in the AVR

as big as its ram memory

82
New cards

the RCALL instruction is a ____ byte instruction

2

83
New cards

______ (RCALL, CALL) takes more ROM space

Call

84
New cards

True or false. In the AVR the machine cycle lasts 1 clock period of the crystal frequency

True

85
New cards

The minimum number of machine cycles needed to execute an AVR instruction is_______.

1

86
New cards

for question 2 what is the maximum number of cycles needed and for which instructions

4, CALL RET

87
New cards

FInd the machine cycle for a crystal frequency of 12MHZ

1/12 MHZ ? (idk about these)

88
New cards

question 5 is too long look it up if you care

:)

89
New cards

Trye or False in teh AVR the machine cycle lasts 6 clock periods of teh crystal frequecny

False (4 cycles)

90
New cards

Find the machine cycle for an AVR if the crystal frequency is 8 MHz

0.8 ms

91
New cards

TRUE or FALSE in the AVR the instruction fetching and execution are done at the same time

True

92
New cards

TRUE or FALSE JMP and RCALL will always take 3 machine cycles

TRUE

93
New cards

TRUE or FALSE the BRNE instruction will always take 2 cycles

False only if it branches to the target address

94
New cards

in unsigned byte by byte multiplication the product will be placed in registers

R1:R0

95
New cards

is "MUL r2, 0x10" a valid AVR instruction? explain

No because immediate addressing mode is not supported

96
New cards

In AVR, teh largest two numbers that can be multiplied are ____ and ____

255, 255

97
New cards

True or False the MUL instruction works R0 and R1 only

False

98
New cards

The instruction add r20, r21 places the result in ____

r20

99
New cards

Why is the following ADD instruction illegal? "Add r1, 0x04"

We cannot use immediate adressing mode with ADD

100
New cards

the instruction "sub R1, R2" places the result in ____

R1