1/124
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
True or False: Microcontrollers are normally less expensive than microprocessors.
True
When comparing a system board based on microcontroller and a general-purpose microprocessor, which one is cheaper?
A microcontroller-based system
A microcontroller normally has which of the following devices on chip:
(A) RAM (B) ROM (C) I/O (D) ALL OF THE ABOVE
(D)
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)
An embedded system is also called a dedicated system. Why?
It is dedicated because it does only one type of job.
What does the term embedded system mean?
Embedded system means that the application and the processor are combined into a single system.
List some of the 8-bit microcontrollers
AVR, PIC, 8051, HCS08
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.
The AVR is a(n) -bit microprocessor
8
Name the different groups of the AVR chips
Which group of AVR has smaller packages?
tiny
Give the size of RAM in each of the following:
(A) ATmega32 (A) ATtiny25
(A) 2K bytes (B) 128 bytes
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
TRUE or FALSE: The I/O registers are used for storing data?
False
The GPRs together with I/O registers and SRAM are called ________.
Data memory
The I/O registers in the AVR are_______-bit
8
The data memory space in AVR is divided into _______ parts
3
The data memory space in the AVR can have a maximum of _____ bytes
64K
The standard I/O memory space in AVR is _______ bytes.
64
Write an instruction to copy the value 0x34 into the R29 register.
LDI R29, 0x34
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
True or False: No value can be moved directly into the GPRs.
False
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.
The vast majority of registers in the AVR are __ bit
8
True or False: No value can be loaded directly into internal SRAM.
True
Write instructions to load value 0x95 into the SPL I/O register.
LDI R20, 0x95
OUT SPL, R20
Write instructions to add 2 to the contents of R18.
LDI R19, 2
ADD R18, R19
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
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
"ADD R16, R3" puts the result in _____
R16
What does "OUT OCR0A, R23" do?
It copies the contents of R23 into the OCR0A I/O register.
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).
The flag register in the AVR is called __________________.
SREG
What is the size of the flag register in the AVR
8 bits
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)
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)
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)
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.
____ are translated by the assembler into machine code, whereas ______ are not
The instruction mnemonics, pseudo-instructions
True or False: Assembly language is a high level language.
False
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)
Pseudo-instructions are also called ________
Assembler directives
True or False: Assembler directives are not used by the CPU itself. They are simply a guide to the Assembler.
True
Which one of these is an assembler directive?
(A) LDI R16,0x25
(B) ADD R23, R19
(C) .ORG 0x500
(D) JMP HERE
(C)
Give two ways for hex data representation in the AVR assembler.
.EQU DATA1 = 0x9F
.EQU DATA2 = $9F
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
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.
Show the hex number value used by the following directives:
(A) .EQU ASC_DATA = '4'
(B) .EQU MY_DATA=0B0001111
(A) $34 (B) $1F
Give the value in R22 for the following:
.EQU MYCOUNT = 15
LDI R22, MYCOUNT
15 in decimal (0x0F in hex)
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)
Give the value in data memory location 0x63 for the following:
.EQU MYDATA = 12
.EQU MYREG = 0x63
.EQU FACTOR = 0x10
LDI R19, MYDATA