to generate 4 pwm signals with fixed frrequency and varying duty cycle using a pic

Status
Not open for further replies.
hi horace, if i use timer2, i need to fill in PR value. then what do you think my OCxR AND OCxRS WOULD BE.
iPPSOutput(OUT_PIN_PPS_RP2, 19); // set OC2 output to pin RP2 ,CAN U EXPLAIN THIS STAEMENT ALSO.
so if i am using timer 2 ,what would be my ocxr and ocxrs value for 1khz.
 

have a look at the Microchips example project
https://ww1.microchip.com/downloads/en/DeviceDoc/CE320 Output Compare - Simple PWM.zip

which has eight PWM outputs four using the system clock and four using timer1

with PPS you have to tell the processor which pins are input and which are output for pheripherals such as UARTS, SPI, etc (some are fixed pins, e.g. USB and I2C)
Code:
iPPSOutput(OUT_PIN_PPS_RP2, 19); // set OC2 output to pin RP2 ,CAN U EXPLAIN THIS STAEMENT ALSO.
this specifies pin RP2 is PPS output function 19 OC2 (in this case the PWM output)
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…