Beruflich Dokumente
Kultur Dokumente
Serial communication
Interrupts
2
Course Goals
At the end of this course, you should be able to:
Understand the architecture of one of the most popular
microcontroller (MCU) families
Use an integrated development environment (IDE) to program and
debug an MCU
Program an MCU using Assembly language
Understand and use peripherals integrated into an MCU
Interface an MCU to simple external components
Understand and use interrupts
Use timers in various modes
Communicate using a serial interface
Understand and use analog to digital converters (ADC), digital to
analog converters (DAC) and comparators
3
Course Prerequisites
A course in Electric Circuits that includes understanding
basic electronic components such as resistors, capacitors,
diodes and transistors
4
The 8051 Architecture
Memory organization
5
Microprocessors and Microcontrollers
Microprocessor: general-purpose CPU
Emphasis is on flexibility and performance
Generic user-interface such as keyboard, mouse, large display, etc.
Used in PCs, server systems, cell phones, etc.
6
Microcontroller Architectures
Microcontroller architecture refers to the internal hardware
organization of a microcontroller
8
Harvard and von Neumann Architectures
Harvard Architecturea type of computer architecture
where the instructions (program code) and data are stored
in separate memory spaces
Example: Intel 8051 architecture
9
Example System: RC Car
Antenna Antenna
Front Electric
Forward RF
Microcontroller RF Receiver Microcontroller Motor (Left/Right)
Transmitter
Reverse
12
Block Diagram of the Original 8051
/INT0 /INT1 T0 T1
Other
interrupts
8051 CPU
From Crystal
Oscillator or RC ALE /PSEN P3 P2 P1 P0 TxD RxD
network (Address/data)
13
Block Diagram of the Silicon Labs 8051
14
Memory Organization of the SiLabs 8051
The memory
organization of
C8051F040 is
similar to that of
a standard 8051
Program and
data memory
share the same
address space
but are
accessed via
different
instruction types
15
Program Memory of the SiLabs 8051
FLASH memory
Can be reprogrammed in-circuit
Provides non-volatile data storage
Allows field upgrades of the 8051
firmware
The special function registers (SFR) are accessed when the direct addressing mode is
used to access the upper 128 bytes of memory locations from 0x80 to 0xFF
The general purpose RAM are accessed when indirect addressing is used to access the
upper 128 bytes
The first 32 bytes of the internal data memory are addressable as four banks of 8 general
purpose registers
The next 16 bytes are bit-addressable or byte-addressable
17
Lower 128Register Banks and RAM
18
Program Status Word - PSW
19
Special Function Registers (SFRs)
SFRs provide control and data exchange with the microcontrollers resources
and peripherals
Registers which have their byte addresses ending with 0H or 8H are byte- as
well as bit- addressable
Some registers are not bit-addressable. These include the stack pointer (SP)
and data pointer register (DPTR)
20
Summary of 8051 SFRs
Accumulator (ACC) and B register
ACC (also referred to as A) is used implicitly by several instructions
B is used implicitly in multiply and divide operations
These registers are the input/output of the arithmetic and logic unit (ALU)
Stack pointerSP
Data pointerDPTR (DPH and DPL)
16-bit register used to access external code or data memory
22
www.silabs.com/MCU