EMBEDDED SYSTEM APPLICATIONS

Page 133

Embedded System Applications REVIEW QUESTIONS

1.

Find the PR2 value and the suitable prescaler to get the following PWM frequencies. Assume XTAL = 20 MHz. Available prescaler is 1, 4 and 16.

2.

a.

kHz

b.

kHz

b.

78.125 kHz

Build a program to generate a 2.5 kHz PWM with a 70% DC on the CCP1 pin by using 4 prescaler and Fosc = 20 MHz.

3.

Design an embedded system complete with programming in C, which can be used to demonstrate a LED dimmer using internal PWM in PIC microcontroller. Schematic sketching must include a LED that is connected to the output of a CCP pin through a resistor to limit the current and two Push Button that act as switches to adjust the PWM duty cycle. The first switch is used to increase the duty cycle and the second switch is used to decrease the duty cycle. Set PWM period to 1 kHz with external OSC at 20 MHz.

124


Turn static files into dynamic content formats.

CreateΒ aΒ flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.