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

    Default osc setting manually no go

    Hi Joe,

    iīm using the PicKit2 and i didnīt find any osc settings in the programmer window. That was what I tried at first.

    had the Velleman programmer before and this had the possibility to set osc configs. But that one died long ago.....simply didnt work anymore.

    on the other hand: PicKit2 is fast an easy to use and supports everything, even the 16F628A...hahaha

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


    Did you find this post helpful? Yes | No

    Question RA6 works.....RA7 not!

    Hi Bruce,

    I know the datasheet shows RA7 is external clock in..but I dont get it working. When connecting to RA6 it works. should I try a long-time test if the pic gets to hot? maybe a resistor between canned oscillator and PIC?

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Mugelpower,
    Here is what I think, <b>I say think because I do not definately know.</b> Being that your config fuse setting is WRONG, I think your PIC is not properly set up for EXT OSC and that is why it will not accept input on RA7, I THINK it it using the oscillator as a crystal, somehow getting enough signal to work, elsewise it may be defaulting to int osc, who can say? Try sending out some serial data to a serial lcd and see if it scrambles the data, better yet correct your config statement and then try the OSC on it's proper pin. I compiled your code both ways and the hex files have some distinct differences. One more thought, the PIC is probably using the default config statement in the 16F628A.inc file, unless you have commented it out.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    Try the attached .hex file with your oscillator connected to RA7. This is your code compiled
    with EC oscillator settings I posted previously.

    If it doesn't work I would guess you have a bad PIC, oscillator, or both. Or your programmer
    is not using the config options embedded in the .HEX file.

    This @config_EXTCLK_OSC is not valid, so it does nothing to set EC mode. Whatever config
    options you're getting programmed into the PIC are the defaults in 16F628a.inc. Normally osc
    is set to XT in the defaults. In this mode, OSC2 provides the drive for an external crystal circuit
    like the one shown in first diagram on the link you posted.
    Attached Files Attached Files
    Regards,

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

  5. #5
    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.

  6. #6
    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

  7. #7
    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!

Similar Threads

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