Ну, например, даташит 30605c.pdf стр. 93
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено ttron 20 мая 2005 г. 13:24
В ответ на: Никогда не видел чтоб над GIE так издевались отправлено Digital 20 мая 2005 г. 12:42

Цитата :)

Note: If an interrupt occurs while the Global Interrupt
Enable (GIE) bit is being cleared, the
GIE bit may unintentionally be re-enabled
by the user’s Interrupt Service Routine (the
RETFIE instruction). The events that
would cause this to occur are:
1. An instruction clears the GIE bit while an
interrupt is acknowledged.
2. The program branches to the interrupt
vector and executes the Interrupt
Service Routine.
3. The Interrupt Service Routine completes
the execution of the RETFIE instruction.
This causes the GIE bit to be set
(enables interrupts), and the program
returns to the instruction after the one
which was meant to disable interrupts.
Perform the following to ensure that interrupts
are globally disabled:

LOOP BCF INTCON, GIE ; Disable global
; interrupt bit
BTFSC INTCON, GIE ; Global interrupt
; disabled?
GOTO LOOP ; NO, try again
; Yes, continue with program flow

Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru