Re: dsPIC33CK256MP506 hysteretic mode configuration for PWM and Comparator
I have figured it out.
In my setup i have an external comparator connected to PCI8. The inverting input is connected to DACOUT1, and the noninverting to the current feedback signal (the same composition as the one integrated in the chip)
The changes I made to the example in are:
PG1CLPCILbits.TSYNCDIS=1;//Termination of latched PCI occurs immediately
PG1IOCONHbits.PMOD=1; // Set the outputs in independent mode
PG1LEBHbits.PHF=1;//Add LEB to both fronts
The other bits are the same, as the example code.
Also, in the configuration of the DAC i have changed the SSTIME and TMODTIME.
This is a little bit tricky and i have not made extensive tests yet to determine the best values, but with:
DACCTRL2Hbits.SSTIME = 0x350;
Also, I am using FPLL0 as clock source, so DACCTRL1Lbits.CLKSEL = 3;
Hope this helps.