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 08:35 PM
And I agree, but the OP posted only summary code and something may be being partially optimised out. For the summary code, it should be volatile. I would want to know if it makes any difference.
2021-09-17 08:43 PM
>STM32 interrupt pin strange behavior
Is the receiver output ASK modulated or what?
Using a CRO with 2 or more channels, post a capture of both the button of the transmitter and the receiver output.
What antennas? Try 17.31cm straight, single-core wire and align them parallel. It's the parallel length that matters.
Can you detect interference? E.g. have you a spectrum analyzer you could connect an antenna?
Receiver could be saturated. Try increasing the distance.
Describe how k is acquired.