Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN4157 Datasheet(PDF) 19 Page - STMicroelectronics

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

AN4157 Datasheet(HTML) 19 Page - STMicroelectronics

Back Button AN4157 Datasheet HTML 15Page - STMicroelectronics AN4157 Datasheet HTML 16Page - STMicroelectronics AN4157 Datasheet HTML 17Page - STMicroelectronics AN4157 Datasheet HTML 18Page - STMicroelectronics AN4157 Datasheet HTML 19Page - STMicroelectronics AN4157 Datasheet HTML 20Page - STMicroelectronics AN4157 Datasheet HTML 21Page - STMicroelectronics AN4157 Datasheet HTML 22Page - STMicroelectronics AN4157 Datasheet HTML 23Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 19 / 24 page
background image
AN4157
Peripheral firmware examples description
Doc ID 023629 Rev 1
19/24
3.22
TIM time base example
3.22.1
Purpose
This example shows how to configure the TIM peripheral in Output Compare Timing mode
with the corresponding Interrupt requests for each channel, in order to generate 2 different
time bases.
3.22.2
Description
TIM3CLK frequency is set SystemCoreClock, to obtain a TIM3 counter clockfrequency of 6
MHz. As a consequence, the prescaler is computed as follows:
●
Prescaler = (TIM3CLK / TIM3 counter clock) - 1.
●
SystemCoreClock is set to 72 MHz.
●
The TIM3_CCR1 register value is equal to 40961, TIM3_CCR1 update rate = TIM3
counter clock / CCR1_Val = 1757.77 Hz.
As a result, TIM3 Channel 1 generates an interrupt each 6.8ms.
●
The TIM3_CCR2 register is equal to 27309, TIM3_CCR2 update rate = TIM3 counter
clock / CCR2_Val = 2636.49 Hz.
As a result, TIM3 Channel 2 generates an interrupt each 4.55ms.
●
The TIM3_CCR3 register is equal to 13654, TIM3_CCR3 update rate = TIM3 counter
clock / CCR3_Val = 5273.18 Hz.
As a result, TIM3 Channel 3 generates an interrupt each 2.27ms
●
The TIM3_CCR4 register is equal to 6826, TIM3_CCR4 update rate = TIM3 counter
clock / CCR4_Val = 10547.9 Hz.
As a result, TIM3 Channel 4 generates an interrupt each 1.13ms.
When the counter value reaches the Output compare registers values, the Output Compare
interrupts are generated and, in the handler routine, 4 leds (LED3, LED4, LED5 and LED6)
are toggled at the following frequencies:
●
LED3: 878.88 Hz (CC1)
●
LED4: 1318.24Hz (CC2)
●
LED5: 2636.59Hz (CC3)
●
LED6: 5273.95Hz (CC4)
Note:
Use LED3, LED4, LED5 and LED6 connected respectively to PE8, PE9,PE10 and PE15
pins and connect them to an oscilloscope to show the different Time Base signals.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


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