Positron Compiler Documentation

HPWM Declares.

Positron8 · Revision 4.0.6.5 · PDF page 430

Some devices have alternate pins that may be used for HPWM. The following Declares allow the use of different pins: -

Declare CCP1_Pin = Port.Pin ' Select HPWM port and bit for CCP1 module (ch 1)
Declare CCP2_Pin = Port.Pin ' Select HPWM port and bit for CCP2 module (ch 2)
Declare CCP3_Pin = Port.Pin ' Select HPWM port and bit for CCP3 module (ch 3)
Declare CCP4_Pin = Port.Pin ' Select HPWM port and bit for CCP4 module (ch 4)
Declare CCP5_Pin = Port.Pin ' Select HPWM port and bit for CCP5 module (ch 5)
Declare CCP6_Pin = Port.Pin ' Select HPWM port and bit for CCP6 module (ch 6)

Or

Declare HPWM1_Pin = Port.Pin ' Select HPWM port and bit for PWM1 module (ch 1)
Declare HPWM2_Pin = Port.Pin ' Select HPWM port and bit for PWM 2 module (ch 2)
Declare HPWM3_Pin = Port.Pin ' Select HPWM port and bit for PWM 3 module (ch 3)
Declare HPWM4_Pin = Port.Pin ' Select HPWM port and bit for PWM 4 module (ch 4)
Declare HPWM5_Pin = Port.Pin ' Select HPWM port and bit for PWM 5 module (ch 5)
Declare HPWM6_Pin = Port.Pin ' Select HPWM port and bit for PWM 6 module (ch 6)

Both texts after the declare; HPWMx_Pin or CCPx_Pin are valid for all devices that contain, either CCP peripherals or PWM peripherals.

For devices that have PPS (Peripheral Pin Select), the compiler will manipulate the appropriate SFRs before the program starts, so that the PWM signal is produced correctly.

View original PDF page 430Open page in PDFOriginal PDF page 430