chap12/pwm_dac.c File Reference
#include "pic24_all.h"
#include <stdio.h>
Go to the source code of this file.
Detailed Description
Demonstrates a PWM DAC - connect an RC filter on the OC1 output and vary the pulse width of the PWM signal, and monitor the DC value on the capacitor. The RC time constant should be at least 10x greater than the PWM period. Examples values used for testing were R=6.8k, C = 1.0u, PWM period= 500 us This projects uses an external crystal for accuracy. CLOCK_CONFIG=PRIPLL_8MHzCrystal_40MHzFCY is defined in the MPLAB project. Remove this macro if you wish to use the internal oscillator.
Definition in file pwm_dac.c.