Random interrupts on one of the ADC1 pins.
Posted: Wed Nov 06, 2019 12:03 pm
Hello guys!
I have an RFID reader. I attach an interrupt on one of the ADC1 pins (GPIO32 , 33, 34, 35, 36 39). for falling edge.
If i touch a tag card to it, i get the interrupt and i can read from it.
The problem is that after i get the first interrupt, i get several more interrupts. But this problem is never occour on any other pins of the esp32.
Here is my interrupt attach code:
And here is the RFID_Intr_Flag function:
The interrupt comes after the first randomly.
What is the problem? I disabled the ADC on these pins, and disabled the DAC registers too.
I have an RFID reader. I attach an interrupt on one of the ADC1 pins (GPIO32 , 33, 34, 35, 36 39). for falling edge.
If i touch a tag card to it, i get the interrupt and i can read from it.
The problem is that after i get the first interrupt, i get several more interrupts. But this problem is never occour on any other pins of the esp32.
Here is my interrupt attach code:
Code: Select all
static const inline void External_Interrupts(){
attachInterrupt(RFID_Intr_Pin, RFID_Intr_Flag, FALLING);
}
Code: Select all
tatic inline void IRAM_ATTR RFID_Intr_Flag(void) {
RFID_is_Touched = true;
//TEST_COUNTER++;
//detachInterrupt(RFID_Intr_Pin);
}
What is the problem? I disabled the ADC on these pins, and disabled the DAC registers too.
Code: Select all
static const inline void Turn_off_DAC(){
REG_CLR_BIT(RTC_IO_PAD_DAC1_REG,RTC_IO_PDAC1_XPD_DAC);
REG_CLR_BIT(RTC_IO_PAD_DAC2_REG,RTC_IO_PDAC2_XPD_DAC);
REG_SET_BIT(RTC_IO_PAD_DAC1_REG,RTC_IO_PDAC1_DAC_XPD_FORCE);
REG_SET_BIT(RTC_IO_PAD_DAC2_REG,RTC_IO_PDAC2_DAC_XPD_FORCE);
}