Professional Documents
Culture Documents
STM32 Peripherals PDF
STM32 Peripherals PDF
Peripherals
Agenda
09:00 Registration
09:30 Introduction to ST
09:40 STM32 Overview
09:45 ARM – an introduction to Cortex-M3
10:30 STM32 Cortex-M3 Core and System
11:30 Coffee
I/F
CPU Supply
FlashI/F
CPU Flash
FlashMemory Reg
72
72 MHz
MHz Memory Reg1.8V
1.8V
Flash
512kB POR/PDR/PVD
POR/PDR/PVD
512kBto tocome
come
2 x SPI e/o 2007
e/o 2007
72MHz)
(max72MHz)
Bus
Hi-SpeedBus
XTAL
XTALoscillators
oscillators
2 x I2C Up
Uptoto20kB
20kBSRAM
SRAM 32KHz
32KHz++4~16MHz
4~16MHz
LiteHi-Speed
JTAG/SW
JTAG/SWDebug
Arbiter(max
Debug 64kB
64kBto
tocome
comee/o
3 x USART Nested 2007
e/o Int.
Int.RC
RCoscillators
oscillators
Nestedvect
vectIT
ITCtrl
Ctrl 2007 32KHz
32KHz++8MHz
8MHz
Matrix//Arbiter
CAN2.0B 1x
1xSysTick
SysTickTimer
Timer PLL
PLL
ARMLite
20B
20BBackup
BackupRegs
Regs
USB 2.0 Full Speed
ARM
Matrix
DMA
DMA Reset
ResetClock
Clock
77Channels
Channels Control RTC
RTC//AWU
AWU
Control
(max 72MHz)
ITs Watchdog 2x
Watchdog 2xUSART/LIN
USART/LIN
Smartcard
Smartcard//IrDa
IrDa
32/49/80
32/49/80I/Os Window
I/Os WindowWatchdog
Watchdog Modem
ModemControl
Control
1x
1xSPI
SPI 2x
2x12-bit
12-bitADC
ADC 1x
1xSPI
SPI
16
16 channels//1Msps
channels 1Msps
1x
1xUSART/LIN
USART/LIN
Smartcard/IrDa
Smartcard/IrDa
2x 2
Modem-Ctrl
Modem-Ctrl Temp
TempSensor
Sensor 2xII2CC
Two SPIs: SPI1 on high speed APB2 and SPI2 on low speed APB1
Up to 18 MHz data rate in either Master or Slave modes
Full duplex and simplex synchronous transfers supported
Programmable data frame size: 8/16-bit transfer frame format selection
Programmable data order: MSB-first or LSB-first shifting
Programmable clock polarity & phase
Hardware or software nSS management
Interrupt/DMA request generation:
Tx Buffer Empty, Rx Buffer Not Empty, Bus Fault, Overrun
Hardware CRC support: CRC8 / CRC16-CCITT standard
MOSI
VDD
NSS
0xD739 MSB first
16-bit long
0xD739 LSB first
Master Slave
SCK SCK
MISO MISO
MOSI MOSI
VDD
NSS NSS
Full Duplex
Slave Slave
Full Duplex pin saving mode
Master Master
Slave Slave
Each device can be a unique
Enable SS output
capability master by enabling its NSS as
output and driving it low: all
SCK MISO MOSI NSS SCK MISO MOSI NSS other devices became slaves.
Master Slave
VDD VDD
R = 4.7 K
Master
1 2 3 4 5 6 78
MISO
SCK
MOSI
CS
SCK
VDD
Master Slave
Slave
SDA SDA address1
Master Slave
SCLK SCK
Rx MISO
Tx MOSI
USART NSS
SPI
Full Duplex
VDD
Ω
USART1 USART2
R = 10 K
Tx Tx
Half Duplex
USART
Tx
SCLK
USART
SIR Transmit Tx/ SW_Rx
SIR Receive
Decoder IrDA IN
Half Duplex
STM32 Seminar 8th October 2007 28
Controller Area Network (bxCAN)
PMA
Endpointx Buff 1
USB IP CPU
Endpointx Buff 0
I/F
CPU Supply
FlashI/F
CPU Flash
FlashMemory Reg
Up to 16 external channels 72
72 MHz
MHz Memory Reg1.8V
1.8V
Flash
512kB POR/PDR/PVD
POR/PDR/PVD
512kBto tocome
come
Embedded temperature sensor, e/o 2007
e/o 2007
72MHz)
(max72MHz)
Bus
+/-1.5° linearity with T°
Hi-SpeedBus
XTAL
XTALoscillators
oscillators
Up
Uptoto20kB
20kBSRAM 32KHz
SRAM 32KHz++4~16MHz
4~16MHz
LiteHi-Speed
JTAG/SW
JTAG/SWDebug
Arbiter(max
Debug 64kB
64kBto
tocome
comee/o
e/o Int.
Int.RC
RCoscillators
oscillators
Nested
Nestedvect
vectIT
ITCtrl 2007
2007 32KHz
Ctrl 32KHz++8MHz
8MHz
Matrix//Arbiter
1x
1xSysTick
SysTickTimer
Timer PLL
PLL
ARMLite
20B
20BBackup
BackupRegs
Regs
ARM
Matrix
DMA
DMA Reset
ResetClock
Clock
77Channels
Channels Control RTC
RTC//AWU
AWU
Control
(max 72MHz)
ITs Watchdog 2x
Watchdog 2xUSART/LIN
USART/LIN
Smartcard
Smartcard//IrDa
IrDa
32/49/80
32/49/80I/Os Window
I/Os WindowWatchdog
Watchdog Modem
ModemControl
Control
1x
1xSPI
SPI 2x
2x12-bit
12-bitADC
ADC 1x
1xSPI
SPI
16
16 channels//1Msps
channels 1Msps
1x
1xUSART/LIN
USART/LIN
Smartcard/IrDa
Smartcard/IrDa
2x 2
Modem-Ctrl
Modem-Ctrl Temp
TempSensor
Sensor 2xII2CC
ADC_IN0
Address/data bus
Up to
ANALOG MUX
. Ports 4
. Injected Channels Injected data registers
(4x12bits)
ADC_IN15 Up to
16
Regular Channels Regular data register
Temp Sensor (12bits)
Start
Start
Start Start
CHx
CHx
CHx
Stop CHx
..
. One channel ..
One channel .
Continuous conversion mode
Single conversion mode CHn
CHn
Stop
Multi-channels (Scan)
Multi-channels (Scan) Continuous conversion mode
Single conversion mode
5th trigger
4th trigger Note: Do not use discontinuous mode for both regular and
injected together. It can be used only for one group
Channel13 Channel14 Channel15 Channel0 Channel1 Channel2 channel
End of Conversion
1.5 cycles
7.5 cycles
7.5 cycles
13.5 cycles
SMPx[2:0]
- Oversampling of channel 7.
1.5 cycles 13.5 cycles 7.5 cycles 7.5 cycles 71.5 cycles 28.5 cycles 1.5 cycles
Right alignment
0 0 0 0 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Regular group
Left alignment
D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 0 0 0 0
Regular group
ADC_IN0
ADC_IN1
Analog Watchdog AWD
.
.
. Low Threshold Status Register
Temp Sensor
VREFINT
ConvertedValue_Tab[9]
Example: - Conversion of Regular group
Channel0 conversion result
- DMA triggered by End of Conversion
Channel1 conversion result
Temp Sensor
…
VREFINT
GPIO
Ports
…
ANALOG MUX
Up to 4 injected channels Up to 16 regular channels
ADC1 ADC2
Analog Analog
External event (Regular group) External event synchronization
EOC/JEOC
Note: Do not sample the same channel at the same time on each ADC
Conversion
ADC1 CH0 CH0
14 ADCCLK cycles
End of Conversion on ADC1
Sampling
ADC2 CH0 CH0 … CH0
Conversion
End of Conversion on ADC2
JEOC on ADC2
2nd Trigger 4th Trigger 6th Trigger 8th Trigger
ADC2 CH3 CH2 CH2 CH0 CH0 Note: For Regular Simultaneous mode, do
not sample the same channel at the
Regular simultaneous mode interrupted by the same time on each ADC
ADC2 CH11
Trigger for regular Injected alternate trigger
channels 2nd injected Trigger End of Injected Conversion on ADC2
I/F
CPU Supply
FlashI/F
CPU
features 72
72 MHz
MHz
Flash
FlashMemory
Memory Reg
Reg1.8V
1.8V
Flash
512kB POR/PDR/PVD
POR/PDR/PVD
512kBto tocome
come
Embedded low power RTC with e/o 2007
e/o 2007
72MHz)
(max72MHz)
Bus
Hi-SpeedBus
VBAT capability Up
Uptoto20kB
20kBSRAM
XTAL
XTALoscillators
32KHz
oscillators
SRAM 32KHz++4~16MHz
4~16MHz
LiteHi-Speed
JTAG/SW
JTAG/SWDebug
Arbiter(max
Debug 64kB
64kBto
tocome
comee/o
Dual Watchdog Architecture Nested
Nestedvect
vectIT
ITCtrl 2007
2007
e/o Int.
Int.RC
RCoscillators
32KHz
oscillators
Ctrl 32KHz++8MHz
8MHz
Matrix//Arbiter
Cortex-M3 SysTick Timer 1x
1xSysTick
SysTickTimer
Timer PLL
PLL
ARMLite
20B
20BBackup
BackupRegs
Regs
ARM
Matrix
DMA
DMA Reset
ResetClock
Clock
77Channels
Channels Control RTC
RTC//AWU
AWU
Control
(max 72MHz)
ITs Watchdog 2x
Watchdog 2xUSART/LIN
USART/LIN
Smartcard
Smartcard//IrDa
IrDa
32/49/80
32/49/80I/Os Window
I/Os WindowWatchdog
Watchdog Modem
ModemControl
Control
1x
1xSPI
SPI 2x
2x12-bit
12-bitADC
ADC 1x
1xSPI
SPI
16
16 channels//1Msps
channels 1Msps
1x
1xUSART/LIN
USART/LIN
Smartcard/IrDa
Smartcard/IrDa
2x 2
Modem-Ctrl
Modem-Ctrl Temp
TempSensor
Sensor 2xII2CC
Complementary outputs
Repetition counter 16-Bit Prescaler
BKIN
IC1, IC2, IC3 and IC4 are specific as they can be independently mapped by software on TI1, TI2, TI3 or TI4.
4x16-bit capture compare registers are programmable to be used to latch the value of the counter after a transition detected by the corresponding
Input Capture.
When a capture occurs, the corresponding CCXIF flag is set and an interrupt or a DMA request can be sent if they are enabled.
“Overcapture” flag set if second capture occurs before previous capture is cleared
The Output Compare is used to control an output waveform or indicate when a period of time has elapsed.
OCx OCx
RCR = 0
UEV
RCR = 2
UEV
One reference waveform OCxREF to generate 2 outputs OCx and OCxN for the
three channels.
Full modulation capability (0 and 100% duty cycle), edge or center-aligned
patterns
Dedicated interrupt and DMA requests for TIM1 period and duty cycles
updating.
Three programmable write protection levels
Level1: Dead Time and Emergency enable are locked.
Level2: Level1 + Polarities and Off-state selection for run and Idle state are locked.
Level3: Level2 + Output Compare Control and Preload are locked.
IC1 Counter
PWM
IC2
polarity.
IC2 - PERIOD 10
• IC1 or IC2 is selected as trigger input and the slave mode
controller is configured in reset mode.
The PWM Input functionality enables the measurement of the period and the pulse width of an
external waveform.
TI2
tDelay tPulse t
Hall B XOR
Hall C Input Filter &
IC1
Edge detector Prescaler Capture/Compare 1 Register
TRC
TIM1 TIM2
TIM1CLK TIM2CLK
TRG2 TRG1
TRG3 TRG3
TRG4 Trigger TRGO TRG1 TRG4 Trigger TRGO TRG2
Controller Controller
TI1FP1 TI1FP1
TI2FP2 TI2FP2
TIM3 TIM4
TIM3CLK TIM4CLK
TRG1 TRG1
TRG2 TRG2
TRG4 Trigger TRG3 TRG3 Trigger TRGO TRG4
TRGO
Controller Controller
TI1FP1 TI1FP1
TI2FP2 TI2FP2
Master ARR
Triggered Mode
The Trigger Output can be controlled on: Master CNT
Counter reset
Master Trigger
Counter enable Out
Update event
Slave CNT
OC1 / OC1Ref / OC2Ref / OC3Ref / OC4Ref signals
Gated Mode
Gated Mode: Both start and stop of the counter are
controlled. Master CCR1
Master CNT
Master CC1
Slave CNT
Cascade mode:
TIM1 used as master timer for TIM2, TIM2 configured as TIM1 slave and master for TIM3.
MASTER
Timer 1
CLOCK
Timer 2
ITR 1
Trigger TRG 2
One Master several slaves: TIM1 used as master for TIM2, TIM2 and TIM4.
MASTER
Timer 1 SLAVE 1
CLOCK
Timer 2
Trigger TRG1 ITR1
prescaler
Update Controller ITR 3
prescaler counter
counter ITR 4
SLAVE 2
Timer 3
ITR 1
ITR 2
prescaler counter
ITR 4
SLAVE 3
ITR1
TIM4
ITR 2
prescaler counter
ITR 3
External Trigger
1/128
HSE divided by 128
3 Event/Interrupt sources
LSE OSC or EXT Clock
Second
RTCSEL
Overflow RTC Alarm [1:0]
Alarm (also connected to EXTI Line 17 for Auto Wake-Up RTC Prescaler
from STOP)
=
Register protection against unwanted write operations fRTC
Reset (if watchdog activated) when the down counter value comparator
= 1 when
becomes less than 40h (T6=0) T6:0 > W6:0
CMP
Reset (if watchdog activated) if the down counter is reloaded
outside the time-window Write WWDG_CR
STANDBY)
To prevent IWDG reset: write IWDG_KR with
AAAAh key value at regular intervals before
the counter reaches 0 Best suited to applications which require the
watchdog to run as a totally independent
IWDG reset flag (in RCC_CSR) to inform when process outside the main application
a IWDG reset occurs
Min-max timeout value @40KHz (LSI): 100µs /
26.2s
In STM32F10x the SysTick clock can be: CPU clock or CPU clock/8 (provided
externally by the Reset Clock Control )
I/F
CPU Supply
FlashI/F
CPU Flash
FlashMemory Reg
43 maskable IT + 16 prog. priority levels 72
72 MHz
MHz Memory Reg1.8V
1.8V
Flash
512kB POR/PDR/PVD
POR/PDR/PVD
Embedded Memories : 512kBto tocome
come
e/o 2007
e/o 2007
72MHz)
FLASH: up 128 Kbytes, 512kB to come e/o 2007
(max72MHz)
Bus
Hi-SpeedBus
SRAM: up 20 Kbytes, 64kB to come e/o 2007 XTAL
XTALoscillators
oscillators
Up
Uptoto20kB
20kBSRAM 32KHz
7 Channels DMA
SRAM 32KHz++4~16MHz
4~16MHz
LiteHi-Speed
JTAG/SW
JTAG/SWDebug
Arbiter(max
Debug 64kB
64kBto
tocome
comee/o
e/o
Power Supply with internal regulator and low Int.
Int.RC
RCoscillators
oscillators
Nested
Nestedvect
vectIT
ITCtrl 2007
2007 32KHz
power modes : Ctrl 32KHz++8MHz
8MHz
Matrix//Arbiter
2V to 3V6 supply 1x
1xSysTick
SysTickTimer
Timer PLL
PLL
ARMLite
20B
20BBackup
BackupRegs
Regs
4 Low Power Modes with Auto Wake-up
ARM
Matrix
Integrated Power On Reset (POR)/Power Down DMA
DMA Reset
ResetClock
Clock
Reset (PDR) + Programmable voltage detector 77Channels
Channels Control RTC
RTC//AWU
AWU
Control
(PVD)
Backup domain w/ 20B reg ARM Peripheral Bus
Bridge
Bridge
Up to 72 MHz frequency managed & monitored by (max 36MHz) 1x
1xUSB
USB2.0FS
2.0FS
the Clock Control w/ Clock Security System 1x Bridge
Bridge
1x16-
16-bit PWM
16-bit PWM
Rich set of peripherals & IOs Synchronized
SynchronizedAC
AC 3x
3x16-bit
16-bitTimer
Timer
Timer
1x
1xbxCAN
bxCAN2.0B
2.0B
Timer
(max 72MHz)
ITs Watchdog 2x
Watchdog 2xUSART/LIN
USART/LIN
5 Timers w/ advanced control features (including Smartcard
Smartcard//IrDa
IrDa
Cortex SysTick) 32/49/80
32/49/80I/Os Window
I/Os WindowWatchdog
Watchdog Modem
ModemControl
Control
9 communications Interfaces
1x
1xSPI
SPI
Up to 80 I/Os (100 pin package) w/ 16 external 2x
2x12-bit
12-bitADC
ADC 1x
1xSPI
SPI
interrupts/event 16
16 channels//1Msps
channels 1Msps
1x
1xUSART/LIN
USART/LIN
Up to 2x12-bits 1Msps ADC w/ up to 16 channels Smartcard/IrDa
Smartcard/IrDa
2x 2
and Embedded temperature sensor w/ +/-1.5° Modem-Ctrl
Modem-Ctrl Temp
TempSensor
Sensor 2xII2CC
linearity with T°
I/F
CPU Supply
FlashI/F
CPU Flash
FlashMemory Reg
43 maskable IT + 16 prog. priority levels 72
72 MHz
MHz Memory Reg1.8V
1.8V
Flash
512kB POR/PDR/PVD
POR/PDR/PVD
Embedded Memories : 512kBto tocome
come
e/o 2007
e/o 2007
72MHz)
FLASH: up 128 Kbytes, 512kB to come e/o 2007
(max72MHz)
Bus
Hi-SpeedBus
SRAM: up 20 Kbytes, 64kB to come e/o 2007 XTAL
XTALoscillators
oscillators
Up
Uptoto20kB
20kBSRAM 32KHz
7 Channels DMA
SRAM 32KHz++4~16MHz
4~16MHz
LiteHi-Speed
JTAG/SW
JTAG/SWDebug
Arbiter(max
Debug 64kB
64kBto
tocome
comee/o
e/o
Power Supply with internal regulator and low Int.
Int.RC
RCoscillators
oscillators
Nested
Nestedvect
vectIT
ITCtrl 2007
2007 32KHz
power modes : Ctrl 32KHz++8MHz
8MHz
Matrix//Arbiter
2V to 3V6 supply 1x
1xSysTick
SysTickTimer
Timer PLL
PLL
ARMLite
20B
20BBackup
BackupRegs
Regs
4 Low Power Modes with Auto Wake-up
ARM
Matrix
Integrated Power On Reset (POR)/Power Down DMA
DMA Reset
ResetClock
Clock
Reset (PDR) + Programmable voltage detector 77Channels
Channels Control RTC
RTC//AWU
AWU
Control
(PVD)
Backup domain w/ 20B reg ARM Peripheral Bus
Bridge
Bridge
Up to 72 MHz frequency managed & monitored by (max 36MHz) 1x
1xUSB
USB2.0FS
2.0FS
the Clock Control w/ Clock Security System 1x Bridge
Bridge
1x16-bit
16-bitPWM
PWM
Rich set of peripherals & IOs Synchronized
SynchronizedAC
AC 3x
3x16-bit
16-bitTimer
Timer
Timer
1x
1xbxCAN
bxCAN2.0B
2.0B
Timer
(max 72MHz)
ITs Watchdog 2x
Watchdog 2xUSART/LIN
USART/LIN
5 Timers w/ advanced control features (including Smartcard
Smartcard//IrDa
IrDa
Cortex SysTick) 32/49/80
32/49/80I/Os Window
I/Os WindowWatchdog
Watchdog Modem
ModemControl
Control
9 communications Interfaces
1x
1xSPI
SPI
Up to 80 I/Os (100 pin package) w/ 16 external 2x
2x12-bit
12-bitADC
ADC 1x
1xSPI
SPI
interrupts/event 16
16 channels//1Msps
channels 1Msps
1x
1xUSART/LIN
USART/LIN
Up to 2x12-bits 1Msps ADC w/ up to 16 channels Smartcard/IrDa
Smartcard/IrDa
2x 2
and Embedded temperature sensor w/ +/-1.5° Modem-Ctrl
Modem-Ctrl Temp
TempSensor
Sensor 2xII2CC
linearity with T°