| Electronic Components Datasheet Search |
|
AN4062 Datasheet(PDF) 6 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4062 Datasheet(HTML) 6 Page - STMicroelectronics |
|
6 / 17 page ![]() Peripheral firmware examples description AN4062 6/17 DocID022897 Rev 3 Description In this example: • The system tick timer is initialized. • The system tick timer interrupt is enabled in the NVIC. • The system tick timer/counter starts in free running mode to generate periodical interrupts. • The system tick timer interrupt is triggered every 1 ms. • A Delay function is implemented, based on the system tick timer end-of-count event. The two LEDs, LED3 and LED4, are toggled with a timing defined by the Delay function. 3.4 Standby mode example Purpose This example shows how to put the system in Standby mode and wake it up from this mode using the external reset, RTC Alarm A. Description In this example: • The system tick timer is initialized. • The system tick timer interrupt is enabled in the NVIC. • The system tick timer/counter starts in free running mode to generate periodical interrupts. The system tick timer interrupt is triggered every 250 ms. In the SysTick interrupt handler, LED3 is toggled; this is used to indicate whether the MCU is in STANDBY or RUN mode. • The EXTI line 0 is configured to generate an interrupt on each rising/falling edge detected on the PA0 pin. The external interrupt is generated every time the PA0 changes levels (GND or VDD). – When a falling or rising edge is detected on the EXTI line, an interrupt is generated. In the EXTI handler routine, the RTC is configured to generate an Alarm event in 3 seconds, after which the system enters the Standby mode and LED3 is Off. After wake-up from Standby mode, the program execution restarts in the same way as after a reset; the RTC configuration (clock source, prescaler) is kept and LED3 is toggling again. As a result, there is no need to configure the RTC. LED3 is used to monitor the system state as following: • LED3 toggling: system in RUN mode • LED3 off: system in STANDBY mode • LED3 toggling: system resumed from STANDBY mode These steps are repeated in an infinite loop. |
|
|
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 |
| 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 |