![Intel 8XC196NT User Manual Download Page 248](http://html1.mh-extra.com/html/intel/8xc196nt/8xc196nt_user-manual_2072210248.webp)
10-15
EVENT PROCESSOR ARRAY (EPA)
The worst-case interrupt latency for a single-interrupt system is 56 state times for external stack
usage and 54 state times for internal stack usage (see “Standard Interrupt Latency” on page 5-9).
To determine the execution time for an interrupt service routine, add up the execution time of the
instructions in the ISR (Table A-9).
The total execution time for the ISR that services interrupts EPA3:0 is 79 state times for external
stack usage or 71 state times for internal stack usage. Therefore, a single capture/compare channel
0–3 can be updated every 125 state times assuming internal stack usage (54 + 71). Each PWM
period requires two updates (one setting and one clearing), so the execution time for a PWM pe-
riod equals 250 state times. At 20 MHz, the PWM period is 25 µs and the maximum PWM fre-
quency is 40 kHz.
The total execution time for the ISR that services the EPAx (capture/compare channels 4–9) in-
terrupt is 175 state times for external stack usage or 159 for internal stack usage. Therefore, a sin-
gle capture/compare channel 4–9 can be updated every 213 state times assuming internal stack
usage (54 + 159). Each PWM period requires two updates (one setting and one clearing), so the
execution time for a PWM period equals 426 state times. At 20 MHz, the PWM period is 42.6 µs
and the maximum PWM frequency is 23.47 kHz.
10.4.2.2
Generating a Medium-speed PWM Output
You can generate a medium-speed, pulse-width modulated output with a single EPA channel and
the PTS set up in PWM toggle mode. “PWM Toggle Mode Example” on page 5-33 describes how
to configure the EPA and PTS. Once started, this method requires no CPU intervention unless you
need to change the output frequency. The method uses a single timer/counter. The timer/counter
is not interrupted during this process, so other EPA channels can also use it if they do not reset it.
The maximum output frequency depends upon the total interrupt latency and interrupt-service ex-
ecution time. As additional EPA channels and the other functions of the microcontroller are used,
the maximum PWM frequency decreases because the total interrupt latency and interrupt-service
execution time increases. To determine the maximum, medium-speed PWM frequency in your
system, calculate your system's worst-case interrupt latency and worst-case interrupt-service ex-
ecution time, and then add them together. The worst-case interrupt latency is the total latency of
all the interrupts (both normal and PTS) used in your system. The worst-case interrupt-service
execution time is the total execution time of all interrupt service routines and PTS cycles.
The following example shows the calculations for a system that uses a single EPA channel, a sin-
gle enabled interrupt, and PTS service. This example assumes that the PTS has been initialized,
the duty cycle and frequency are fixed, and that the interrupt from the capture/compare channel
is not multiplexed (i.e., EPA3:0).
Summary of Contents for 8XC196NT
Page 1: ...8XC196NT Microcontroller User s Manual...
Page 2: ...8XC196NT Microcontroller User s Manual June 1995 Order Number 272317 003...
Page 22: ...1 Guide to This Manual...
Page 23: ......
Page 35: ......
Page 36: ...2 Architectural Overview...
Page 37: ......
Page 49: ......
Page 50: ...3 Programming Considerations...
Page 51: ......
Page 66: ...4 Memory Partitions...
Page 67: ......
Page 104: ...5 Standard and PTS Interrupts...
Page 105: ......
Page 147: ......
Page 148: ...6 I O Ports...
Page 149: ......
Page 176: ...7 Serial I O SIO Port...
Page 177: ......
Page 194: ...8 Synchronous Serial I O SSIO Port...
Page 195: ......
Page 211: ......
Page 212: ...9 Slave Port...
Page 213: ......
Page 231: ......
Page 232: ...10 Event Processor Array EPA...
Page 233: ......
Page 270: ...11 Analog to digital Converter...
Page 271: ......
Page 291: ......
Page 292: ...12 Minimum Hardware Considerations...
Page 293: ......
Page 306: ...13 Special Operating Modes...
Page 307: ......
Page 317: ......
Page 318: ...14 Interfacing with External Memory...
Page 319: ......
Page 362: ...15 Programming the Nonvolatile Memory...
Page 363: ......
Page 408: ...A Instruction Set Reference...
Page 409: ......
Page 476: ...B Signal Descriptions...
Page 477: ......
Page 493: ......
Page 494: ...C Registers...
Page 495: ......
Page 565: ......
Page 566: ...Glossary...
Page 567: ......
Page 580: ...Index...
Page 581: ......
Page 597: ......