Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
4
Добавлен:
18.07.2023
Размер:
8.82 Mб
Скачать

14.3Moving Interrupts Between Application and Boot Section

The MCU Control Register controls the placement of the Interrupt Vector table, see Code Example below. For more details, see “Reset and Interrupt Handling” on page 17.

Assembly Code Example

Move_interrupts:

; Get MCUCR

in r16, MCUCR mov r17, r16

; Enable change of Interrupt Vectors ori r16, (1<<IVCE)

out MCUCR, r16

; Move interrupts to Boot Flash section ori r16, (1<<IVSEL)

out MCUCR, r17 ret

C Code Example

void Move_interrupts(void)

{

uchar temp;

/* Get MCUCR*/ temp = MCUCR;

/* Enable change of Interrupt Vectors */ MCUCR = temp|(1<<IVCE);

/* Move interrupts to Boot Flash section */ MCUCR = temp|(1<<IVSEL);

}

ATmega640/V-1280/V-1281/V-2560/V-2561/V [DATASHEET]

107

2549Q–AVR–02/2014