comparison libs/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/IWDG/IWDG_Reset/readme.txt @ 0:c59513fd84fb

Initial commit of STM32 test code.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 03 Oct 2011 21:19:15 +1030
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c59513fd84fb
1 /**
2 @page IWDG_Reset IWDG Reset example
3
4 @verbatim
5 ******************** (C) COPYRIGHT 2011 STMicroelectronics *******************
6 * @file IWDG/IWDG_Reset/readme.txt
7 * @author MCD Application Team
8 * @version V3.5.0
9 * @date 08-April-2011
10 * @brief Description of the IWDG Reset example.
11 ******************************************************************************
12 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
13 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
14 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
15 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
16 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
17 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
18 ******************************************************************************
19 @endverbatim
20
21 @par Example Description
22
23 This example shows how to update at regular period the IWDG reload counter and
24 how to simulate a software fault generating an MCU IWDG reset on expiry of a
25 programmed time period.
26
27 The IWDG timeout is set to 250 ms (the timeout may varies due to LSI frequency
28 dispersion).
29
30 First, the TIM5 timer is configured to measure the LSI frequency as the
31 LSI is internally connected to TIM5 CH4, in order to adjust the IWDG clock.
32
33 The LSI measurement using the TIM5 is described below:
34 - Configure the TIM5 to remap internally the TIM5 Channel 4 Input Capture to
35 the LSI clock output.
36 - Enable the TIM5 Input Capture interrupt: after one cycle of LSI clock, the
37 period value is stored in a variable and compared to the HCLK clock to get
38 its real value.
39
40 @note The LSI is internally connected to TIM5 IC4 only on STM32F10x Connectivity
41 line, High-Density Value line, High-Density and XL-Density Devices.
42 When using other devices, you should comment the "#define LSI_TIM_MEASURE"
43 in main.c file and in this case the LSI frequency is set by default to 40KHz.
44
45 Then, the IWDG reload counter is configured to obtain 240ms according to the
46 measured LSI frequency.
47
48 The IWDG reload counter is refreshed each 240ms in the main program infinite loop
49 to prevent a IWDG reset.
50 LED2 is also toggled each 240ms indicating that the program is running.
51
52 An EXTI Line is connected to a GPIO pin, and configured to generate an interrupt
53 on the rising edge of the signal.
54
55 The EXTI Line is used to simulate a software failure: once the EXTI Line event
56 occurs, by pressing the Key push-button, the corresponding interrupt is served.
57 In the ISR, a write to invalid address generates a Hardfault exception containing
58 an infinite loop and preventing to return to main program (the IWDG reload counter
59 is not refreshed).
60 As a result, when the IWDG counter reaches 00h, the IWDG reset occurs.
61 If the IWDG reset is generated, after the system resumes from reset, LED1 turns on.
62
63 If the EXTI Line event does not occur, the IWDG counter is indefinitely refreshed
64 in the main program infinite loop, and there is no IWDG reset.
65
66
67 In this example the system clock is set to 24 MHz on Value line devices and to
68 72MHz on other devices.
69
70 @note The IWDG Counter can be only written when the RVU flag is reset.
71 In this example, as the SysTick period is too higher than the IWDG Counter
72 Update timing (5 Cycles 40KHz RC), the Reload Value Update "RVU" flag is
73 not checked before reloading the counter.
74
75 @par Directory contents
76
77 - IWDG/IWDG_Reset/stm32f10x_conf.h Library Configuration file
78 - IWDG/IWDG_Reset/stm32f10x_it.c Interrupt handlers
79 - IWDG/IWDG_Reset/stm32f10x_it.h Header for stm32f10x_it.c
80 - IWDG/IWDG_Reset/main.c Main program
81 - IWDG/IWDG_Reset/system_stm32f10x.c STM32F10x system source file
82
83 @par Hardware and Software environment
84
85 - This example runs on STM32F10x Connectivity line, High-Density, High-Density
86 Value line, Medium-Density, XL-Density, High-Density Value line, Medium-Density
87 Value line, Low-Density and Low-Density Value line Devices.
88
89 - This example has been tested with STMicroelectronics STM32100E-EVAL (High-Density
90 Value line), STM32100B-EVAL (Medium-Density Value line), STM3210C-EVAL
91 (Connectivity line), STM3210E-EVAL (High-Density and XL-Density), STM32100E-EVAL
92 (High-Density Value line) and STM3210B-EVAL (Medium-Density) evaluation
93 boards and can be easily tailored to any other supported device and development
94 board.
95 To select the STMicroelectronics evaluation board used to run the example,
96 uncomment the corresponding line in stm32_eval.h file (under Utilities\STM32_EVAL)
97
98 - STM32100E-EVAL Set-up
99 - Use LD1 and LD2 leds connected respectively to PF.06 and PF.07 pins
100 - Use the KEY push button connected to PG.08 pin (EXTI Line8).
101
102 - STM32100B-EVAL Set-up
103 - Use LD1 and LD2 leds connected respectively to PC.06 and PC.07 pins
104 - Use the KEY push button connected to PB.09 pin (EXTI Line9).
105
106 - STM3210C-EVAL Set-up
107 - Use LD1 and LD2 connected respectively to PD.07 and PD.13 pins
108 - Use the Key push-button connected to pin PB.09 (EXTI Line9).
109
110 - STM3210E-EVAL Set-up
111 - Use LD1 and LD2 leds connected respectively to PF.06 and PF.07 pins
112 - Use the KEY push button connected to PG.08 pin (EXTI Line8).
113
114 - STM3210B-EVAL Set-up
115 - Use LD1 and LD2 leds connected respectively to PC.06 and PC.07 pins
116 - Use the KEY push button connected to PB.09 pin (EXTI Line9).
117
118
119 @par How to use it ?
120
121 In order to make the program work, you must do the following :
122 - Copy all source files from this example folder to the template folder under
123 Project\STM32F10x_StdPeriph_Template
124 - Open your preferred toolchain
125 - Rebuild all files and load your image into target memory
126 - Link all compiled files and load your image into target memory
127 - Run the example in standalone mode (without debugger connection)
128
129 @note
130 - Low-density Value line devices are STM32F100xx microcontrollers where the
131 Flash memory density ranges between 16 and 32 Kbytes.
132 - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx
133 microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes.
134 - Medium-density Value line devices are STM32F100xx microcontrollers where
135 the Flash memory density ranges between 64 and 128 Kbytes.
136 - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx
137 microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes.
138 - High-density Value line devices are STM32F100xx microcontrollers where
139 the Flash memory density ranges between 256 and 512 Kbytes.
140 - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
141 the Flash memory density ranges between 256 and 512 Kbytes.
142 - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
143 the Flash memory density ranges between 512 and 1024 Kbytes.
144 - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
145
146 * <h3><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h3>
147 */