Intel 80C196NU, 8XC196NP, Microcontroller manual EPA Capture Event Program

Models: Microcontroller 80C196NU 8XC196NP

1 471
Download 471 pages 22.3 Kb
Page 222
Image 222

EVENT PROCESSOR ARRAY (EPA)

void poll_epa0()

{

if(checkbit(int_pend, EPA0_INT_BIT))

{

/* Insert user code for event channel 0 here. */

/* Since this event is absolute and re-enabled, no polling is neccessary.*/ clrbit(int_pend, EPA0_INT_BIT);

}

}

void main(void)

{

/* Initialize the timers before using the epa */ init_timer1();

init_epa0();

/* EPA events can be serviced by polling int_pend or epa_pend. */ while(1)

{

poll_epa0();

}

}

10.8.2 EPA Capture Event Program

This example C program demonstrates an EPA capture event. It sets up EPA channel 0 to capture edges (rising and falling) on the EPA0 pin. The program also shows how to set up an the EPA interrupt. You can add your own code for the interrupt service routine.

#pragma model(EX) #include <80c196np.h>

#define

COUNT_ENABLE

0x80

 

 

#define

COUNT_UP

0x40

 

 

#define

CLOCK_INTERNAL

0x00

 

 

#define DIVIDE_BY_1

0x00

 

 

#define

CAPTURE

0x00

 

 

#define

BOTH_EDGE

0x30

 

 

#define

USE_TIMER1

0x00

 

 

#define EPA0_INT_BIT

7

 

 

void init_epa0()

 

 

 

{

 

 

 

 

epa0_con = CAPTURE ¦

¦

 

 

 

BOTH_EDGE

 

 

 

USE_TIMER1;

 

 

setbit(p1_reg, 0); /*

int reg */

 

 

setbit(p1_dir, 0); /*

make input

pin

*/

setbit(p1_mode, 0);/*

select EPA

mode

*/

setbit(int_mask, EPA0_INT_BIT);/*

unmask EPA interrupts */

}

 

 

 

 

#pragma interrupt(epa0_interrupt=EPA0_INT_BIT) void epa0_interrupt()

{

unsigned int time_value;

10-25

Page 222
Image 222
Intel 80C196NU, 8XC196NP, Microcontroller manual EPA Capture Event Program

Microcontroller, 80C196NU, 8XC196NP specifications

The Intel 8XC196NP and 80C196NU microcontrollers are part of Intel's renowned 16-bit microcontroller series that gained popularity in the 1980s and 1990s for embedded systems applications. Designed for a variety of applications, these microcontrollers are characterized by their robust performance, versatility, and industry-standard architecture.

The 8XC196NP features an enhanced instruction set with over 100 instructions, allowing for efficient code execution. It operates at clock speeds up to 16 MHz, which contributes to improved performance in time-sensitive applications. The microcontroller is equipped with a 16-bit data bus, enabling more efficient data handling compared to its 8-bit predecessors, thus accommodating complex algorithms and large data sets.

In terms of memory architecture, the 8XC196NP supports an addressable memory space of up to 64 KB of program memory and 64 KB of data memory. This configuration provides sufficient space for large applications while ensuring fast data access. The microcontroller includes integrated features such as timers, serial I/O capabilities, and interrupt processing, which enhance its functionality for real-time applications and control mechanisms.

The 80C196NU, on the other hand, is designed for lower power operation, making it suitable for battery-powered devices. This microcontroller maintains similar features to the 8XC196NP while offering advancements that support low-power consumption. The 80C196NU can also function in a range of temperature environments, making it adaptable for industrial applications.

Both the 8XC196NP and 80C196NU support external memory interfacing, allowing designers to expand the system's capability by connecting additional ROM and RAM. This flexibility makes them appealing for developing complex systems, such as motor controls, industrial automation, and consumer electronics.

Another standout feature of these microcontrollers is their built-in debugging capabilities. Intel provided hardware and software tools that enabled developers to test and troubleshoot their applications effectively, reducing the development time and increasing reliability.

Overall, the Intel 8XC196NP and 80C196NU microcontrollers stand out for their dependability, versatility, and performance, contributing significantly to the evolution of embedded system design. Their legacy continues to influence modern microcontroller technology, ensuring their relevance in a wide array of applications today.