Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN4062 Datasheet(PDF) 14 Page - STMicroelectronics

Part # AN4062
Description  STM32F0DISCOVERY peripheral firmware examples
PDF  17 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN4062 Datasheet(HTML) 14 Page - STMicroelectronics

Back Button AN4062 Datasheet HTML 9Page - STMicroelectronics AN4062 Datasheet HTML 10Page - STMicroelectronics AN4062 Datasheet HTML 11Page - STMicroelectronics AN4062 Datasheet HTML 12Page - STMicroelectronics AN4062 Datasheet HTML 13Page - STMicroelectronics AN4062 Datasheet HTML 14Page - STMicroelectronics AN4062 Datasheet HTML 15Page - STMicroelectronics AN4062 Datasheet HTML 16Page - STMicroelectronics AN4062 Datasheet HTML 17Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 14 / 17 page
background image
Peripheral firmware examples description
AN4062
14/17
DocID022897 Rev 3
The objective is to generate a PWM signal at 17.57 KHz:
–
TIM1_Period = (SystemCoreClock / 17570) - 1
–
TIM1 Frequency = TIM1 counter clock/(ARR + 1) = 48 MHz / 2730 = 17.57 kHz
•
The TIM1 CCR1 register value is equal to 1364, so the TIM1 Channel 1 generates a
PWM signal with a frequency equal to 17.57 kHz and a duty cycle equal to 50%:
TIM1 Channel1 duty cycle = (TIM1_CCR1/ TIM1_ARR + 1)* 100 = 50%
•
The TIM1 CCR2 register value is equal to 1023, so the TIM1 Channel 2 generates a
PWM signal with a frequency equal to 17.57 kHz and a duty cycle equal to 37.5%:
TIM1 Channel2 duty cycle = (TIM1_CCR2/ TIM1_ARR + 1)* 100 = 37.5%
•
The TIM1 CCR3 register value is equal to 682, so the TIM1 Channel 3 generates a
PWM signal with a frequency equal to 17.57 kHz and a duty cycle equal to 25%:
TIM1 Channel3 duty cycle = (TIM1_CCR3/ TIM1_ARR + 1)* 100 = 25%
•
The TIM1 CCR4 register value is equal to 431, so the TIM1 Channel 4 generates a
PWM signal with a frequency equal to 17.57 kHz and a duty cycle equal to 12.5%:
TIM1 Channel4 duty cycle = (TIM1_CCR4/ TIM1_ARR + 1)* 100 = 12.5%
Note:
The PWM waveform can be displayed using an oscilloscope.
Connect the TIM1 pins to an oscilloscope to monitor the different waveforms:
•
TIM1_CH1 pin (PA.08)
•
TIM1_CH2 pin (PA.09)
•
TIM1_CH3 pin (PA.10)
•
TIM1_CH4 pin (PA.11)
3.18
Timer ADC trigger example
Purpose
This example describes how to configure the TIM to trigger the ADC conversion.
Description
In this example, the TIM1 is configured in PWM mode, the TIM1 CC4 event is used to
trigger the ADC.
The ADC is configured to convert continuously the ADC_Channel_11 (connected to an
external voltage).
Each time the TIM1 CC4 event occurs, the ADC converts the variable voltage.
Note:
Connect the external signal ranges between 0 and 3.3V to ADC pin (PC.01).
3.19
NVIC WFI mode example
Purpose
This example shows how to enter the WFI mode and wake up from this mode by the User
key interrupt.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com