Measuring input from a reed switch with STM32L100RB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-02 8:08 AM
I want to count pulses generated from a reed switch. The switch has three outputs connected to WKUP1, WKUP2 and PCO of the STM32L100RB. I need an example or suggestions on how to achieve this. Kindly assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-02 10:36 AM
Take a look at the EXTI examples where the pins could generate interrupts. Might need to consider debouncing
STM32L1xx_StdPeriph_Lib_V1.2.0\Project\STM32L1xx_StdPeriph_Examples\EXTI\EXTI_Example\main.cUp vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-05 12:46 AM
Thanks Clive1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-05 12:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-05 9:29 AM
Pretty sure the newer version has the same examples, I just went through the most recent library I had unpacked.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-21 4:59 AM
Hello Clive1,
Please see the attachment for my implementation. I set up two interrupts for the signal lines. One on GPIO PA0 connected to EXTI_Line0. The second on GPIO PC13 connected to EXTI_Line However, the first interrupt is working fine, but the second isn't. I want to be able to get input from both signal lines. how can I achieve this? ________________ Attachments : Switch_Interrupt_Implementation.docx : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Tm&d=%2Fa%2F0X0000000biD%2F60tvLLytkJ8zmjsOqI5cYTAJbucx465frvnpUExwYOc&asPdf=false- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-21 9:29 AM
Probably want a more complete/consistent use of defines, or create a pin structure holding all the details,
void EXTI15_10_IRQHandler(void) {
if (EXTI_GetITStatus(EXTI_Line13) != RESET) {
if (GPIO_ReadOutputDataBit(GPIOA, GPIO_Pin_9)) // <<< SURELY THIS SHOULD BE PC.13 ???
{
GPIO_ResetBits(GPIOA, GPIO_Pin_9);
delay (500);
GPIO_SetBits(GPIOA, GPIO_Pin_9);
delay (500);
}
EXTI_ClearITPendingBit(EXTI_Line13);
}
}
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-23 8:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-23 9:21 AM
And have we confirmed that the GPIOs transition as expected if you just loop polling the pins, and outputting via LEDs?
Up vote any posts that you find helpful, it shows what's working..
