04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Interrupts<br />

Interrupts<br />

While the program is executing it is possible to interrupt the execution to handle another event. The<br />

events can be things like a pin changing from high to low or low to high. Other events can be received<br />

data or timers counting down or counting up. There are several types of interrupts. The interrupt<br />

system is an advance feature of M<strong>Basic</strong> and should only be explored by advanced users. A basic<br />

understanding of interrupts and the limitations is required to utilize them properly. M<strong>Basic</strong> interrupts<br />

are only available on <strong>Basic</strong>ATOMPro processors(ProONE,Pro24,Pro28,Pro40 and ARC32)<br />

ONINTERRUPT<br />

oninterrupt interrupt, handler<br />

• Interrupt - one of the listed interrupt types. See Interrupt Types table.<br />

• Handler - the interrupt handler label to jump to when the interrupt triggers.<br />

This is a directive to the compiler to specify the label to jump to when a specifi c interrupt triggers. The<br />

interrupt handler label must use RESUME to exit the interrupt handler.<br />

ONASMINTERRUPT<br />

onasminterrupt interrupt, handler<br />

• Interrupt - one of the listed interrupt types. See Interrupt Types table.<br />

• Handler - the assembly interrupt handler label to jump to when the interrupt triggers.<br />

This is a directive to the compiler to specify the label to jump to when a specifi c interrupt triggers. The<br />

assembly interrupt handler must use the RTE assembly command to exit the interrupt handler.<br />

ENABLE<br />

enable {interrupt}<br />

• Interrupt - an optional argument of one of the listed interrupt types. See Interrupt Types table.<br />

Enables one or all interrupts. When used with no arguments the global interrupt enable fl ag is set.<br />

When used with an interrupt argument, that interrupt’s enable fl ag is set. Only when both the global<br />

interrupt fl ag and specifi c interrupt fl ags are set will those interrupts be allowed to trigger.<br />

DISABLE<br />

disable {interrupt}<br />

• Interrupt - an optional argument of one of the listed interrupt types. See Interrupt Types table.<br />

Disables one or all interrupts. When used with no arguments the global interrupt enable fl ag is<br />

cleared. When used with an interrupt argument, that interrupt’s enable fl ag is cleared. If either the<br />

global interrupt fl ag or the specifi c interrupt fl ag is cleared that interrupt will not trigger.<br />

206

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!