Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - When counting external interrupt 0 with 5 1 single chip microcomputer, the number of times to remember is not increased by 1, but jumped several times, so there is still no delay in interrupt program.
When counting external interrupt 0 with 5 1 single chip microcomputer, the number of times to remember is not increased by 1, but jumped several times, so there is still no delay in interrupt program.
Hey, hey, let me help you out.

1 Select the rising edge of the counting pulse to trigger the interrupt, that is, set the external interrupt 0 as the edge trigger mode.

2 After entering the interrupt service program of external interrupt 0, let external interrupt 0 turn off the interrupt first to avoid multiple interrupts when counting a pulse.

After counting 3 plus 1, it needs to delay for a period of time, and then let the external interrupt 0 restart the interrupt after the counting pulse is stable.

Hehe, try it quickly. If it's right, give me extra points.