Problem DEFINE OSCCAL and PBP 2.46


Closed Thread
Results 1 to 6 of 6
  1. #1
    David's Avatar
    David Guest

    Default Problem DEFINE OSCCAL and PBP 2.46

    Hi,

    Initially, sorry for my poor English, I am French and I do not practise.

    I have a problem which is as follows.

    I use PBP 2.46 with Microcode studio. (with and without, i have the same problem)

    when I wants to define the OSCCAL with DEFINE OSCCAL_1K 1, the compiler does not add the good ASM code in the source.
    So, my pic12f675 does not turn has a correct frequency and i have problem for my program with serout2.

    Is what somebody has an idea?

    P.S: my program is:

    DEFINE OSCCAL_1K 1 'just for test

    and in the ASM code i found this

    #define OSCCAL_1K 1

    and not

    CALL 03ffh
    MOVE?AB OSCCAL

    When i add this in my basic source, The compiler says to me that it did not know OSCCAL and 03ffh. I have also reinstall the software, but ihave the same trouble.

    Help me please...

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


    Did you find this post helpful? Yes | No

    Default

    Assembler defines are always preceeded by the # symbol.

    DEFINE OSCCAL_1K 1 is the BASIC version. PBP will change it to
    #DEFINE OSCCAL_1K 1.

    Create a new file, and compile it with only this;

    @ DEVICE PIC12F675, INTRC_OSC, WDT_OFF, MCLR_OFF
    DEFINE OSCCAL_1K 1 ' Calibrate internal oscillator

    Open the .lst file. You'll see something like this;

    #define OSCCAL_1K

    goto INIT

    INIT
    call 03ffh
    MOVE?AB OSCCAL
    bsf STATUS, RP0
    movwf OSCCAL
    bcf STATUS, RP0

    Which is exactly what it should be.

    As for your timing problems with serout2, you can not rely on the "internal osc" for timing sensitive applications. If you need an accurate clock for serial communications, use an external crystal or resonator.
    Regards,

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

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    hello David,

    The 12F675 is not supported with the SERIN2 command.

    http://www.microengineeringlabs.com/...ces/pbpmanual/

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

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


    Did you find this post helpful? Yes | No

    Default

    Why would you think serin2 or serout2 is not supported on a 14-bit part..?
    Last edited by Bruce; - 22nd April 2005 at 16:12.
    Regards,

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

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Bruce,

    Bruce>>Why would you think serin2 or serout2 is not supported on a 14-bit part..?<<

    Because the manual said it was not supported the 12bit series chips and below. The 675 is a 14 bit machine??? I thought it was a 12 bit....

    All this time I thought it was a 12 bit...
    Dwayne
    Last edited by Dwayne; - 22nd April 2005 at 17:18.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

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


    Did you find this post helpful? Yes | No

    Default

    Yep the 12F675 is a 14-bit core.
    Regards,

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

Similar Threads

  1. 12C671 & Osccal register - I am confused
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th December 2009, 06:03
  2. How to Reset Osccal Value
    By greensasquatch in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 1st September 2008, 03:11
  3. upgrade to PBP 2.46 and using 12F683
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2005, 07:13

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