This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

dis chargeing the capacitor in LPC2138 c plus plus

simulating in c plus plus. to discharge a 200uF/450v Electrolytic cap at the output takes longer time to discharge when we switch OFF the mains in No load / no lamp condition. .

Switching on the mains ( with PB1 ) while Cap is discharging gives high voltage spike and also giving hissing noise which may damage our speaker.

Ckt charges cap at 450v .

i need v.strng suggestion on this.

  • You are confused. Or your post is confused.

    Are you using a LPC2138 to simulate?
    Or are you using C++ on a PC to simulate a LPC2138 processor pin with external electronics?
    And what does hit have to do with Keil?
    And are you sure that your "high voltage spike" shouldn't be "high current spike"?

    You obviously need some electronics if you want a slow-charge of the cap. Such as a series resistor that gets disconnected after the capacitor have been fully charged.

    And of course an unloaded capacitor will have a very slow discharge rate - so if you want to make sure that the output pins are safe, then you need to have a discharge circuit that loads the capacitor when mains is removed.