hpwm error


Closed Thread
Results 1 to 10 of 10

Thread: hpwm error

  1. #1
    Join Date
    Apr 2008
    Posts
    43

    Default hpwm error

    Can somebody help me find why the hpwm command doesn't compile in this code. I'm using MCS compiler with PBP 2.47
    Attached Files Attached Files

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cphillips82 View Post
    Can somebody help me find why the hpwm command doesn't compile in this code. I'm using MCS compiler with PBP 2.47
    No idea which PIC this is for...or even if said PIC has a PWM module in it...
    And these lines:
    Code:
    define ccp1_reg = portb
    define ccp1_bit = 0
    Put them in CAPs, like the book says, and you'll discover a brand new error, also explained in the HPWM section of the book...
    And which PIC, exactly, has a PWM module assigned to PortB.0?

  3. #3
    Join Date
    Apr 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    A 16f88, Putting In Caps Made No Difference?

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


    Did you find this post helpful? Yes | No

    Default

    DEFINE's don't use = signs.

    Code:
    define ccp1_reg = portb
    define ccp1_bit = 0
    DT

  5. #5
    Join Date
    May 2008
    Location
    Florida
    Posts
    64


    Did you find this post helpful? Yes | No

    Question

    If you have the datasheet did you notice the note?

    Note 1: The CCP1 pin is determined by CCPMX in
    Configuration Word 1 register. You have a choice of 1 of 2 pins.

    Note: The TRISB bit (0 or 3) is dependant upon
    the setting of configuration bit 12 (CCPMX).

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by manwolf View Post
    If you have the datasheet did you notice the note?

    Note 1: The CCP1 pin is determined by CCPMX in
    Configuration Word 1 register. You have a choice of 1 of 2 pins.

    Note: The TRISB bit (0 or 3) is dependant upon
    the setting of configuration bit 12 (CCPMX).
    And looking further in the datasheet, the default values of CONFIG1 are all 1's, which for the CCPMX bit means CCP1 is on PORTB.0.

    I'd bet a LARGE sum of money that it's the equal sign.
    <br>
    DT

  7. #7
    Join Date
    May 2008
    Location
    Florida
    Posts
    64


    Did you find this post helpful? Yes | No

    Default

    Darrel

    I was not trying to override your suggestion, just asking cpillips82 if he noticed the note. It caught me by surprise is all.

    I always bow to your experience. I am lucky if I don't get smoke when I plug something in.

    I read every post and see if I can follow through on everything. Turns out I searched the datasheet for the wrong thing. Looked for CCPMX not CONFIG1.

    PS NO BET, I be flat broke I play with PICs because they be cheaper than cars!

    But if you every get down my way I'm always good for at least one beer.

    Sorry to butt in cphillips82, I will crawl back into my hole now.
    Last edited by manwolf; - 26th July 2008 at 06:43.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    DEFINE's don't use = signs.

    Code:
    define ccp1_reg = portb
    define ccp1_bit = 0
    That was the brand new error I was talking about...
    But now I realize that if a DEFINE isn't recognized and/or used by anything, it won't necessarily flag any sort of error. Just ignored...
    Which is why I referred back to the HPWM section of the book...

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by manwolf View Post
    Darrel

    I was not trying to override your suggestion
    ...
    I read every post and see if I can follow through on everything.
    Exactly what you should do. On both accounts.

    Beat me up, prove me wrong, show a better way.
    And so will I, in reverse.

    I will crawl back into my hole now.
    Don't even.
    DT

  10. #10
    Join Date
    Apr 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    it was the = sign, thankyou very much.

Similar Threads

  1. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  2. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 04:58
  3. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  4. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  5. 16F88 Compile error
    By Toley00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 2nd November 2005, 00:22

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