Pic12f615 Hpwm???


Closed Thread
Results 1 to 12 of 12
  1. #1
    Join Date
    Apr 2007
    Location
    Everett, Washington, USA
    Posts
    7

    Default Pic12f615 Hpwm???

    I'm new at this and I'm totally confused.
    I have PBP 2.5 and Microcode Studio Plus. All I want to do for now is get an LED to fade on and then off again using the HPWM. I have looked at examples on the forum and tried everything I can think of with the different registers and all I'm getting when I compile is a long list of errors saying "Symbol not previously defined(register name)".

    The manual is no help and the datasheet doesn't do much better

    Can someone explain this so it makes sense???

    Thanks

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Probably because this pic don't have any built-in/Hardware PWM module (CCP)... to use HPWM you will need to switch to a 12F683, or use PWM, or create a timer interrupt.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Apr 2007
    Location
    Everett, Washington, USA
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    According to the datasheet it's on GPIO.2

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


    Did you find this post helpful? Yes | No

    Default

    Place these defines in the top section of your code;

    DEFINE CCP1_REG GPIO
    DEFINE CCP1_BIT 2

    Should compile & work fine now.
    Regards,

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

  5. #5
    Join Date
    Apr 2007
    Location
    Everett, Washington, USA
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    It's still giving me a series of the same errors... I'm so confused!

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    oups, i think i didn't check the right datasheet...

    something is weird in the CCP1_REG and in CCP1_BIT declaration... So try to add the following defines

    Code:
    DEFINE CCP1_REG GPIO 'Hpwm 1 pin port
    DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
    EDIT: OUPS again... Bruce beat me. So now, what are those errors ??? Which version are you using?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    If you're using MPASMWIN as the assembler, make sure you have the latest version of
    MPLAB installed with the P12F615.INC header file.

    You could also try switching to PM as the assembler for a quick check.

    If you upgraded from an older version of PBP that may be a problem too if MCS is still using
    the old version at compile time. Support for the 12F615 was added in version 2.50.
    Regards,

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

  8. #8
    Join Date
    Apr 2007
    Location
    Everett, Washington, USA
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    I have v. 2.5

    I must be missing something... Those defines look the same as the ones above????

    Error[113]c:\pbp\pbppic14.lib 1972 : Symbol not previously defined(registername)

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, how about your code? so we can check it here as well.

    <hr>

    For the other members, you can fix this little problem and modify the 12F615.BAS file located in your PBP folder. Just open it and add the line in RED

    Code:
    BANK0   $0040, $007F
    LIBRARY "PBPPIC14"
    DEFINE	CCP1_REG GPIO
    DEFINE	CCP1_BIT 2
    
            include "PIC14EXT.BAS"
    
    PORTL   VAR     GPIO
    PORTH   VAR     GPIO
    TRISL   VAR     TRISIO
    TRISH   VAR     TRISIO
    
            include "PBPPIC14.RAM"
    
    '*-----------------------* EOF 12F615.BAS *---------------------*
    This will set the Default settings, and avoid to see that Warning [219] message again.

    Thanks Charles from Melabs!

    It doesn't explain error [113] of WireMan in the previous post... let's see it's code first
    Last edited by mister_e; - 9th November 2007 at 23:47.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10
    Join Date
    Apr 2007
    Location
    Everett, Washington, USA
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Here is what I have.....

    Duty var Word
    DEFINE CCP1_REG GPIO
    DEFINE CCP1_BIT 2

    TRISIO = %00000000
    T2CON = %00010101
    PR2 = 249
    Duty = 200

    HPWM 1,duty,1000

    End


    On the [113] ERROR it references the following registers...
    T2CON, PR2, CCPR1L, CCP1CON

    Then there are two registers I don't see in the data sheet...
    T2CKPS0 and T2CKPS1

    I feel like I'm shooting in the dark here...

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


    Did you find this post helpful? Yes | No

    Default

    Error 113 is an MPASM assembler error for Symbol not previously defined

    This means you either don't have an updated version of MPLAB with the P12F615.INC, it's
    bad, it's not being found because your path is not setup right, etc, etc,,.

    Set PM as the assembler in MicroCode Studio. If it compiles OK, then you know what the
    problem is, and can fix it.
    Regards,

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

  12. #12
    Join Date
    Apr 2007
    Location
    Everett, Washington, USA
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Bruce,

    Thanks!!! For some reason the program got confused as to the path for the assembler. I directed it manually and it is working fine... compiled the first time with no errors!

    Thank you to everyone who tried to help with this!!!

    Pat

Similar Threads

  1. need help on hpwm
    By helmut in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th August 2007, 15:49
  2. HPWM of the port of two HPWM
    By ja2rqk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 15:05
  3. HPWM down
    By lerameur in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th January 2007, 00:06
  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 : 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