PCD COMMAND LINE COMPILER Custom Computer Services Inc (CCS), PCD COMMAND LINE COMPILER Datasheet - Page 271
PCD COMMAND LINE COMPILER
Manufacturer Part Number
PCD COMMAND LINE COMPILER
Description
PCD C-COMPILER PIC24, DSPIC
Manufacturer
Custom Computer Services Inc (CCS)
Type
Compilerr
Datasheet
1.PCD_COMMAND_LINE_COMPILER.pdf
(373 pages)
Specifications of PCD COMMAND LINE COMPILER
For Use With/related Products
Microchip PIC24/dsPIC®
Lead Free Status / RoHS Status
Not applicable / Not applicable
Other names
429-1007
- Current page: 271 of 373
- Download datasheet (4Mb)
set_pwm_duty( )
Syntax:
Parameters:
Returns:
Function:
Availability:
Requires:
Examples:
Example Files:
Also See:
set_pwm_duty(x, value)
x is 1-8 and defines the output compare module to set duty for
value is a 16 bit constant or variable specifying the duty of the module
None
Writes the 16-bit value to the PWM to set the duty. The duty is set by defining the
amount of the timer period that is to be high. The duty cycle can be calculated as
follows:
Where PRx is the period register value of the timer being used for output compare
and duty is the percent of the period that is to remain high. By default PRx =
65535.
The PWM period can be found as follows:
Where Tcy is the instruction clock of the PIC [for dsPIC30 Tcy = 2/(Extern Clock ),
for PIC24 and dsPIC33 Tcy = 4/(Extern Clock)] and TMRx Prescale is any
prescaler value given to the timer being used for output compare, done using
Only available on devices with Output Compare modules
None
// For a 20 MHz clock
// on a chip with an instruction clock of 20MHz/4 and
// timer prescaler set to 16 with default PRx
// The following sets the duty to 50%.
int16 duty;
duty = 32768: // = 0.5 * 65536
setup_timer3(TMR_INTERNAL);
set_pwm_duty(2, duty);
setup_compare(2, COMPARE_PWM);
ex_pwm.c
get_capture(
setup_timerx().
value = duty * (PRx + 1)
period = [(Prx) + 1] * Tcy * (TMRx Prescale)
),
setup_compare(
),
Output Compare
/ PWM Overview
257
Related parts for PCD COMMAND LINE COMPILER
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
PROTOTYPING BOARD FOR PIC MCU
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
Extra CCS C Manual
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
MACH X Programmer
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
PCD For 24-bit (PIC24/dsPIC)
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
LOAD-n-GO Programmer
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
EMBEDDED INTERNET DEVELOPMENT KIT W/PCWH
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
PIC24F Development Kit With PCWHD
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
PIC24F Development Kit With PCDIDE
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
PIC24H Development Kit With PCWHD
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
PIC24H Development Kit With PCDIDE
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
PIC18F6722 Embedded C Development Kit With PCWH Compiler
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
PIC18F8722 Embedded C Development Kit With PCWH Compiler
Manufacturer:
Custom Computer Services Inc (CCS)
Part Number:
Description:
USB Master Prototyping Board
Manufacturer:
Custom Computer Services Inc (CCS)