PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24

    Default PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    PIC16F1828 has register for assigning the Timer2's to CCP modules named: CCPTMRS0 (that's a zero at the end).
    I'm trying to set it using:
    CCPTMRS0 = %00000110

    But this line is throwing these errors in compilation:
    Error[113] c:\pbp\pbppi14e.lib 583: Symbol not previously defined (CCPTMRS0)
    Error[113] c:\pbp\pbppi14e.lib 918: Symbol not previously defined (CCPTMRS0)

    Does this have to do with which bank to find CCPTMRS0?

    PIC16F1828 datasheet shows CCPTMRS0 in bank5.

    I'm using PicBasicPro2.6c

    Thanks in advance!
    -ray
    "Imagination is more important than knowledge", Albert.E.

  2. #2
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    The 16F1828.bas file contains only this:

    BANK0 $0020, $007F
    BANK1 $00A0, $00EF
    BANK2 $0120, $016F
    EEPROM $F000, $F0FF
    LIBRARY "PBPPI14E"
    DEFINE CODE_SIZE 4

    include "PI14EEXT.BAS"

    PORTL VAR PORTA
    PORTH VAR PORTC
    TRISL VAR TRISA
    TRISH VAR TRISC

    include "PBPPI14E.RAM"
    -ray
    "Imagination is more important than knowledge", Albert.E.

  3. #3
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    CCPTMRS = %00000110 doesn't throw a compiler error; and this register does not exist on the PIC16F1828 data sheet nor in the Errata.
    (maybe it's a mistake where CCPTMRS0 should be CCPTMRS in the data sheet) ?

    ..trial and error...
    -ray
    "Imagination is more important than knowledge", Albert.E.

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


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    This error was fixed in PBP 3.0.0.0 (Aug 2011)
    There is no patch for 2.60, but you can set the CCP registers directly instead of using HPWM.
    Last edited by Darrel Taylor; - 20th December 2013 at 15:40.
    DT

  5. #5
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    I am not using the PBP HPWM call, I am setting up the CCPs in PWM mode manually in the order the PIC16F1828 datasheet states,
    I tried this code:

    OSCCON = %11101000 '4Mhz intosc
    Define OSC 4 'software timers indicated for 4mhz operation
    TRISA = %00011011'Tris register 1=input(PORdefault) 0=output
    TRISB = %00110000'No Vref's used on ADC
    TRISC = %10000111
    ANSELA = %00010011'Ansel register 1=analog 0=digital
    ANSELB = %00010000
    ANSELC = %10000111
    CCPTMRS0 = %00000110'Timer2/4/6 assignment to CCP modules(pulsed output pins)
    '
    Start:
    TRISC.3=1 'Disable pin output, set as input
    PR4=200 'Set Period Rate, PRx, in Timer
    CCP2CON=%00001111 'Turn on PWM
    CCP2CON.5=1 'high bit of 2LSBs of Duty
    CCP2CON.4=0 'low bit of 2LSBs of Duty
    CCPR2L=180 '8MSBs of Duty
    PIR3.1=0 'clear Timer interrupt flag
    T4CON.1=1 'high bit of 2bit Timer Prescaler
    T4CON.0=1 'low bit of 2bit Timer Prescaler
    T4CON.2=1 'Timer On
    TRISC.3=0 'Enable pin output

    the compiler throws this error:
    Error[113] c:\pbp\pbppi14e.lib 583: Symbol not previously defined (CCPTMRS0)
    Error[113] c:\pbp\pbppi14e.lib 918: Symbol not previously defined (CCPTMRS0)
    -ray
    "Imagination is more important than knowledge", Albert.E.

  6. #6
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Red face Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    MOVE?CB 006h, CCPTMRS0
    is put into the .asm file eventhough the error is shown in Microcode Studio

    (I don't even know why I'm telling you this, but I figured it may help)
    -ray
    "Imagination is more important than knowledge", Albert.E.

  7. #7
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    Can you please give me some code to use for loading a value into CCPTMRS0 manually on the PIC16F1828.
    The data sheet shows its in memory map location:
    Bank5
    29Eh
    CCPTMRS0

    Thanks in Advance!... And I'm working on purchasing PBP3.0 as well.
    -ray
    "Imagination is more important than knowledge", Albert.E.

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    Hi,
    I'm not sure this is the case but I think it might be an MPASM include file issue.
    It looks like CCPTMRS and CCPTMRS0 registers are one and the same (they are defined that way (at 0x029E) in my version (5.47) of the MPASM .inc file) so it's possible that your version of the .inc file is missing the CCPTMRS0 regsiter definition.

    So, try using CCPTMRS instead of CCPTMRS0 or you can try adding...
    Code:
    ASM
    CCPTMRS0         EQU  H'029E'
    ENDASM
    ...at the very beginning of your code.

    /Henrik.

  9. #9
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    DT is correct, after trying several variants of ASM code that didn't work; I was buying and downloading the PBP3.0.
    The PBP3.0 is nicely packaged! Download the 128Mb flavor with all the new MPASM/Microcode Studio stuff...and you may need to get the latest Beta programmer software for newer PICs.
    The multiple hardware PWMs on the PIC work from the multiple Timer2's now that I used PBP3.0
    $$ well spent, and for a good cause to keep the PB biz going!

    I still have a problem with keeping the hardware PWM going, it stops when I use HSER or ADC on other pins, eventhough the hardware PWM is coming out of a default ccp pin(that is not eusart by default)
    ..I haven't figured it out yet..

    thanks all !!
    -ray
    "Imagination is more important than knowledge", Albert.E.

  10. #10
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    Ok, the hardest problems are the one's when you are the problem yourself.
    I had an error in a supporting device's code, fixed it, and now all works good.
    BUT,
    It would not be possible without using the PBP3.0
    thanks DT !
    -ray
    "Imagination is more important than knowledge", Albert.E.

  11. #11
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: PIC16F1828, "Symbol not previously defined (CCPTMRS0)", need help!

    Thank you Olsson!!, that work-around is on the right track and I tried a few attempts as such, but no success.
    The PBP3.0 works good and worth the $$ IMO.

    all the best!
    -ray
    "Imagination is more important than knowledge", Albert.E.

Similar Threads

  1. Replies: 0
    Last Post: - 14th November 2013, 03:32
  2. Replies: 3
    Last Post: - 15th October 2012, 08:06
  3. "symbol not previously defined" on 16F1933 - fuse issue i think
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd January 2011, 03:24
  4. Symbol not previously defined
    By Archangel in forum Code Examples
    Replies: 2
    Last Post: - 27th December 2008, 09:52
  5. Replies: 1
    Last Post: - 16th February 2005, 20:05

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts