Remote-processing RPC-2350 Bedienungsanleitung Seite 57

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 83
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 56
INTERRUPTS CHAPTER 13
13-2
jumper s from W7 if using external interrupts. IN T1 is
tied to a 10K ohm pull up resistor.
The O N ITR n GO SUB line/label tasking statem ent is
used to initialize interrupts 0 and 1.
INT 0 and INT 1 are level sensitive. As long as the line
is low, an interrupt is generated. This can be a blessing
and curse, depending upon the application. Make sure
you turn off or reset your external hardware interrupt
source before executing a RETURN ITR n.
Hardware service routines require a RETURN ITR n at
the end of the subroutine. This will re-enable the
particular interrupt. If, for some reason you do not want
the interrupt again, you can just RETURN. Some
applications may actually require a delayed RETURN
ITR. This is true if you are monitoring a slow moving
pulse at the counter. When an interrupt is generated, the
low signal output may not go away by the time the
interrupt is finished. You can simply set a flag to let the
main routine know later to re-enable the interrupt when
the condition is gone. See CNTR2.BAS for an example.
Later you can execute RETUR N ITR n to re-enable it.
The CLOC K1. BAS routine shows how interr upt 0 is
used.
INT1 is available at J10-2. It is active low, level
sensitive, and is used in conjunction with the counter
carry or bor row output or an external signal applied to
J10.
NOTE: Interrupts are fr equently tur ned off while
CAMBASIC runs certain time critical code.
Times when interrupts are turned off include
graphic display writing (when sparkle is on),
brief periods when servicing communication
interrupts, and wr iting to Flash. Normally a
pulse 10 micro-Seconds wide can cause an
interrupt. However, if you are saving to flash
or to the graphics screen, the pulse should be
100 micro-Seconds to ensure capture.
NOTE: Interrupt 0 and 1 are level sensitive. As long
as the line is low, another interrupt will be
called as soon as RETURN ITR is executed.
Make sure you clear the source of the interrupt
before executing RETURN ITR.
SOFTWARE INTERRUPTS
Software interrupts are all other “O N” types. T hese
interrupts look for an interrupt condition in software.
The ON BIT, ON INP, ON KEYPAD$, ON COUNT,
and ON TICK routines either scan or count first then
determine if an interrupt should be declared. All of the
above routines oper ate on a 5 mS interval. That is,
every 5 mS lines are scanned, counters checked, and so
on.
Commands that look at digital I/O lines, such as ON
BIT, requir e a stable input condition for at least 5 ms in
order to be recognized.
All of the subroutines use a simple RETURN to continue
execution from where it was interrupted from.
See the examples in the CAMBASIC manual for more
information on using these tasking statements.
COMMANDS
The follow ing comm ands are used for interrupts in
CAMBASIC.
Command Function
ON BIT Interrupt on line change
ON COM$ Interrupt on serial data
ON COUNT Interrupt when count
reached
ON INP Interrupt on bit mask
ON ITR Hardware interrupt
ON KEYPAD$ Interrupt on key press
ON TICK Periodic interr upts
RETURN ITR Return from hardware
interrupt.
Seitenansicht 56
1 2 ... 52 53 54 55 56 57 58 59 60 61 62 ... 82 83

Kommentare zu diesen Handbüchern

Keine Kommentare