10-27
EVENT PROCESSOR ARRAY (EPA)
void Init_PWM_toggle_PTS3(void)
{
disable(); /* disable all interrupts */
disable_pts(); /* disable the PTS interrupts */
PWM_toggle_CB_3.constant2 = 127;
PWM_toggle_CB_3.constant1 = 127;
PWM_toggle_CB_3.pts_ptr = (void *)&EPA0_TIME;
PWM_toggle_CB_3.ptscon = 0x42;
/* Sample code that could be used to generate a PWM with an EPA channel.*/
setbit(p1_reg, 0x1); /* init output */
clrbit(p1_dir, 0x1); /* set to output */
setbit(p1_mode, 0x1); /* set special function*/
setbit(ptssel, 0x8);
setbit(int_mask, 0x0)
}
void main(void)
{
Init_PWM_toggle_PTS3();
epa1_con = 0x78; /* toggle, timer1, compare, re-enable */
epa1_timer = 127;
t1control = 0xC2; /* enable timer, up 1 microsecond @ 16 MHz */
enable_pts();
while(1);
}