External osc defines


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Cool Hex file

    Thanks Bruce,

    will test that in the evening. Its now 3 pm. will take another 4 hrs til Iīm home.

    Does That mean MPASM doesnīt handle extern osc settings ?

    Or does it mean the PicKit2 sets its own default osc settings?


    very strange.

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


    Did you find this post helpful? Yes | No

    Default

    MPASM works just fine with any config directives the PIC has, but they are different than config directives the PM assembler expects. See the thread I linked to above for the details on config use. Melanie does a nice job explaining this.

    I don't have a PicKit2, so I can't really say how it works, but I would assume it can read & use config options embedded in the .HEX file, or give you an over-ride option.

    Maybe someone else here familiar with the PicKit2 can comment on this one?

    Look in the 16F628a.inc file in your PBP directory. If you use PM, it uses the top config defaults. If you use MPASM, then the 2nd default config options are used.

    When you insert a bogus config directive in your code, it isn't used, and of course it has no bearing on what config options will be embedded in the .HEX file.

    Read the thread by Melanie I linked to earlier. It is well worth the time.
    Regards,

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

  3. #3
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Wink The hex file works

    Thanks Bruce,

    your file is ok and now 20Mhz could find their way via RA7!

    I will try to grasp the "Define-thingy" by reading and trying.

    Ha!

  4. #4
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Question Impossible to compile

    Hi Bruce,

    as I told you your hex code of my small program really works.
    But if I take your previously shown config fuses I get only a compilation error

    '************************************************* *******************************************
    ' 16F628A 20Mhz extern canned Oscillator
    ' damn program should blink an LED
    ' Igot that compilation error
    '************************************************* *****************************************


    @ __config _EXTCLK_OSC & _WDT_OFF & _MCLRE_OFF & _LVP_OFF & _CP_OFF



    LED VAR PORTB.7
    CMCON = 7 ' RA0-RA3 are digital I/O

    TRISB = %01111111 ' RB7 is output, rest are inputs.

    main:
    led = 1
    pause 500
    led = 0
    pause 500
    goto main

    END ' End of program

    Error[118] c:\pic\16f628a\blinkb~2.asm : Overwriting previous address contents (2007)

    when I use only this config:
    @ __config _EXTCLK_OSC

    I get no comp. error but the thing dosnīt work either.

    is an external Osc. with 20 Mhz a no go for PBP ?

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


    Did you find this post helpful? Yes | No

    Default

    If you would just please take the time to read this thread http://www.picbasic.co.uk/forum/showthread.php?t=543 you should get what's happening. If not then let me know.
    Regards,

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

  6. #6
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Talking Took time to read

    Hi Bruce,

    yeeeees I understood and read the whole thread and you were right: there it all stood.

    The most "difficult" part of it was to find out in WHICH of those .INC files the config fuses had to be changed.
    there were at least three of them and 2 were in the PBPDEMO folder and those were the ones but I dunno which of those two. commented the configs in both.

    After that my BLINKBILLIG20MHz blinked way too fast and the "DEFINE osc 20" programming and compiling worked not for the first 4 times although I erased the PIC complete before programming.

    Now it does. And reacts on changing the osc frequency.

    thanks a bundle.

    I guess your nerves get friggled up with guys like me asking the "obvious" for the 20th time, huh?

    next try will be 3 pics with one canned 20Mhz oscillator.....

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


    Did you find this post helpful? Yes | No

    Default

    I guess your nerves get friggled up with guys like me asking the "obvious" for the 20th time, huh?
    Not at all. I enjoy answering questions here because I will almost always learn something in the process, and I enjoy learning. A nice by-product of this is that I get to help someone else in the process of learning new things myself.

    I just see no point in re-typing an answer to a question that has already been thoroughly covered in another thread.

    If someone has taken the time to read information in a thread I linked to, the data sheet, manual, etc, and they still have a question about some part of it they aren't 100% clear on, then I'm more than happy to attempt to elaborate.
    Regards,

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

Similar Threads

  1. Internal vs. external osc for comms
    By mtripoli in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th January 2010, 14:58
  2. Replies: 1
    Last Post: - 28th January 2010, 22:15
  3. 18F1320 with external osc
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th February 2008, 22:32
  4. How to use an external oscillator
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th February 2008, 14:19
  5. External clock
    By Firegod in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th March 2007, 00:53

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