Best way to shut down HPWM channel?


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9

    Default Best way to shut down HPWM channel?

    Hi,

    I am playing with a circuit that charges a capacitor and then dumps it into a battery (pulse charging). All I need to do is turn HPWM channel 1 on and charge cap, then turn HPWM channel 1 off and Turn HPWM channel 2 on to dump the charge back to the battery. Code is attached, but I am wondering if setting CCP1CON to disable is the best way to turn off channel 1 before I turn on channel 2?

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post

    I have used following to turn off HPWM.
    Code:
    <body><!--StartFragment--><pre><code><font color="#000000">    CCP1CON = %00000000
        T2CON.2 = 0
    </code>
    Don't know if that is right way to do it, but it is working
    It would be nice to hear if there is some better way to do that.

    BR,
    -Gusse-

  3. #3
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Why do you need to turn the channel off? Do you need to use that channel for something else also?

    Can't you just set the PWM duty cycle to 0?

    HPWM 1, 0, 3550


    steve

  4. #4
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9


    Did you find this post helpful? Yes | No

    Default Channel shut down

    Hi,

    Sure, I guess I could take the duty cycle to zero. I suppose I can test it.

    I needed to shut the first channel off because this is a closed loop system, I.E. Battery, Mosfet > inductor > bridge > cap > mosfet > battery. Therefore I needed to isolate the input from the output to some degree. The goal was to see if lead acid desulfation can occur if a constant pulse is sent to the battery after charging a cap.

    In theory it should work because we are forcing the lead sulfate back into solution in a brute force kind of method with a high voltage and high current pulse.

    Thanks for the suggestions guys. I suppose either method will work equally well, I just wonder how many clock cycles it will take for either method or if it's even a concern. I'd surely like to use the fastest method.
    Last edited by LetTheSmokeOut; - 26th January 2010 at 21:06.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The fastest approach is probably just setting the pin to input. Then flipping it back to
    output when you need PWM on again.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9


    Did you find this post helpful? Yes | No

    Default PWM shutdown

    Thanks Bruce, I will try that as well.

    Tad

Similar Threads

  1. Multiple HPWM question
    By Johan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th October 2007, 13:00
  2. need help on hpwm
    By helmut in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th August 2007, 15:49
  3. HPWM of the port of two HPWM
    By ja2rqk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 15:05
  4. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  5. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts