Microcomputer Notes & Exam Study Guide

Jonathan Gan
4 min readFeb 24, 2020

This is an article Im writing as a rough means to study learn and go hard during this Exam 1 midterm tomorrow, I hope it helps and I hope you enjoy!

This will be updated overtime as the courses progresses, stay tuned.

Overview:

When deciding on a microprocessor to use for an application, if issues of cost, space, power, and rapid development are more critical than raw processing power then we would use a microcontroller.

AVR is a widely family of microcontrollers.

Arduino is a platform (hardware + IDE) that can be used for programming an embedded system.

Some Arduino Boards use AVR controllers.

In this Course we are learning how to code and run assembly on an Arduino. The Arduino we are using will be using the ATMEGA328P which is an 8-bit microcontroller based on AVR RISC architecture. It is the most popular of all AVR controllers as it is used in ARDUINO boards.

This is important to know so that we know how to interact with the pins, ports, and registers

According to the syllabus, the Exam 1 will cover:

  1. Introduction
  2. AVR Architecture and Assembly Language Programming
  3. Branch, Call, and Time Delay Loop
  4. AVR I/O Port Programming
  5. Arithmetic, Logic Instructions, and Programs

Introduction:

Numbering System in Computer Architecture
Component Breakdown of Internal Components
Pins of ATMEGA 32P AVR Mircocontroller

Sections covered leading up to the exam

AVR Architecture and Assembly Language Programming

Branch, Call, and Time Delay Loop

AVR I/O Port Programming

Arithmetic, Logic Instructions, and Programs

All Homework:

Quiz Notes:

Conceptual Questions

In AVR Assembly programming, you can only LDI in registers 16–31

FF is the largest hexadecimal value that can be loaded in an 8 bit register.

There is no difference between the two given instructions?
LDI R20,0x34 and LDI R20,$34

.DEC is not an assembler directive

The Instruction LDI R16, $255 is illegal

CISC: Complex Instruction Set Computer

RISC: Reduced Instruction Set Computer

The special function register in AVR is called I/O register.

The I/O registers are part of the data memory space.

The general purpose registers are part of the data memory space.

We can not load immediate values into the internal RAM directly.

The source file has the extension .asm

Not every source file must have .EQU and .ORG directives

The file with the .map extension is not downloaded into AVR Flash memory

In RISC architecture we can not have 1, 2, 3, or 4 byte instructions.

In CISC architecture instructions are not fixed in size.

Most instructions in RISC are executed in one cycle.

AVR is an 8 bit microcontroller

We have 32 GPRs in the AVR

The status register is a(n)8 bit register

Assembly language is a low level language

The flag register in the AVR is called the status register

“ADD R20, R1” puts the result in R20

The file with the extension .obj is the object file.

Application Questions

6. What is the result of the following code and where is it kept?

LDI R19, $25

ADD R19,$1F

8. What is the status of the C, H and Z flags after the following code?

LDI R20, 0xFF

LDI R21, 0xC4

ADD R20, R21

C=1, H=1, Z=0

9. What is the status of the C and H flags after the following code

LDI R20, 0x30

LDI R19, 0x05

SUB R20, R19

C=0, H=1

10. The value in data memory location 0x100 after we execute the following code is:

.EQU REG1 = 0x65

.EQU REG2 = 0x100

LDI R16, REG1

STS REG2, R16

0x65

Convert 35 hex to decimal.

Convert 35 decimal to binary

Convert 35 decimal to hex.

Summary:

So the topics this exam should cover include

  • Numbering system

Binary & Decimal

Decimal & Hex

Binary & Hex

  • Basic components of an AVR architecture microcontrollers
  • Memory
  • Basic Assembly programming for AVR

*Mid semester this class got switched to online due to Corona, I passed the class but things were different, when I am free I will add more of my notes*

Thank you again for reading and enjoying this journey with me!

Buy me coffee? https://ko-fi.com/jonngan

--

--

Jonathan Gan

A Software Engineer who explores for clarity and observes for inspiration