Cycle-By-Cycle current limit using dsPIC33EP16GS502
Posted: Tue Nov 01, 2016 7:52 am
Hello,
I am using the dsPIC33EP16GS502 to control a push-pull boost transformer.
The PWM signals or working. I want to use the internal comparator and DAC to cycle-by-cycle limit the primary current via current sense resistor.
I can't figure out how to map the comparator-1D output to the current limit function for the PWM1 channel. I have this working on the dsPIC33FJ16GS502 using the RPOR0 and RPINR12 to map this but the new device is different. Any suggestions?
Look at section 10-1, in the sheet 700000323.pdf
The comparator has to be routed to a pin, on chips that do not have direct routing. This one however supports direct routing. This is where the big difference appears.
Unless you want the interrupt on fault, you don't need the HSPWM_CURRENT_LIMIT_INT_ENABLED.
The fault controls are active high. Are you sure you have the comparator setup correctly to give this?. If not you'll need HSPWM_CURRENT_LIMIT_ACTIVE_LOW
The comparator is comparing input D (AN3), with the DAC. You are also outputting the DAC to the DACOUT pin. Is this giving the voltage you expect?.
Old question 'compiler version'?. Quite possible the compiler is setting something wrong. It basically looks as if it should work.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum