DISABLE

From MCS Wiki AVR
Jump to: navigation, search

Contents

Action

Disable specified interrupt.

 

 

Syntax

DISABLE interrupt [device]

 

 

Remarks

Interrupt

Description

INT0

External Interrupt 0

INT1

External Interrupt 1

OVF0,TIMER0, COUNTER0

TIMER0 overflow interrupt

OVF1,TIMER1,

 

COUNTER1

TIMER1 overflow interrupt

CAPTURE1, ICP1

INPUT CAPTURE TIMER1 interrupt

COMPARE1A,OC1A

TIMER1 OUTPUT COMPARE A interrupt

COMPARE1B,OC1B

TIMER1 OUTPUT COMPARE B interrupt

SPI

SPI interrupt

URXC

Serial RX complete interrupt

UDRE

Serial data register empty interrupt

UTXC

Serial TX complete interrupt

SERIAL

Disables URXC, UDRE and UTXC

ACI

Analog comparator interrupt

ADC

A/D converter interrupt

 

By default all interrupts are disabled.

To disable all interrupts specify INTERRUPTS.

 

To enable the enabling and disabling of individual interrupts use ENABLE INTERRUPTS.

The ENABLE INTERRUPTS serves as a master switch. It must be enabled/set in order for the individual interrupts to work.

 

The interrupts that are available will depend on the used microprocessor. The available interrupts are shown automatically in the editor.

 

 

Notice.jpg
 To disable the JTAG you can use DISABLED JTAG. The JTAG is not an interrupt but a device.

 

 

See also

ENABLE

 

 

Example


'-----------------------------------------------------------------------------------------
'name : serint.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : serial interrupt example for AVR
'micro : 90S8535
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
 
$regfile = "8535def.dat" ' specify the used micro
$crystal = 4000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
 
Const Cmaxchar = 20 'number of characters
 
Dim B As Bit 'a flag for signalling a received character
Dim Bc As Byte 'byte counter
Dim Buf As String * Cmaxchar 'serial buffer
Dim D As Byte
 
'Buf = Space(20)
'unremark line above for the MID() function in the ISR
'we need to fill the buffer with spaces otherwise it will contain garbage
 
Print "Start"
 
On Urxc Rec_isr 'define serial receive ISR
Enable Urxc 'enable receive isr
 
 
 
Enable Interrupts 'enable interrupts to occur
 
Do
If B = 1 Then 'we received something
 Disable Serial
 Print Buf 'print buffer
 Print Bc 'print character counter
 
 
 'now check for buffer full
 If Bc = Cmaxchar Then 'buffer full
 Buf = "" 'clear
 Bc = 0 'rest character counter
 End If
 
 Reset B 'reset receive flag
 Enable Serial
End If
Loop
 
Rec_isr:
Print "*"
If Bc < Cmaxchar Then 'does it fit into the buffer?
 Incr Bc 'increase buffer counter
 
 
 If Udr = 13 Then 'return?
 Buf = Buf + Chr(0)
 Bc = Cmaxchar
 Else
 Buf = Buf + Chr(udr) 'add to buffer
 End If
 
 
 ' Mid(buf , Bc , 1) = Udr
 'unremark line above and remark the line with Chr() to place
 'the character into a certain position
 'B = 1 'set flag
End If
B = 1 'set flag
Return

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language