Meir, Did you following this procedure exactly? I assume you are using an ARM7 core. Hi Tamir, thanks for your response. It is possible that your LPC requires another procedure, though. Hi Tamir thanks again. Might the uninitialized registers have created a false match directly when you powered up the RTC and that gets trigged as sonn as you enable interrupts? When you get your spurious interrupt: Are you acknowledging it, to make sure that you may get a new interrupt at the actual alarm time?
View all questions in Keil forum. Site Search User. Software Tools. Reply Cancel Cancel.
ChibiOS Free Embedded RTOS
In addition, writing to any RTC register is only enabled if the previous write operation is finished. Configuration Procedure: 1. Set CNF bit to enter configuration mode 2. Up 0 Down Reply Accept answer Cancel. Sure over 11 years ago in reply to Catcus Blip. Remark: On reset, the RTC is enabled.
Clock: Select clock source in Table For the RTC, the peripheral clock must be scaled see Section Interrupts: See Section I have not used the alarm function of the RTC, just the time keeping. More questions in this forum.
All recent questions Unread questions Questions you've participated in Questions you've asked Unanswered questions Answered questions Questions with suggested answers Questions with no replies. Not Answered. CubeMXLauncher termiates with error code 3 0 stm32cubemx. Started 7 hours ago by m Suggested Answer. Can i use mdk-lite version in my company? Latest 12 hours ago by Andy Neil. Latest 13 hours ago by Andy Neil. Problem with new Keil project 0.
Latest 15 hours ago by Yasminebgh.Each STM32F4 device has 23 external interrupt or event sources. They are split into 2 sections. First interrupt section is for external pins P0 to P15 on each port, and other section is for other events, like RTC interrupt, Ethernet interrupt, USB interrupt and so on.
October 1, : Added external interrupts library. In section one GPIOs we have 16 interrupt lines. All pins with same number are connected to line with same number. They are multiplexed to one line.
OK, now you have selected your pin you want to use. But you have to handle interrupt somehow. This process is described below.
Yes, lines have the same interrupt handler and this is also for lines 10 to More about NVIC is described here. Code below should be well documented to understand how it works. Make a feedback if this tutorial a little bit helps to understand external interrupts on STM32F4 device.
Tags: discovery external external interrupts exti interrupts keil uvision line nucleo stm32f4 STM32F4 discovery stm32f stm32f tilen majerle tutorial uvision. Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github. View Results. PA0 and PA5 are connected to different lines, they can be used at the same time.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up. The same interrupt works in the rest of the code. Functionally I don't really need to use the interrupt in this code, but I want to understand why doesn't it work. Since you have not assigned NVIC priority group, it is left with a default value of 2. This means that you have 2 bits for preemption priority and 2 bits for sub-priority.
Allowed priority levels for each group are illustrated in the following table:. As you can see, Group 4 has to be used in order to set preemption priority levels You may leave the group unassigned for UART interrupt since it will be assigned to group 2 by default.
For more information and examples you can refer to this article. Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Asked 5 years, 7 months ago. Active 5 years, 7 months ago. Viewed 6k times. How do I get the interrupt to nest? Mike Mike 1, 1 1 gold badge 13 13 silver badges 22 22 bronze badges. I don't know what do you want to do!? I haven't configured the group priority, I have read somewhere that the default scheme is having a byte for the preemption priority and a byte for the sub priority.
STM32F4 External interrupts tutorial
Am I wrong? What's your IDE? Which registers are of interest? Sep 10 '14 at Active Oldest Votes.STM32F103C8T6 RTC HAL
Allowed priority levels for each group are illustrated in the following table: As you can see, Group 4 has to be used in order to set preemption priority levels Ashton H. I have edited the question and added some code. I didn't have time to take a look at the reference manual to confirm it thought.Modules include a MCU, connectivity and onboard memory, making them ideal for designing IoT products for mass production.
The component database hosts libraries for different sensors, actuators, radios, inputs, middleware and IoT services. Learn about hardware support for Mbed, as well as the Mbed Enabled program, which identifies Mbed compatible products.
Reference designs, schematics and board layouts to develop production hardware and Mbed-compatible development boards. All forums and questions are now archived.
To start a new conversation or read the latest updates go to forums. I'm trying for several days to wake up my mbed from Deepsleep or Power-Down mode with the RTC alarm but it doesn't work. My code is inspired from :. If I try in sleep mode the interrupt works good the led 4 turn on but in other modes nothing works. The problem could perhaps be that :. Depending on your application, I found the LPC was not the best option for low power scenarios, although a great target.
Erik's deep sleep and wake up for the Freescale platform does perform very well for sub uA sleep applications. But you may need to re-configure the clock set up's to use different crystal options for the RTC to work reliably. Thanks Paul for your answer. Bad news for me because my board design is almost finished with the LPC but at least it doesn't include the mbed "magic" interface that seems to be the main problem to work in power down mode.
I will receive my board in weeks and I will give some news on the forum. This seems like fairly extensive code to get it to work. Granted it was on M0s, maybe M3s are different, but despite NXPs warnings I never had issues with getting them out of powerdown while in debug mode.
I for sure can't see a better method to make it happen anyway than your code. So by checking sleep consumption and powerdown you can compare it. Similar you can also check if something changes in power consumption when the interrupt is called. If you try it with sleep, you have exactly the same code only uncommented sleep? I'm building my own board without the Mbed "magic" interface but before I wanted to confirm that the RTC wake-up works fine.
I never tested it without the mbed platform, I do have another LPC board laying around, but programming it is always a pita. In general those are alot easier to use, since your program can resume, while deep powerdown requires a reset. It could be tbh, I don't know the number. K20 core M4F I got here barely uses more in powerdown than his M0 brothers and sisters.
By disabling cookies, some features of the site will not work. You do not have the correct permissions to perform this operation. Please, contact us at support mbed. Our partners Dozens of leading companies trust Mbed OS.
Become a partner Bring your services to overdevelopers. Modules Modules include a MCU, connectivity and onboard memory, making them ideal for designing IoT products for mass production.
Components The component database hosts libraries for different sensors, actuators, radios, inputs, middleware and IoT services. Mbed HDK Reference designs, schematics and board layouts to develop production hardware and Mbed-compatible development boards.
Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I want my program to go to RTC alarm interrupt every second but it does not work. My main funtion:. If a field is masked, then that won't be compared when checking alarm date. As you have set sAlarm. Seconds which is 0 in your case.
So you will have an interrupt every minute here if you leave the code as it is. If you want an interrupt every second, you will have to set the alarm again with the next second in your interrupt handler.
The code in your interrupt handler would look like:. For this to work, you have to make sure that you have set up properly the RTC clock internal or external 32K.
Alternatively you could use the wake up function of the RTC, it would be more appropriate I think. Learn more. Asked 3 years, 7 months ago.
Active 3 years, 7 months ago.
Viewed 8k times. Do you have any idea or advice for me? Thank you. You probably need to enable the interrupt in the NVIC.Cookie Notice. Cookies and similar technologies enable us to provide you with an optimized user experience and functionality of our website. They also help us to monitor its performance and to make our advertising and marketing relevant to you.
Define again the times and all?
If my assumption above is correctthen I can't really use 2 alarms. If I want to set 2 alarms at the start of my program then tell the MCU to go to standby mode wake up from the first alarm and then go again to standby mode and wake up from the second alarmthen I will have to set the second alarm after I woke from the first standby???
A normal alarm with no wakeup connection is irrelevant to our case. All rights reserved STMicroelectronics. Cookie Notice Cookies and similar technologies enable us to provide you with an optimized user experience and functionality of our website.
The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I'm trying use standby mode in most part of time, and sometimes wake up by RTC, it is an auto wake-up. Initially this is cleared by a system reset so that is why your first cycle is OK.
If you do not do this then the controller will wake up at once as the this bit signals an occurred wake-up event. You can access the register directly to set this bit or with HAL library the following macro can be used:. Learn more. Asked 3 years, 2 months ago. Active 2 years, 10 months ago. Viewed 9k times. If I use standby, I have a good first cycle: reset set RTC enter standby waiting for interrupt wake-up But second and next cycles wake up immediately after entering standby 3.
BNT 6 6 silver badges 21 21 bronze badges. Hard to tell, so it would be good if you could show your code, but it seems that you forgot to clear the WakeUp flag. Oh, thanks so much, I tryed clear flags in rtc. I can't check comment like resolving. If you right it like answer, I'll check it. Active Oldest Votes. Bence Kaulics Bence Kaulics 3, 7 7 gold badges 23 23 silver badges 47 47 bronze badges.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Featured on Meta. Community and Moderator guidelines for escalating issues via new response…. Feedback on Q2 Community Roadmap. Technical site integration observational experiment live on Stack Overflow.