Hi, Ramius,

alo have a look here ... Microchip DS41214A-page 24 for high resolution PWM.

I have 2 lines: "Mclk var PortB.3" ... Do you change Mclk to "Mclk var long"?
I never heard about 32 bits PORTS on a single pin , ... to the day ...

I think you should learn some bits about Pics and PBP basics before trying to realize such " high level " projects ... that, friendly told.

Alain