C509-L_97 SIEMENS [Siemens Semiconductor Group], C509-L_97 Datasheet - Page 149
![no-image](/images/no-image-200.jpg)
C509-L_97
Manufacturer Part Number
C509-L_97
Description
8-Bit CMOS Microcontroller
Manufacturer
SIEMENS [Siemens Semiconductor Group]
Datasheet
1.C509-L_97.pdf
(290 pages)
- Current page: 149 of 290
- Download datasheet (5Mb)
On-Chip Peripheral Components
C509-L
6.3.6
Using Interrupts in Combination with the Compare Function
The compare service of registers CRC, CC1, CC2, CC3 and CC4 is assigned to alternate output
functions at port pins P1.0 to P1.4. Another option of these pins is that they can be used as external
interrupt inputs. However, when using the port lines as compare outputs then the input line from the
port pin to the interrupt system is disconnected (but the pin’s level can still be read under software
control). Thus, a change of the pin’s level will not cause a setting of the corresponding interrupt flag.
In this case, the interrupt input is directly connected to the (internal) compare signal thus providing
a compare interrupt.
The compare interrupt can be used very effectively to change the contents of the compare registers
or to determine the level of the port outputs for the next "compare match". The principle is, that the
internal compare signal (generated at a match between timer count and register contents) not only
manipulates the compare output but also sets the corresponding interrupt request flag. Thus, the
current task of the CPU is interrupted - of course provided the priority of the compare interrupt is
higher than the present task priority - and the corresponding interrupt service routine is called. This
service routine then sets up all the necessary parameters for the next compare event.
6.3.6.1
Some advantages in using compare interrupts
Firstly, there is no danger of unintentional overwriting a compare register before a match has been
reached. This could happen when the CPU writes to the compare register without knowing about
the actual timer 2 count.
Secondly, and this is the most interesting advantage of the compare feature, the output pin is
exclusively controlled by hardware therefore completely independent from any service delay which
in real time applications could be disastrous. The compare interrupt in turn is not sensitive to such
delays since it loads the parameters for the next event. This in turn is supposed to happen after a
sufficient space of time.
Please note two special cases where a program using compare interrupts could show a "surprising"
behavior:
The first configuration has already been mentioned in the description of compare mode 1. The fact
that the compare interrupts are transition activated becomes important when driving timer 2 with a
slow external clock. In this case it should be carefully considered that the compare signal is active
as long as the timer 2 count is equal to the contents of the corresponding compare register, and that
the compare signal has a rising and a falling edge. Furthermore, the "shadow latches" used in
compare mode 1 are transparent while the compare signal is active.
Thus, with a slow input clock for timer 2, the comparator signal is active for a long time (= high
number of machine cycles) and therefore a fast interrupt controlled reload of the compare register
could not only change the "shadow latch" - as probably intended - but also the output buffer.
When using the CRC or CC4 register, you can select whether an interrupt should be generated
when the compare signal goes active or inactive, depending on the status of bits I3FR or I2FR in
T2CON, respectively.
Initializing the interrupt to be negative transition triggered is advisive in the above case. Then the
compare signal is already inactive and any write access to the port latch just changes the contents
of the "shadow-latch".
Semiconductor Group
6-71
1997-10-01
Related parts for C509-L_97
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![c50-28-3](/images/no-image3.png)
Part Number:
Description:
Watts 28volts 200-450
Manufacturer:
ETC-unknow
Datasheet:
![C50-28](/images/no-image3.png)
Part Number:
Description:
50 WATTS - 28VOLTS 200-450 MHZ
Manufacturer:
ETC [List of Unclassifed Manufacturers]
Datasheet:
![S80C32-12](/images/manufacturer_photos/0/6/607/siemens_semiconductor_group_tmb.jpg)
Part Number:
Description:
Intel 80C32 - Siemens SAB-C501, Nearest Equivalent Replacement
Manufacturer:
Siemens Semiconductor Group
![BAT14-033](/images/no-image3.png)
Part Number:
Description:
HiRel Silicon Schottky Diode (HiRel Discrete and Microwave Semiconductor Medium barrier diodes for detector and mixer applications)
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
![BXY43-P1](/images/no-image3.png)
Part Number:
Description:
HiRel Silicon PIN Diode (HiRel Discrete and Microwave Semiconductor Current controlled RF resistor for RF attenuators and switches)
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
![BXY44-T1](/images/no-image3.png)
Part Number:
Description:
HiRel Silicon PIN Diode (HiRel Discrete and Microwave Semiconductor Current controlled RF resistor for RF attenuators and switches)
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
![IRL80](/images/no-image3.png)
Part Number:
Description:
GaAs-Infrarot-Sendediode GaAs Infrared Emitter
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
![IRL81](/images/no-image3.png)
Part Number:
Description:
GaAlAs-Infrarot-Sendediode GaAlAs Infrared Emitter
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
![BSM50GB100D](/images/manufacturer_photos/0/6/607/siemens_semiconductor_group_tmb.jpg)
Part Number:
Description:
IGBT MODULE
Manufacturer:
Siemens Semiconductor Group
Datasheet:
![BSM181R](/images/manufacturer_photos/0/6/607/siemens_semiconductor_group_tmb.jpg)
Part Number:
Description:
SIMOPAC Module (Power module Single switch N channel Enhancement mode)
Manufacturer:
Siemens Semiconductor Group
Datasheet:
![BSM254F](/images/manufacturer_photos/0/6/607/siemens_semiconductor_group_tmb.jpg)
Part Number:
Description:
(BSMxxx) TRANSISTOR
Manufacturer:
Siemens Semiconductor Group
Datasheet:
![BSM111AR](/images/manufacturer_photos/0/6/607/siemens_semiconductor_group_tmb.jpg)
Part Number:
Description:
SIMOPAC Module (Power module Single switch N channel Enhancement mode)
Manufacturer:
Siemens Semiconductor Group
Datasheet:
![BUZ48](/images/manufacturer_photos/0/6/607/siemens_semiconductor_group_tmb.jpg)
Part Number:
Description:
main ratings
Manufacturer:
Siemens Semiconductor Group
Datasheet:
![TDA4716C](/images/manufacturer_photos/0/6/607/siemens_semiconductor_group_tmb.jpg)
Part Number:
Description:
Manufacturer:
Siemens Semiconductor Group
Datasheet: