Anda di halaman 1dari 12

Microprocessor based embedded systems Lecture 2: Meet the Microcontroller

Dr Musharraf A Hanif

Overview of the Lecture


Review of the microprocessor (P) Introduction to the microcontroller (C) Summary of the difference between C and P Introduction to the STM32F100RB Accessing the peripherals

by Dr. Musharraf A Hanif

Review of the Microprocessor

Consists of a CPU on a single piece of silicon.


Capable of processing data based on the provided set of instructions Typical instruction set

Arithmetic instructions Logical instructions Load / store / move instructions Conditional execution and branch instructions

Interfaces with I/O peripherals and memory modules through one or more data and address busses

Intels 80x86 and Motorolas 680x0 are two widely used microprocessor families.
3 by Dr. Musharraf A Hanif

Review of the Microprocessor (Cont.)

MICROPROCESSOR

by Dr. Musharraf A Hanif

Meet the Microcontrollers

In a single package

CPU Volatile memory (RAM) Non-volatile memory (Flash) Peripherals


General purpose I/O (GPIO) Timers External interrupts Serial I/O (SPI, I2C, UART, etc) Pulse width modulator A/D or D/A converters EEPROM
by Dr. Musharraf A Hanif

Some Widely Used Microcontrollers

The 8051 Family

8-bit CPU CISC, 128 / 256 byte RAM (can be extended by an external data bus in some cases), various combination of peripherals 8-bit CPU RISC, 138 bytes to 4 kbyte internal RAM, various combination of peripherals 16 and 32-bit versions also exist

The Microchip PIC Family


The Atmel AVR Family

8-bit CPU RISC, upto 16 kbyte internal RAM, various combination of peripherals

by Dr. Musharraf A Hanif

Microprocessor vs. Microcontroller

Microcontroller designed for low cost and low power applications. Feature on board data and program memories. Feature a lot of onboard peripherals for interfacing with the outside world.

by Dr. Musharraf A Hanif

The STM32F1 Family

Wide range of microcontrollers based on the ARMs Cortex-M3 cores. Cortex-M3 features:

32 bit ARMv7-M RISC architecture Thumb-2 instruction set with 32 bit hardware multiply and divide. 3-stage pipeline with branch speculation 1 to 240 physical interrupts connected through a Nested Vector interrupt controller (NVIC) 12 cycle interrupt latency Integrated sleep modes 1.25 DMIPS/MHz 24-bit Systick timer
by Dr. Musharraf A Hanif

The STM32F100RB

24 MHz Cortex-M3 core 8kByte SRAM, 128kByte flash 51 high speed I/O Pins 7 x 16-bit timers 2 x Watchdog timers 1 x RTC 16 channel 12 bit ADC 2 channel 12 bit DAC 2 x SPI 2 x I2C 3 x USART 1 x CEC (Consumer Electronics Control) PLL DMA
by Dr. Musharraf A Hanif

10

The STM32F100RB

by Dr. Musharraf A Hanif

Accessing the Peripherals

Special function registers (SFRs) or peripheral registers. Memory mapping of these registers. Best place to find information about the peripherals and their registers

User or reference manual (from the C manufacturer) Data sheet (from the C manufacturer)

Example: How to configure a pin as input.

11

by Dr. Musharraf A Hanif

Quick Review

12

by Dr. Musharraf A Hanif

Anda mungkin juga menyukai