2021-09-17 02:15 AM
I am using stm32cubeide to program a stm32f030f4p6 MC. I have assigned one pin as an external interrupt and it is connected to the data output of an RF433 receiver.
Here is a summary of my code:
int k;
int main(void)
{
while (1)
{
k=0;
}
}
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
k=1;
}
and, the value of 'k' over time is:
the value of 'k' over time("button" is the button of the rf433 transmitter)
as it can be seen from the picture, interrupt is triggered even when no signal is received.
PS. I have tried external pull down and pull pull up resistors 10k and 4.7 k did not have an effect and with 2.2k no signal from rf433 receiver would be detected.
2021-09-17 02:24 AM
Observe the pin using oscilloscope or logic analyzer.
JW
2021-09-17 02:29 AM
Thanks for the reply.
I don't have access to oscilloscope or logic analyzer. However, I was able to observe the value of 'k' (which becomes 1 by interrupt ) by the stm32cubeMonitor (the attached picture).
2021-09-17 02:51 AM
And how do you know the observed behaviour is incorrect, ie. how do you know that there are no oscillations on the input pin?
JW
2021-09-17 04:15 AM
I have the assumption that the pin should only oscillate while receiving 433mhz signal.
2021-09-17 05:12 AM
Sure seems like the pin is toggling even when you don't expect it, doesn't it? What would be a different explanation?
Disconnect the pin and tie it to ground. I'll bet the variable doesn't change anymore.
2021-09-17 05:27 AM
In that case the pin won't toggle even when I expect it (receiving 433mhz signal).
2021-09-17 05:35 AM
k should be volatile.
The suggestion to tie the pin to ground wasn't hypothetical. It's intended to find something unknown.
2021-09-17 05:35 AM
2021-09-17 12:23 PM
> k should be volatile
I agree, but I also find it unlikely it would change, would it be optimized out.
JW