2012-01-23 11:25 PM
MCU: STM8S105C6
Port: GPIOBBit: 2 GPIOB:2 is the only pin/bit set up for external interrupt, yet regardless of any edge sensitivity setting in EXTI_CR1, once an interrupt is invoked it is continuously invoked while ever the input pin is low. As the STM8S appears to have has no register for clearing an interrupt flag, what mechanism am I missing? Other posts have discussed similar experiences but have not been conclusive in an answer.The project manipulates registers directly rather than through ST's FWLIB. Workalot2012-01-24 12:36 AM
Hi,
as you give us little information, I can only try. In the Reference Manual of the STM8S Family I found on page 89 the chapter maskable interrupt sources and there especially External interrupts ..... When several input pins connected to the same interrupt line are selected simultaneously, they are logically ORed. When external level-triggered interrupts are latched, if the given level is still present at the end of the interrupt routine, the interrupt remains activated except if it has been inactivated in the routine.Are you using level-triggered interrupt? If not, give us more information.
Regards, WoRo2012-01-24 01:42 AM
Hello WoRo - thanks for your quick response. This is in return, a quick response. I should my tomorrow prepare a minimal project demonstrating the problem and post it.
But for now...While EXTI sensitivity is port wide (that is across all bits of that port), if we have...GPIOB_CR2 = 0x04; // Only bit 2 gated through to the ITC (Fig 21, page 100)EXTI_CR1 = 0x08; // PBIS = b10 = falling edgeIs this not enough that only bit2 can cause an EXTI interrupt, and only do so on a hi to lo edge?regards - workalot
2012-01-24 04:52 AM
Hi,
Did you consider the notice at EXTI_CR1?Bits 3:2 PBIS[1:0]:
Port B external interrupt sensitivity bits
These bits can only be written when
I1 and I0 in the CCR register are both set to 1 (level 3).
Otherwise you may keep the default value 00: falling and low level
Regards, WoRo
2012-01-25 02:06 PM
Have done a minimal project based on STVD + Cosmic which demonstrates a contradiction to my earlier claim. Have included the files should anyone else need confirmation that EXTI works appropriately.
workalot ________________ Attachments : stm8_interrupt_vector.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzFN&d=%2Fa%2F0X0000000bKq%2Fn92XdKa160_J6X9DKYETk0WX7yp1AHPpDmUBJRKlhwM&asPdf=false2012-01-25 02:08 PM
The second of two files.
________________ Attachments : exti_test.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzMd&d=%2Fa%2F0X0000000bKp%2FdfCFdLkSiEN9m.ZKcXArjNqgbbo2ZhiajJ5KuiWedNc&asPdf=false2014-03-07 12:16 AM
Thank You,
Your post saved a lot of time to me. Thumbs up!