CCP1 CCP2 Accuracy?


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322

    Default CCP1 CCP2 Accuracy?

    Has anyone ever checked to see how accurate the frequency is when using theHMPW command?

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: CCP1 CCP2 Accuracy?

    Hi, Ramius

    The answer is in the Pic Datasheet "CCP config in PWM mode" section ... AND thinking PBP HPWM resolution is 8 Bits ... ( 10 bits using Darrel's HPWM10 )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: CCP1 CCP2 Accuracy?

    Thank you again Alain!
    I have two different "scopes" and neither will show the correct frequency. I would love to use Daniel Taylors HPWM10 and beyong the "include" I am not certain how to implement the changes I have 2 lines: "Mclk var PortB.3" and "hpwm10 1, 50, 32768". Do you change Mclk to "Mclk var long"? And if you do how do you define the port to be used? Thanks, Ed

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: CCP1 CCP2 Accuracy?

    Hi, Ramius,

    alo have a look here ... Microchip DS41214A-page 24 for high resolution PWM.

    I have 2 lines: "Mclk var PortB.3" ... Do you change Mclk to "Mclk var long"?
    I never heard about 32 bits PORTS on a single pin , ... to the day ...

    I think you should learn some bits about Pics and PBP basics before trying to realize such " high level " projects ... that, friendly told.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: CCP1 CCP2 Accuracy?

    Hi Alain!
    Thank you and again in many ways you are very correct. Researching the HPWM10.PBP, I have found that even senior programmers such as BrianT have had difficulties with HWPM10 macro. When you compile your program and you have the: include "HPWM10.PBP" and then the statement: hpwm10 1, 50, 32768 the complier gives the message: Error: Macro DIV32?WW and Macro DIV32?CC not found in macro file. The statement: @ hpwm10 1, 50, 32768 does exactly the same! The DIV32 part of the error message caused me to think that a "long" was necessary. Please believe me I avoid anything that is 32 bit for as you so accurately wrote " Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ..." Yes, I can call Daniel on Monday and I was hoping that there would be an answer somewhere here for me as well as others. Best, Ed

  6. #6
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: CCP1 CCP2 Accuracy?

    Hi Alain!
    Please read this as being in the kindest most friendly manner possible. Okay so I was able to resolve the issues. It turns out that HPWM10.pbp is the wrong program to use. What should be used is HPWM10L.pbp. The downside of this "include" is that debug is disabled so you have to manually re-enable it in your code if you wish your ICD to run. Now about references and spec sheets. The MS5541C spec sheet states that an accurate frequency of 32678 with a 40-60% duty cycle is required. WRONG! This duty cycle does not work! A duty cycle of 12% is about maximum. There are people such as yourself and Brian and many others who have fought and resolved these inconsistancies and errors. This is what makes this forum and people such as yourself great. We all share what we have learned the hard way! Especiall me! Lol Best wishes, Ed

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: CCP1 CCP2 Accuracy?

    Ed,

    You're so polite!
    Even when others aren't.

    I like that about you.
    DT

  8. #8
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: CCP1 CCP2 Accuracy?

    Thanks Darrel!
    I have found that everyone I interact with has a very kind heart and generous soul. Even my ex-wives! Lol

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