::I need to write a control loop. Help please ..just give me some hints to= =20 ::write tha control loop... Xavier, Wasn't my reply to your main thread of any help? If you want to control a SMPS, then the BLDC app note I listed might be of= =20 help or even look at one of the control loops that Microsoft use. This is sample code for a Buck/Boost convert for a Pic33F http://ww1.microchip.com/downloads/en/DeviceDoc/Buck-Boost%20Converter%20PI Ctailplus%20SourceCode%20for%20dsPIC33FJ64GS610.zip This is for a buck converter with PID control http://ww1.microchip.com/downloads/en/DeviceDoc/CE021_PID_SMPS_GUI_14aug09. zip This is for a PWM SMPS using dsPics. http://ww1.microchip.com/downloads/en/DeviceDoc/CE020_Std_PWM_120309.zip This is for a dsPic SMPS with ADC http://ww1.microchip.com/downloads/en/DeviceDoc/CE031_ADC_Trig_PWM_120309.z ip Colin -- cdb, colin@btech-online.co.uk on 5/09/2011 =20 Web presence: www.btech-online.co.uk =20 =20 Hosted by: www.justhost.com.au =20 =20 This email is to be considered private if addressed to a named individual= =20 or HR department, and public if addressed to a blog, forum or news=20 article. =20 =20 =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .