Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN4062 Datasheet(PDF) 5 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) 5 Page - STMicroelectronics

  AN4062 Datasheet HTML 1Page - STMicroelectronics AN4062 Datasheet HTML 2Page - STMicroelectronics AN4062 Datasheet HTML 3Page - STMicroelectronics AN4062 Datasheet HTML 4Page - STMicroelectronics AN4062 Datasheet HTML 5Page - STMicroelectronics AN4062 Datasheet HTML 6Page - STMicroelectronics AN4062 Datasheet HTML 7Page - STMicroelectronics AN4062 Datasheet HTML 8Page - STMicroelectronics AN4062 Datasheet HTML 9Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 5 / 17 page
background image
DocID022897 Rev 3
5/17
AN4062
Peripheral firmware examples description
3
Peripheral firmware examples description
3.1
GPIO toggle example
Purpose
This example describes how to use BSRR and BRR (Port Bit Set/Reset Register High and
Low) for maximum I/O toggling.
GPIO ports are connected on the AHB bus; using BSRR and BRR registers, two cycles are
required to set a pin and another two cycles to reset it. So GPIO pins can toggle at AHB
clock divided by 4.
Description
In this example, PC8 and PC9 (configured in push-pull output mode) toggle in a forever
loop:
•
Set PC8 and PC9 by setting corresponding bits in BSRR register.
•
Reset PC8 and PC9 by setting corresponding bits in BRR register.
In this example, HCLK is configured at 48 MHz so PC8 and PC9 toggle at 12 MHz.
To achieve the maximum I/O toggling frequency, you have to configure your compiler
options for high speed optimization.
3.2
EXTI example
Purpose
This example shows how to configure an external interrupt line.
Description
In this example:
•
PA0 pin is configured in input floating.
•
PA0 is configured to be used as an external interrupt source line 0 (EXTI0).
•
The EXTI line 0 is configured to generate an interrupt on each rising edge detected on
the PA0 pin. The interrupt is triggered every time the User push-button is pressed.
•
In the NVIC (nested vectored interrupt controller), the EXTI line 0 interrupt priority is
configured and the interrupt is enabled.
When the program is executed and the user pushes on the User push-button (EXTI0
interrupt routine), LED3 and LED4 connected to PC9 and PC8 are toggled.
3.3
SysTick example
Purpose
This example shows how to configure the system tick timer and use it to generate a 1 ms
time base.



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