Parts of a GP Computer
(Microcomputer)
Contains separate
●
Microproces
sor(s)
● Memory
● Peripheral
(I/O) device
HW
• serial
port
• parallel
port
• USB
EMB - AVR port
11
www.protussystems.com •
Introducing Microcontrollers
A microprocessor is a central processing unit
(CPU) on a single chip.
When a microprocessor and associated
support circuitry, peripheral I/O components
and memory (program as well as data) were
put together to form a small computer
specifically for data acquisition and control
applications, it was called a microcomputer.
EMB - AVR 22
www.protussystems.com
Introducing Microcontrollers
When the components that make a
microcomputer were put together on a single
chip of silicon, it was called the microcontroller.
EMB - AVR 33
www.protussystems.com
Microcontrollers
Click to edit Master text styles
Second level
● Third level
● Fourth level
● Fifth level
A microcontroller
interfaces to external EMB - AVR 44
devices with a
www.protussystems.com
How does a Microcomputer
differ from a Microcontroller?
EMB - AVR 55
www.protussystems.com
Protus “motherboard”
EMB - AVR 66
www.protussystems.com
How does a Microcomputer
differ from a Microcontroller?
Microcontroller
“1-chip” solution (monolithic)
Built-in components (depending on variant)
● Microprocessor
● Memory: RAM/SRAM, EEPROM/EPROM/PROM/ROM
● Peripheral devices
– serial/parallel ports
– digital I/O ports
– Analog/Digital converter
– Timer/Counter
EMB - AVR 77
www.protussystems.com
Inside an IC package
CS-280 88
Dr. Mark L. Hornick
Inside an IC package
Click to edit Master text styles
Second level
● Third level
● Fourth level
● Fifth level
CS-280 99
Dr. Mark L. Hornick
What does AVR RISC mean?
The acronym AVR has been reported to stand for:
Advanced Virtual RISC and also for the chip's designers:
Alf-Egil Bogen and Vegard Wollan who designed the basic
architecture at the Norwegian Institute of Technology.
RISC stands for reduced instruction set computer.
CPU design with a reduced instruction set as well as a
simpler set of instructions (like for example PIC and AVR)
EMB - AVR 1010
www.protussystems.com
A little history
The PIC (Programmable Interrupt Controller) appeared around 1980.
→ 8 bit bus
→ executes 1 instruction in 4 clk cycles
→ Harvard architecture
AVR (1994)
→ 8 bit bus
→ one instruction per cycle
→ Harvard architecture
EMB - AVR 1111
www.protussystems.com
AVR 8-Bit RISC High Performance
True single cycle execution
→ single-clock-cycle-per-instruction execution
→ PIC microcontrollers take 4 clock cycles per instruction
One MIPS (mega instructions per second) per MHz
→ up to 20 MHz clock
32 general purpose registers
→ provide flexibility and performance when using high level languages
→ prevents access to RAM
Harvard architecture
→ separate bus for program and data memory
EMB - AVR 1212
www.protussystems.com
AVR 8-Bit RISC Low Power
Consumption
1.8 to 5.5V operation
→ will use all the energy stored in your batteries
A variety of sleep modes
→ AVR Flash microcontrollers have up to six
different sleep modes
→ fast wake-up from sleep modes
Software controlled frequency
EMB - AVR 1313
www.protussystems.com
AVR 8-Bit RISC Compatibility
AVR® Flash microcontrollers share a single core
architecture
→ use the same code for all families
→ 1 Kbytes to 256 Kbytes of code
→8 to 100 pins
→ all devices have
Internal oscillators
EMB - AVR 1414
EMB - AVR
AVR
Modern RISC architecture: Compact and FAST.
Tuned for high level languages.
Consistent architecture across entire line.
Small AVR are subsets of larger chips: Same hardware and code
works across all chips.
I/O structure reduces need for external components.
Flash based, ultra trivial downloading of code.
EMB - AVR 1515
www.protussystems.com
AVR RISC Architecture
Single Cycle Instructions: 8mhz = 8mips.
Large register file (32).
Every register an accumulator.
3 index register pairs
Register & IO are mapped in SRAM space.
EMB - AVR 1616
www.protussystems.com
Typical Hardware Support
Internal or External Oscillator/Clock
Brown Out Detector
One or more timers
Two or more PWM
One or more USART
I2C
EMB - AVR 1717
www.protussystems.com
Tools
Atmel Studio: IDE & Simulator/debugger.
BASCOM: Basic compiler & IDE with programmer.
GNU C compiler (free, very high quality).
Third party C compilers vary from cheap to very expensive.
FLASH programmers are trivial to make.
EMB - AVR 1818
www.protussystems.com
Typical Hardware Support
t Real time clock
t 10bit ADC
t Analog Comparator
t External interrupts
t Pulse timing capture
t EEPROM
t USB/CAN/RF
EMB - AVR 1919
www.protussystems.com
AVR Architecture
Click to edit Master text styles
Second level
● Third level
● Fourth level
● Fifth level
EMB - AVR 2020
www.protussystems.com
Atmel Atmega32
l Central Processing Unit
l Arithmetic Logic Unit (ALU)
performs the actual arithmetic,
logical, and bit-functions
l Memory – SRAM, EEPROM,
Flash, etc.
l Clock circuit – internal/external
l I/O – Input/Output; video, serial,
parallel, USB, SCSI, etc.
CS-280 2121
Dr. Mark L. Hornick
EMB - AVR 2222
www.protussystems.com
Atmel Atmega32 highlights
An 8-bit microcontroller
Native data size is 1 byte
16-bit data addressing
Up to 64 kB data memory can be accessed
3 separate on-chip memories (Harvard architecture)
2KB SRAM (for data)
1KB EEPROM (for persistent data storage)
32KB Flash organized in 16-bit words (16KWords) for program code
I/O ports A-D
Digital input, output
Analog input
Serial/Parallel
Pulse accumulator
EMB - AVR 2323
www.protussystems.com