1 Continuous MCPWM at a time


Closed Thread
Results 1 to 40 of 47

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: 1 Continuous MCPWM at a time

    You're getting the picture..

    12kHz you tried before bumped it up over 10-bit resolution. If you're stuck with 10-bit A/D just figure out a frequency with 10-bit resolution.

    I think 12kHz worked out to around 10.7-bit, but it was enough to shift it up >10-bits.
    Regards,

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

  2. #2
    Join Date
    Jul 2011
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: 1 Continuous MCPWM at a time

    My oscillator is 20MHz, and my PWM can't be over 15 KHz frequency.
    If I understand this right, (with the formula resolution page 185, equation 18-4), to have a 10 bit resolution to match the analogue/digital module, I probably need to change the value of my oscillator ? (as I don't want a PWM frequency above 14KHz).

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


    Did you find this post helpful? Yes | No

    Default Re: 1 Continuous MCPWM at a time

    You should be able to divide the frequency by setting it up for Center-Aligned mode. Try my example for 19.455kHz, change PTCON0 = 0 to PTCON0 = 2.

    That should give you roughly 9.7kHz, and let you keep the 10-bit resolution.

    At least that's my guess after reading the note just above table 18-2. Seems like it would work just fine, and you can keep the 20MHz osc. If this freq will work for you?
    Regards,

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

  4. #4
    Join Date
    Jul 2011
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: 1 Continuous MCPWM at a time

    yes, that would work, thank you, I will try that first thing in the morning tomorrow I will, of course, let you know.
    Thanks again for the help, really appreciate !

  5. #5
    Join Date
    Jul 2011
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: 1 Continuous MCPWM at a time

    I have tried this, and it is still at 68% duty cycle maximum... I also tried with a 4MHz oscillator and PTCON0 = 0, and it gives also 68%.
    What are we missing ?
    Getting desesperate as I thought this would work but it seems it's not really the problem.. is it ?

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


    Did you find this post helpful? Yes | No

    Default Re: 1 Continuous MCPWM at a time

    Have you checked the output of your potentiometer? It works just as expected for me from 0 to 100% duty-cycle on an 18F4431 @ 20MHz.

    Try the attached without making any changes.

    PCPWM_AD.txt
    Regards,

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

  7. #7
    Join Date
    Jul 2011
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: 1 Continuous MCPWM at a time

    Thanks it is working now, I made a huge mistake that I am so ashamed to make you waste your time with me. I am testing everything on a breadboard and my potentiometer was still connected to a resistance somewhere... I feel silly. Well at least it is working.

    I am grateful for your time and your patience.

    I am now getting started with my commutation sequence. Thank you again !
    Even if this pic is complicated, I'm starting to see how powerful it is.

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