STM32 Peripherals
STM32 Peripherals
STM32 Peripherals
Agenda
09:00 09:30 09:40 09:45 10:30 11:30 11:45 12:45 13:30 15:00 15:15 15:45 16:15 Registration Introduction to ST STM32 Overview ARM an introduction to Cortex-M3 STM32 Cortex-M3 Core and System Coffee Hitex Tools, DMA, RTOS Lunch STM32 Peripherals Coffee STM32 Libraries examples and Usage STM32-Primer demo Summary, Questions, and Close
8th October 2007
2
STM32 Seminar
Agenda
09:00 09:30 09:40 09:45 10:30 11:30 11:45 12:45 13:30 15:00 15:15 15:45 16:15 Registration Introduction to ST STM32 Overview ARM an introduction to Cortex-M3 STM32 Cortex-M3 Core and System Coffee Keil Tools Lunch STM32 Peripherals Coffee STM32 Libraries examples and Usage STM32-Primer demo Summary, Questions, and Close
8th October 2007
3
STM32 Seminar
STM32 Peripherals
Communications Peripherals Analog to Digital Converter Timers Demo: USB Device Firmware Upgrade
STM32 Seminar
STM32 Seminar
32kB-128kB 32kB-128kB Flash Memory Flash Memory 512kB to come 512kB to come e/o 2007 e/o 2007
Power Supply Power Supply Reg 1.8V Reg 1.8V POR/PDR/PVD POR/PDR/PVD XTAL oscillators XTAL oscillators 32KHz + 4~16MHz 32KHz + 4~16MHz Int. RC oscillators Int. RC oscillators 32KHz + 8MHz 32KHz + 8MHz PLL PLL
Up to 20kB SRAM Up to 20kB SRAM 64kB to come e/o 64kB to come e/o 2007 2007 20B Backup Regs 20B Backup Regs Reset Clock Reset Clock Control Control ARM Peripheral Bus Bridge Bridge (max 36MHz)
1x USB 2.0FS 1x USB 2.0FS 1x bxCAN 2.0B 1x bxCAN 2.0B 2x USART/LIN 2x USART/LIN Smartcard //IrDa Smartcard IrDa Modem Control Modem Control 1x SPI 1x SPI 2x I22C 2x I C
Bridge Bridge 3x 16-bit Timer 3x 16-bit Timer (max 72MHz) Independent Independent Watchdog Watchdog Window Watchdog Window Watchdog 2x 12-bit ADC 2x 12-bit ADC 16 channels //1Msps 16 channels 1Msps Temp Sensor Temp Sensor
Up to 16 Ext. ITs Up to 16 Ext. ITs 32/49/80 I/Os 32/49/80 I/Os 1x SPI 1x SPI 1x USART/LIN 1x USART/LIN Smartcard/IrDa Smartcard/IrDa Modem-Ctrl Modem-Ctrl
STM32 Seminar
STM32 Seminar
0xD7
Master
SCK MISO MOSI NSS
8-bit long
0xD7
VDD
0xD739
16-bit long
0xD739
STM32 Seminar
Master
SCK MISO MOSI NSS VDD NSS SCK MISO MOSI
Slave
Full Duplex
STM32 Seminar
Master
SCK MISO MOSI NSS VDD NSS SCK MISO MOSI
Slave
Master
SCK MISO MOSI NSS VDD NSS SCK MISO MOSI
Slave
Bi-directional
Rx Only
(Slave)
STM32 Seminar
10
Software NSS
Slave
Slave
Full Duplex pin saving mode Frees Master and Slave NSS pins
SCK MISO MOSI NSS SCK MISO MOSI NSS
Dynamic Master/Slave reVDD SCK MISO MOSI NSS SCK MISO MOSI NSS
configuration
Master
STM32 Seminar
Master
8th October 2007
11
Slave
Enable SS output capability
Slave
Each device can be a unique master by enabling its NSS as output and driving it low: all other devices became slaves.
Master
STM32 Seminar
Slave
8th October 2007
12
Master
MISO SCK MOSI CS
STM32 Seminar
1 2 3 4 5 6 78
13
MOSI
Data 1
Data 2
Data n
CRC[1..n]
Taken from SPI2 TXCRC register and sent to SPI1
MISO
Data 1
Data 2
Data n
CRC[1..n]
SCK
STM32 Seminar
14
STM32 Seminar
15
STM32 Seminar
16
2 Interrupt vectors:
1 Interrupt for successful address/ data communication 1 Interrupt for error condition
SMBus 2.0 (System Management Bus) Compatibility http://smbus.org PMBusTM (Power Management Bus) Compatibility http://pmbus.org
STM32 Seminar
17
STM32 Seminar
18
VDD
Master
SDA SCL SDA SCL
Slave
Slave address1 Slave address2
STM32 Seminar
19
STM32 Seminar
20
STM32 Seminar
21
Dedicated transmission and reception flags (TxE and RxNE) with interrupt capability Support for DMA
Receive DMA request Transmit DMA request
Up to 4.5 Mbps
STM32 Seminar
22
STM32 Seminar
23
STM32 Seminar
24
Master
SCLK Rx Tx SCK MISO MOSI NSS
Slave
USART
Full Duplex
STM32 Seminar
SPI
25
VDD R = 10 K
USART1
Tx
Half Duplex
STM32 Seminar
Tx
USART2
26
USART
Tx
SCLK
STM32 Seminar
27
USART
SIR Transmit Encoder
Tx/ SW_Rx
IrDA OUT
USART Tx
Half Duplex
STM32 Seminar 8th October 2007
28
STM32 Seminar
29
Transmission
Three transmit mailboxes Configurable transmit priority Time Stamp on SOF transmission
Reception
Two receive FIFOs with three stages 14 scalable filter banks Identifier list features Configurable FIFO overrun Time Stamp on SOF reception
STM32 Seminar
30
Management
Maskable interrupts Software-efficient mailbox mapping at a unique address space 512 bytes reserved RAM size 4 dedicated interrupt vectors: transmit interrupt, FIFO0 interrupt, FIFO1 interrupt and status change error interrupt
STM32 Seminar
31
STM32 Seminar
32
STM32 Seminar
34
USB Features
Full speed USB 2.0 transfer. Configurable endpoints transfer mode type: control, bulk, interrupt and Isochronous. Configurable number of endpoints: up to 8 bidirectional endpoints and 16 mono-directional endpoints. USB suspend/resume support. Dedicated SRAM Area (Packet Memory Area) up to 512bytes (shared with bxCAN). Dynamic buffer allocation according to the user needs. Special double buffer support for Isochronous and Bulk transfers.
STM32 Seminar
35
PMA
Endpointx Buff 1
USB IP
Endpointx Buff 0
CPU
STM32 Seminar
36
STM32 Seminar
37
STM32 Seminar
38
STM32 Seminar
39
32kB-128kB 32kB-128kB Flash Memory Flash Memory 512kB to come 512kB to come e/o 2007 e/o 2007
Power Supply Power Supply Reg 1.8V Reg 1.8V POR/PDR/PVD POR/PDR/PVD XTAL oscillators XTAL oscillators 32KHz + 4~16MHz 32KHz + 4~16MHz Int. RC oscillators Int. RC oscillators 32KHz + 8MHz 32KHz + 8MHz PLL PLL
Up to 20kB SRAM Up to 20kB SRAM 64kB to come e/o 64kB to come e/o 2007 2007 20B Backup Regs 20B Backup Regs Reset Clock Reset Clock Control Control ARM Peripheral Bus Bridge Bridge (max 36MHz)
1x USB 2.0FS 1x USB 2.0FS 1x bxCAN 2.0B 1x bxCAN 2.0B 2x USART/LIN 2x USART/LIN Smartcard //IrDa Smartcard IrDa Modem Control Modem Control 1x SPI 1x SPI 2x I22C 2x I C
Bridge Bridge 3x 16-bit Timer 3x 16-bit Timer (max 72MHz) Independent Independent Watchdog Watchdog Window Watchdog Window Watchdog 2x 12-bit ADC 2x 12-bit ADC 16 channels //1Msps 16 channels 1Msps Temp Sensor Temp Sensor
Up to 16 Ext. ITs Up to 16 Ext. ITs 32/49/80 I/Os 32/49/80 I/Os 1x SPI 1x SPI 1x USART/LIN 1x USART/LIN Smartcard/IrDa Smartcard/IrDa Modem-Ctrl Modem-Ctrl
STM32 Seminar
40
Single, continuous and discontinuous conversion modes Dual modes (on devices with 2 ADCs): 8 variations
STM32 Seminar
41
STM32 Seminar
42
ADCCLK
PCLK2
ADC_IN0 ADC_IN1
. . .
ADC_IN15
ANALOG MUX
Injected Channels
Up to 16
Regular Channels
Analog Watchdog
TIM1_TRGO TIM1_CC4 TIM1_TRGO TIM2_CC1 TIM3_CC4 TIM4_TRGO Ext_IT_15 JEXTSEL[2:0] bits JEXTRIG bit Start Trigger (injected group)
AWD
EOC
JEOC
Flags
AWDIE
TIM1_CC1 TIM1_CC2 TIM1_CC3 TIM2_CC2 TIM3_TRGO TIM4_CC4 Ext_IT_11 EXTSEL[2:0] bits EXTRIG bit Start Trigger (regular group)
EOCIE
JEOCIE
STM32 Seminar
43
STM32 Seminar
44
Start
CHx
. . .
CHn CHn
Stop
STM32 Seminar
46
Example: - Conversion of channels: 0, 1, 2, 4, 5, 8, 9, 11, 12, 13, 14 and 15 - Discontinuous mode Number of channel is 3
1st trigger
2nd trigger
3rd trigger
Channel0
Channel1
Channel2
Channel4
Channel5
Channel8
Channel9
Channel11
Channel12
5th trigger
Note: Do not use discontinuous mode for both regular and injected together. It can be used only for one group Channel1 Channel2
Channel0
channel
End of Conversion
STM32 Seminar
47
ADC
1.5 cycles 7.5 cycles Sample Time Selection Sample Time Selection 13.5 cycles
PCLK2
ADCCLK
SMPx[2:0]
Total conversion = Sample time + 12.5 cycles At 14MHz, sample time of 1.5cycles, total conversion time = 1 s (14 cycles)
STM32 Seminar 8th October 2007
48
Sequencer
Up to 16 conversions with different order, different sampling time and oversampling possibility.
Example: - Conversion of channels: 1, 2, 8, 4, 7, 3 and 11 - Different sampling time. - Oversampling of channel 7.
Channel1 Channel2 Channel8 Channel4 Channel7 Channel7 Channel7 Channel3 Channel11
1.5 cycles
13.5 cycles
7.5 cycles
7.5 cycles
71.5 cycles
28.5 cycles
1.5 cycles
STM32 Seminar
49
Right alignment
D10
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
Injected group
D11
D10
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
Regular group
Left alignment
SEXT D11
D10
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
Injected group
D11
D10
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
Regular group
STM32 Seminar
50
ADC_IN0 ADC_IN1
. . .
ADC_IN15
Analog Watchdog
Low Threshold High Threshold
AWD
Status Register
STM32 Seminar
51
DMA
DMA request generated on each ADC1 end of regular channel conversion In dual modes, ADC2 and ADC1 results transferred in 32-bits of ADC1_DR
DMA Request
ConvertedValue_Tab[9]
Channel0 conversion result Channel1 conversion result Channel2 conversion result
Example: - Conversion of Regular group - DMA triggered by End of Conversion - Results transferred to SRAM array by DMA - DMA Destination address auto incremented - EOC flag cleared by DMA access to ADCR1_DR
.. .. ..
Channel3 conversion result Channel4 conversion result Channel5 conversion result Channel6 conversion result Channel7 conversion result Channel8 conversion result
STM32 Seminar
52
Up to 4 injected channels
VREFINT
GPIO Ports
ANALOG MUX
Up to 16 regular channels
ADC1 Analog
External event synchronization
ADC2 Analog
Data register
Digital Master
Digital Slave
EOC/JEOC
STM32 Seminar
53
Conversion
ADC1
CH15
CH14
CH13
CH12
CH0
End of Conversion on ADC1 and ADC2 Trigger for regular channels Note: Do not sample the same channel at the same time on each ADC
STM32 Seminar
54
Conversion
ADC1
CH15
CH13
CH1
Trigger for injected channels Note: Do not convert the same channel on the two ADCs
STM32 Seminar
55
End of Conversion flag is generated after each conversion is complete Results for both ADCs stored in ADC1 Regular data register (32bits) Next conversion on each ADC automatically started after 28 cycles Use DMA for efficient data transfer
ADC2
CH0
CH0
Sampling Conversion
ADC1
14 ADCCLK cycles Trigger for regular channel
CH0
28 ADCCLK cycles
STM32 Seminar
56
End of Conversion flag is generated when each conversion is complete Results for both ADCs stored in ADC1 Regular data register (32bits) Use DMA for fast & efficient data transfer
Conversion
CH0
ADC1
CH0
Trigger for regular channels Note: - Sampling time must be less than 7 ADC clock cycles
STM32 Seminar
57
End of Conversion flags are generated when group conversions are complete Results stored in Injected data registers of each ADC
Alternate Trigger mode on 4 injected channels (injected discontinuous mode enabled) discontinuous
1st Trigger 3rd Trigger CH1 5th Trigger CH2 7th Trigger CH3 JEOC on ADC1
Sampling Conversion
ADC1
CH0
ADC2
2nd Trigger
CH10
CH11
CH12
4th Trigger
6th Trigger
8th Trigger
STM32 Seminar
58
End of Injected Conversion flags generated when Injected group conversions are complete End of Conversion flags are generated when Regular group conversions are complete Injected group results stored in Injected data registers of each ADC Regular group results stored in Regular data register of ADC1 (32 bits)
Combined Regular/Injected simultaneous mode on 4 regular channels and 2 injected channels channels
ADC2
regular simultaneous
Sampling
CH3
CH0
CH1
CH1
CH2
Conversion
ADC1
CH3
CH2
CH2
CH1
ADC2
Trigger for regular channels
CH10
CH11
ADC1
CH15
Note: Do not sample the same channel at the same time on each ADC
STM32 Seminar
59
End of Injected Conversion flags generated when Injected group conversions are complete End of Conversion flags are generated when Regular group conversions are complete Injected group results stored in Injected data registers of each ADC Regular group results stored in Regular data register of ADC1 (32 bits)
Combined Regular simultaneous + Alternate trigger mode on 4 regular channels and 2 injected channels regular
ADC1
CH0 CH1 1st injected Trigger CH1 CH3 CH3
Sampling Conversion
End of Conversion on ADC1 and ADC2
ADC1 ADC2
CH3 CH2
CH10
on ADC1
CH2
CH0
CH0
Note: For Regular Simultaneous mode, do not sample the same channel at the
ADC2
CH11
STM32 Seminar
60
End of Injected Conversion flags generated when Injected group conversions are complete End of Conversion flags are generated when Regular group conversions are complete Injected group results stored in Injected data registers of each ADC Regular group results stored in Regular data register of ADC1 (32 bits)
Combined Injected simultaneous + Interleaved mode on 1 regular (continuous conversion) channel and 2 injected channels (continuous
End of Conversion on each ADC at the end of CH0 conversion CH0
ADC2 ADC1
CH0 CH0
CH0 CH0
CH0
Sampling Conversion
ADC2
Trigger for regular channel
ADC1
Note: For Injected Simultaneous mode, do not sample the same channel at the
Injected simultaneous
STM32 Seminar
61
STM32 Timers
STM32 Seminar
62
4 Timers w/ advanced control features Embedded low power RTC with VBAT capability Dual Watchdog Architecture Cortex-M3 SysTick Timer
32kB-128kB 32kB-128kB Flash Memory Flash Memory 512kB to come 512kB to come e/o 2007 e/o 2007
Power Supply Power Supply Reg 1.8V Reg 1.8V POR/PDR/PVD POR/PDR/PVD XTAL oscillators XTAL oscillators 32KHz + 4~16MHz 32KHz + 4~16MHz Int. RC oscillators Int. RC oscillators 32KHz + 8MHz 32KHz + 8MHz PLL PLL
JTAG/SW Debug JTAG/SW Debug Nested vect IT Ctrl Nested vect IT Ctrl 1x SysTick Timer 1x SysTick Timer DMA DMA 7 Channels 7 Channels
Up to 20kB SRAM Up to 20kB SRAM 64kB to come e/o 64kB to come e/o 2007 2007 20B Backup Regs 20B Backup Regs Reset Clock Reset Clock Control Control ARM Peripheral Bus Bridge Bridge (max 36MHz)
1x USB 2.0FS 1x USB 2.0FS 1x bxCAN 2.0B 1x bxCAN 2.0B 2x USART/LIN 2x USART/LIN Smartcard //IrDa Smartcard IrDa Modem Control Modem Control 1x SPI 1x SPI 2x I22C 2x I C
Bridge Bridge 3x 16-bit Timer 3x 16-bit Timer (max 72MHz) Independent Independent Watchdog Watchdog Window Watchdog Window Watchdog 2x 12-bit ADC 2x 12-bit ADC 16 channels //1Msps 16 channels 1Msps Temp Sensor Temp Sensor
Up to 16 Ext. ITs Up to 16 Ext. ITs 32/49/80 I/Os 32/49/80 I/Os 1x SPI 1x SPI 1x USART/LIN 1x USART/LIN Smartcard/IrDa Smartcard/IrDa Modem-Ctrl Modem-Ctrl
STM32 Seminar
63
STM32 Seminar
64
Trigger/Clock
Trigger Output
Controller
Synchronization
Timer Master/Slave Synchronisation with external trigger Triggered or gated modes Serial and Parallel Multi-timer Cascade
CH1
Debug mode
STM32 Seminar 8th October 2007
65
Trigger/Clock
Trigger Output
Controller
CH4 BKIN
STM32 Seminar
66
STM32 Seminar
67
Prescaler
TI2
IC2
Prescaler
TI3
IC3
Prescaler
TI4
IC4
Prescaler
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
STM32 Seminar
68
When a match is found between the capture/compare register and the counter:
The corresponding output pin is assigned to the programmable Mode, it can be: Timer Clock Set
Reset Toggle Remain unchanged
Interrupt Interrupt
Set a flag in the interrupt status register Generates an interrupt if the corresponding interrupt mask is set Send a DMA request if the corresponding enable bit is set
STM32 Seminar
69
PWM Mode
The PWM mode allows to generate:
4 independent signals for TIM1, plus 3 complementary signals with individually programmable dead time insertion. 4 independent signals for TIM2, 3 and 4 The frequency and a duty cycle determined as follow:
One auto-reload register to defined the PWM period. Each PWM channel has a Capture Compare register to define the duty cycle.
Example: to generate a 40 KHz PWM signal w/ duty cycle of 50% on TIM1 clock at 72MHz:
Load Prescaler register with 0 (counter clocked by TIM1CLK/(0+1)), Auto Reload register with 1799 and CCRx register with 899
Edge-aligned Mode
Timer Clock AutoReload Capture Compare
Update Event
Center-aligned Mode
Timer Clock AutoReload Capture Compare OCx
Update Event
OCx
STM32 Seminar
70
Counter Modes
Three Counter Modes
Up Counting Down Counting Centre-Aligned Mode Center Aligned
RCR = 0
Up counting
Down counting
UEV
RCR = 2
UEV RCR = Repetition Counter, Advanced Control Timer only STM32 Seminar 8th October 2007
71
Advanced Control timer TIM1 Complementary PWM outputs for motor control
This mode allows the TIM1 to:
Output two complementary signals for each three channels. Output two independent signals for each three channels. Manage the dead-time between the switching-off and the switching-on instants of the outputs.
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.
STM32 Seminar
72
Advanced Control timer TIM1 Dead Time Insertion & Timer Write Protection
STM32 Seminar
73
Break applications:
If the AOE: Automatic Output Enable bit is set, the MOE bit is automatically set again at the next update event UEV This can be used to perform a regulation. If the AOE is Reset, the MOE remains low until you write it to 1 again In this case, it can be used for security and you can connect the break input to an alarm from power drivers, thermal sensors or any security components.
STM32 Seminar 8th October 2007
74
IC1 and IC2 are redirected internally to be mapped to the same external pin TI1 or TI2. IC1 PWM IC2 Counter
IC2 - PERIOD IC1 or IC2 is selected as trigger input and the slave mode controller is configured in reset mode.
10
The PWM Input functionality enables the measurement of the period and the pulse width of an external waveform. STM32 Seminar 8th October 2007
75
TI2
One Pulse Mode (OPM) is a particular case of the previous modes: Ouput Compare and Input Capture. It allows the counter to be started in response to a stimulus and to generate a pulse with a programmable length after a programmable delay. There are two One Pulse Mode waveforms selectable by software:
Single Pulse Repetitive Pulse
OC1REF
OC1
TIM_ARR
TIM_CCR1
tDelay
tPulse
STM32 Seminar
76
Encoder Interface
Encoders are used to measure position and speed of motion systems (either linear or angular) The encoder interface mode acts as an external clock with direction selection The counter provides information on the current position (for instance angular position of an electric motors rotor) To obtain dynamic information (speed, acceleration) on must measure the number of counts between two periodic events, generated by another timer Encoders and Microcontroller connection example:
An external incremental encoder can be connected directly to the MCU without external interface logic. The third encoder output which indicates the mechanical zero position, may be connected to an external interrupt and trigger a counter reset.
TI1 TI2 Polarity Select & Edge Controller Polarity Select & Edge Controller
Trigger Controller
Controller
Encoder Interface
STM32 Seminar
77
Prescaler
Capture/Compare 1 Register
IC2
Prescaler
Capture/Compare 2 Register
IC3
Prescaler
Capture/Compare 3 Register
TI4
IC4
Prescaler
Capture/Compare 4 Register
STM32 Seminar
78
TIM1
TIM2
Trigger Controller
TRGO
TRG1
Trigger Controller
TRGO
TRG2
TI1FP1 TI2FP2
TI1FP1 TI2FP2
TIM3
TIM4
Trigger Controller
TRGO
TRG3
Trigger Controller
TRGO
TRG4
TI1FP1 TI2FP2
TI1FP1 TI2FP2
STM32 Seminar
79
Triggered Mode
Slave CNT
in two modes:
Gated Mode
Clock New Master CCR1 Master CCR1 Master CNT Master CC1
Triggered mode : only the start of the counter is controlled. Gated Mode: Both start and stop of the counter are controlled.
Slave CNT
STM32 Seminar
80
MASTER Timer 1
CLOCK prescaler Update counter
Trigger Controller
TRG 1
prescaler
Trigger Controller
Update
TRG 2
SLAVE
counter
ITR1 ITR2
Timer 3
prescaler counter
ITR 4
STM32 Seminar
81
SLAVE 1 Timer 2
TRG1 ITR1 ITR 3 ITR 4
Trigger Controller
prescaler
counter
SLAVE 2 Timer 3
ITR 1 ITR 2 ITR 4
prescaler
counter
SLAVE 3
ITR1 ITR 2
TIM4
prescaler counter
ITR 3
STM32 Seminar
82
TIM1
TIM2
TIM3
Trigger Controller
TRGO
Trigger Controller
TRGO
Trigger Controller
TRGO
External Trigger
STM32 Seminar
83
Other Timers
STM32 Seminar
84
Backup Domain
STM32 Seminar
85
CMP
To prevent WWDG reset: write T[6:0] bits (with T6 equal to 1) at regular intervals while the counter value is lower than the time-window value (W[6:0]) Early Wakeup Interrupt (EWI): occurs whenever the counter reaches 40h can be used to reload the down counter WWDG reset flag (in RCC_CSR) to inform when a WWDG reset occurs Min-max timeout value @36MHz (PCLK1): 113s / 58.25ms
Best suited to applications which require the watchdog to react within an accurate timing window
STM32 Seminar 8th October 2007
T6 bit Reset T[6:0] CNT down counter
WWDG_CR
PRESCALER (WDGTB)
W[6:0] 3Fh
Refresh Window
time
86
IWDG features
Selectable HW/SW start through option byte Advanced security features:
IWDG clocked by its own dedicated low-speed clock (LSI) and thus stays active even if the main clock fails Once enabled the IWDG cant be disabled (LSI cant be disabled too) Safe Reload Sequence (key) IWDG function implemented in the VDD voltage domain that is still functional in STOP and STANDBY mode (IWDG reset can wake-up from STANDBY)
LSI (40KHz) 8-bit PRESCALER 12-bit down counter
VDD voltage domain 1.8V voltage domain
Prescaler Register
Status Register
Reload Register
Key Register
IWDG Reset
To prevent IWDG reset: write IWDG_KR with AAAAh key value at regular intervals before the counter reaches 0 IWDG reset flag (in RCC_CSR) to inform when a IWDG reset occurs Min-max timeout value @40KHz (LSI): 100s / 26.2s
STM32 Seminar
Best suited to applications which require the watchdog to run as a totally independent process outside the main application
87
In STM32F10x the SysTick clock can be: CPU clock or CPU clock/8
externally by the Reset Clock Control )
(provided
STM32 Seminar
88
Appendices
STM32 Seminar
89
32kB-128kB 32kB-128kB Flash Memory Flash Memory 512kB to come 512kB to come e/o 2007 e/o 2007
Power Supply Power Supply Reg 1.8V Reg 1.8V POR/PDR/PVD POR/PDR/PVD XTAL oscillators XTAL oscillators 32KHz + 4~16MHz 32KHz + 4~16MHz Int. RC oscillators Int. RC oscillators 32KHz + 8MHz 32KHz + 8MHz PLL PLL
Up to 20kB SRAM Up to 20kB SRAM 64kB to come e/o 64kB to come e/o 2007 2007 20B Backup Regs 20B Backup Regs Reset Clock Reset Clock Control Control ARM Peripheral Bus Bridge Bridge (max 36MHz)
Up to 16 Ext. ITs Up to 16 Ext. ITs 32/49/80 I/Os 32/49/80 I/Os 1x SPI 1x SPI 1x USART/LIN 1x USART/LIN Smartcard/IrDa Smartcard/IrDa Modem-Ctrl Modem-Ctrl
STM32 Seminar
90
32kB-128kB 32kB-128kB Flash Memory Flash Memory 512kB to come 512kB to come e/o 2007 e/o 2007
Power Supply Power Supply Reg 1.8V Reg 1.8V POR/PDR/PVD POR/PDR/PVD XTAL oscillators XTAL oscillators 32KHz + 4~16MHz 32KHz + 4~16MHz Int. RC oscillators Int. RC oscillators 32KHz + 8MHz 32KHz + 8MHz PLL PLL
Up to 20kB SRAM Up to 20kB SRAM 64kB to come e/o 64kB to come e/o 2007 2007 20B Backup Regs 20B Backup Regs Reset Clock Reset Clock Control Control ARM Peripheral Bus Bridge Bridge (max 36MHz)
Up to 16 Ext. ITs Up to 16 Ext. ITs 32/49/80 I/Os 32/49/80 I/Os 1x SPI 1x SPI 1x USART/LIN 1x USART/LIN Smartcard/IrDa Smartcard/IrDa Modem-Ctrl Modem-Ctrl
STM32 Seminar
91