![Intel 80C196NU Скачать руководство пользователя страница 223](http://html1.mh-extra.com/html/intel/80c196nu/80c196nu_user-manual_2072209223.webp)
8XC196NP, 80C196NU USER’S MANUAL
10-26
time_value = epa0_time; /* must read to prevent overrun */
}
void init_timer1()
{
t1control =
COUNT_ENABLE
¦
COUNT_UP
¦
CLOCK_INTERNAL
¦
DIVIDE_BY_1;
}
void main(void)
{
unsigned int time_value;
/* Initialize the timers and interrupts before using the EPA */
init_timer1();
init_epa0();
enable();
/* Globally enable interrupts */
while(1);
/* loop forever, wait for interrupts to occur */
}
10.8.3 EPA PWM Output Program
This example C program demonstrates the generation of a PWM signal using the EPA’s PWM
toggle mode (see “PWM Modes” on page 6-26) and shows how to service the interrupts with the
PTS. The PWM signal in this example has a 50% duty cycle.
#pragma model(EX)
#include <80c196np.h>
#define PTS_BLOCK_BASE 0x98
/* Create typedef template for the PWM_TOGGLE mode control block.*/
typedef struct PWM_toggle_ptscb_t {
unsigned char unused;
unsigned char ptscon;
void *pts_ptr;
unsigned int constant1;
unsigned int constant2;
} PWM_toggle_ptscb;
/* This locates the PTS block mode control block in register ram. This */
/* control block may be located at any quad-word boundary. */
register PWM_toggle_ptscb PWM_toggle_CB_3;
#pragma locate(PWM_toggle_CB_3=PTS_BLOCK_BASE)
/* The PTS vector must contain the address of the PTS control block.*/
#pragma pts(PWM_toggle_CB_3=0x3)
/* Sample PTS control block initialization sequence.*/
Содержание 80C196NU
Страница 1: ...8XC196NP 80C196NU Microcontroller User s Manual...
Страница 2: ...8XC196NP 80C196NU Microcontroller User s Manual August 1995 Order Number 272479 002...
Страница 18: ...1 Guide to This Manual...
Страница 19: ......
Страница 31: ......
Страница 32: ...2 Architectural Overview...
Страница 33: ......
Страница 48: ...3 Advanced Math Features...
Страница 49: ......
Страница 56: ...4 Programming Considerations...
Страница 57: ......
Страница 72: ...5 Memory Partitions...
Страница 73: ......
Страница 106: ...6 Standard and PTS Interrupts...
Страница 107: ......
Страница 144: ...7 I O Ports...
Страница 145: ......
Страница 165: ......
Страница 166: ...8 Serial I O SIO Port...
Страница 167: ......
Страница 183: ......
Страница 184: ...9 Pulse width Modulator...
Страница 185: ......
Страница 196: ...10 Event Processor Array EPA...
Страница 197: ......
Страница 225: ......
Страница 226: ...11 Minimum Hardware Considerations...
Страница 227: ......
Страница 239: ......
Страница 240: ...12 Special Operating Modes...
Страница 241: ......
Страница 255: ......
Страница 256: ...13 Interfacing with External Memory...
Страница 257: ......
Страница 303: ......
Страница 304: ...A Instruction Set Reference...
Страница 305: ......
Страница 373: ......
Страница 374: ...B Signal Descriptions...
Страница 375: ......
Страница 390: ...C Registers...
Страница 391: ......
Страница 447: ......
Страница 448: ...Glossary...
Страница 449: ......
Страница 458: ...Index...
Страница 459: ......