数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN4062 数据表(PDF) 5 Page - STMicroelectronics

部件名 AN4062
功能描述  STM32F0DISCOVERY peripheral firmware examples
PDF  17 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN4062 数据表(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


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
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