Swiching Mode Charger / PWM questions


Results 1 to 8 of 8

Threaded View

  1. #3
    Join Date
    Sep 2013
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Swiching Mode Charger / PWM questions

    Henrik,

    Thanks for the information and ideas. You confirmed several things I was thinking.

    I had an idea that I could up the oscillator speed and use PLL but wasn't sure. And in that regards, to enable my PLL, which of the following would I implement (or something else):

    PLLEN = ON

    or

    OSCTUNE = %11000000


    Secondly, I looked at my code again and I have the following line in my configuration section:

    OSCCON = %11100010

    Doesn't that indicate that my oscillator is already set to 8MHz? I was under the impression that I was configured for 4MHz, but again, I am the newbie at this.

    Lastly, please let me know if the following lines would get me in the ballpark of what I would like to do... or if I have any idea of what is going on yet....

    PR2 = 16 'pwm = 125000Hz (I changed my desired freq. PicCalc showed me that this freq would give me 256 steps to my pwm)
    CCPR2L = 128 'duty at approx 50% (PR2*0.50)
    TRISC.1 = 0 'make CCP2 output
    T2CON = %00000100 'start timer2
    CCP2CON = %00001100 'lowest duty bits and PWM on 2

    .... and then I would manipulate the CCPR2L register to change the duty cycle.... no??....

    Thanks again.
    Last edited by almarsh; - 23rd September 2013 at 16:11.

Similar Threads

  1. 18F4431 - Complementary mode PWM
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 15th December 2011, 11:23
  2. 18F2331 Advanced PWM Questions
    By JDM160 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th July 2010, 23:04
  3. 9V NiMH charger
    By bogdan in forum Schematics
    Replies: 0
    Last Post: - 10th September 2009, 03:43
  4. switch mode power supply with PWM
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 14th July 2009, 20:51
  5. Adcin charger
    By mitchf14 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th November 2008, 21:49

Members who have read this thread : 0

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