Intel Microcontroller Sample Calculations, Enabling the PWM Outputs, Generating Analog Outputs

Models: Microcontroller 80C196NU 8XC196NP

1 471
Download 471 pages 22.3 Kb
Page 194
Image 194

PULSE-WIDTH MODULATOR

9.5.1Sample Calculations

For example, assume that the operating frequency equals 25 MHz, the desired period of the PWM output waveform is either 20.48 µs (512 state times) if the divide-by-two prescaler is disabled or

40.96µs (1,024 state times) if the prescaler is enabled. If PWMx_CONTROL equals 8AH (138 decimal), the pulsewidth is held high for 11.04 µs (and low for 9.44 µs) of the total 20.48 µs pe- riod, resulting in a duty cycle of approximately 54%. If the prescaler is enabled, the same values would produce a period of 40.96 µs with the pulsewidth being held high for 22.08 µs (and low for

18.88µs), for the same duty cycle, approximately 54%.

9.5.2Enabling the PWM Outputs

Each PWM output is multiplexed with a port pin, so you must configure it as a special-function output signal before using the PWM function. To do so, follow this sequence:

1.Clear the corresponding bit of P4_DIR (see Table 9-5).

2.Set the corresponding bit of P4_MODE (see Table 9-5).

3.Set or clear the corresponding bit of P4_REG (see Table 9-5).

Table 9-5 shows the alternate port function along with the register setting that selects the PWM output instead of the port function.

Table 9-5.PWM Output Alternate Functions

PWM Output

Alternate Port Function

PWM Output Enabled When:

 

 

 

PWM0

P4.0

P4_DIR.0 = 0, P4_MODE.0 = 1, P4_REG = X

 

 

 

PWM1

P4.1

P4_DIR.1 = 0, P4_MODE.1 = 1, P4_REG = X

 

 

 

PWM2

P4.2

P4_DIR.2 = 0, P4_MODE.2 = 1, P4_REG = X

 

 

 

9.5.3Generating Analog Outputs

The PWM modules can generate a rectangular pulse train that varies in duty cycle and period. Filtering this output will create a smooth analog signal. To make a signal swing over the desired analog range, first buffer the signal and then filter it with either a simple RC network or an active filter. Figure 9-6 is a block diagram of the type of circuit needed to create the smooth analog sig- nal.

9-9

Page 194
Image 194
Intel Microcontroller, 80C196NU, 8XC196NP Sample Calculations, Enabling the PWM Outputs, PWM Output Alternate Functions

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.