SW006010 Microchip Technology, SW006010 Datasheet - Page 47

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
 2002 Microchip Technology Inc.
2.9.2
#include <p17c756.h>
#include <pwm16.h>
#include <timers16.h>
void main(void)
{
}
SetDCPWM1
SetDCPWM2
SetDCPWM3 (Continued)
Remarks:
Return Value:
File Name:
Code Example:
int i;
//set duty cycle
SetDCPWM2(0);
//open PW2
OpenPWM2(T1_SOURCE,0xff);
//open timer
OpenTimer1(TIMER_INT_OFF&T1_SOURCE_INT&T1_T2_8BIT);
for(i=0;i<1024;i++)
{
ClosePWM2();
CloseTimer1();
return;
while(!PIR1bits.TMR1IF);
PIR1bits.TMR1IF = 0;
SetDCPWM2(i);
}
Example of Use
This function writes the new value for dutycycle to the specified
PWM channel dutycycle registers.
PWM1:
PWM2:
PWM3:
The maximum resolution of the PWM waveform can be
calculated from the period using the following formula:
Resolution (bits) = log(F
None
pw1set.c
pw2set.c
pw3set.c
SetDCPWM2(0);
//slowly increment duty cycle
//close modules
PW1DCL,PW1DCH
PW2DCL,PW2DCH
PW3DCL,PW3DCH
Hardware Peripheral Library
OSC
/F
PWM
) / log(2)
apRNOVS^-page 43

Related parts for SW006010