External interrupts of a microcontroller | Microcontrollers from scratch # 14

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • External interrupts of ATmega8 MK can only operate on certain outputs, denoted INT0, INT1 and RESET. To reset the microcontroller, it is necessary to apply a low potential to the RESET terminal for a short time. This external interrupt operates by default and requires no presets. External interrupts on the outputs INT0 and INT1 should be pre-initialized and configured. They can be called in the following cases: on the front, on the decline, when changing the logical levels and at a low logical level. In addition, you must first connect the interrupts.h interrupt library, then you must allow global interrupts using the SREG status register or the sei () command. The remaining settings are performed by writing to the corresponding bits of the MCUCR and GICR registers.

Комментарии • 121