Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison libs/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/TIM/PWM_Output/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 TIM_PWM_Output TIM PWM Output example | |
3 | |
4 @verbatim | |
5 ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* | |
6 * @file TIM/PWM_Output/readme.txt | |
7 * @author MCD Application Team | |
8 * @version V3.5.0 | |
9 * @date 08-April-2011 | |
10 * @brief Description of the TIM PWM Output 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 configure the TIM peripheral in PWM (Pulse Width Modulation) | |
24 mode. | |
25 | |
26 The TIM3CLK frequency is set to SystemCoreClock / 2 (Hz), to get TIM3 counter | |
27 clock at 24 MHz the Prescaler is computed as following: | |
28 - Prescaler = (TIM3CLK / TIM3 counter clock) - 1 | |
29 SystemCoreClock is set to 72 MHz for Low-density, Medium-density, High-density | |
30 and Connectivity line devices and to 24 MHz for Value line devices. | |
31 | |
32 The TIM3 is running at 36 KHz: TIM3 Frequency = TIM3 counter clock/(ARR + 1) | |
33 = 24 MHz / 666 = 36 KHz | |
34 The TIM3 CCR1 register value is equal to 500, so the TIM3 Channel 1 generates a | |
35 PWM signal with a frequency equal to 36 KHz and a duty cycle equal to 50%: | |
36 TIM3 Channel1 duty cycle = (TIM3_CCR1/ TIM3_ARR + 1)* 100 = 50% | |
37 | |
38 The TIM3 CCR2 register value is equal to 375, so the TIM3 Channel 2 generates a | |
39 PWM signal with a frequency equal to 36 KHz and a duty cycle equal to 37.5%: | |
40 TIM3 Channel2 duty cycle = (TIM3_CCR2/ TIM3_ARR + 1)* 100 = 37.5% | |
41 | |
42 The TIM3 CCR3 register value is equal to 250, so the TIM3 Channel 3 generates a | |
43 PWM signal with a frequency equal to 36 KHz and a duty cycle equal to 25%: | |
44 TIM3 Channel3 duty cycle = (TIM3_CCR3/ TIM3_ARR + 1)* 100 = 25% | |
45 | |
46 The TIM3 CCR4 register value is equal to 125, so the TIM3 Channel 4 generates a | |
47 PWM signal with a frequency equal to 36 KHz and a duty cycle equal to 12.5%: | |
48 TIM3 Channel4 duty cycle = (TIM3_CCR4/ TIM3_ARR + 1)* 100 = 12.5% | |
49 | |
50 The PWM waveform can be displayed using an oscilloscope. | |
51 | |
52 @par Directory contents | |
53 | |
54 - TIM/PWM_Output/stm32f10x_conf.h Library Configuration file | |
55 - TIM/PWM_Output/stm32f10x_it.c Interrupt handlers | |
56 - TIM/PWM_Output/stm32f10x_it.h Interrupt handlers header file | |
57 - TIM/PWM_Output/main.c Main program | |
58 - TIM/PWM_Output/system_stm32f10x.c STM32F10x system source file | |
59 | |
60 @par Hardware and Software environment | |
61 | |
62 - This example runs on STM32F10x Connectivity line, High-Density, High-Density | |
63 Value line, Medium-Density, XL-Density, Medium-Density Value line, Low-Density | |
64 and Low-Density Value line Devices. | |
65 | |
66 - This example has been tested with STMicroelectronics STM32100E-EVAL (High-Density | |
67 Value line), STM32100B-EVAL (Medium-Density Value line), STM3210C-EVAL (Connectivity line), | |
68 STM3210E-EVAL (High-Density and XL-Density) and STM3210B-EVAL (Medium-Density) | |
69 evaluation boards and can be easily tailored to any other supported device | |
70 and development board. | |
71 | |
72 - STM3210C-EVAL Set-up | |
73 - Connect the following pins(TIM3 full remapping pins) to an oscilloscope to monitor the different | |
74 waveforms: | |
75 - PC.06: (TIM3_CH1) | |
76 - PC.07: (TIM3_CH2) | |
77 - PC.08: (TIM3_CH3) | |
78 - PC.09: (TIM3_CH4) | |
79 | |
80 - STM32100B-EVAL, STM3210E-EVAL, STM32100E-EVAL and STM3210B-EVAL Set-up | |
81 - Connect the following pins to an oscilloscope to monitor the different | |
82 waveforms: | |
83 - PA.06: (TIM3_CH1) | |
84 - PA.07: (TIM3_CH2) | |
85 - PB.00: (TIM3_CH3) | |
86 - PB.01: (TIM3_CH4) | |
87 | |
88 @par How to use it ? | |
89 | |
90 In order to make the program work, you must do the following : | |
91 - Copy all source files from this example folder to the template folder under | |
92 Project\STM32F10x_StdPeriph_Template | |
93 - Open your preferred toolchain | |
94 - Rebuild all files and load your image into target memory | |
95 - Run the example | |
96 | |
97 @note | |
98 - Low-density Value line devices are STM32F100xx microcontrollers where the | |
99 Flash memory density ranges between 16 and 32 Kbytes. | |
100 - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx | |
101 microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. | |
102 - Medium-density Value line devices are STM32F100xx microcontrollers where | |
103 the Flash memory density ranges between 64 and 128 Kbytes. | |
104 - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx | |
105 microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. | |
106 - High-density Value line devices are STM32F100xx microcontrollers where | |
107 the Flash memory density ranges between 256 and 512 Kbytes. | |
108 - High-density devices are STM32F101xx and STM32F103xx microcontrollers where | |
109 the Flash memory density ranges between 256 and 512 Kbytes. | |
110 - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where | |
111 the Flash memory density ranges between 512 and 1024 Kbytes. | |
112 - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. | |
113 | |
114 * <h3><center>© COPYRIGHT 2011 STMicroelectronics</center></h3> | |
115 */ |