PIC16F628A Will not run at all....


Results 1 to 14 of 14

Threaded View

  1. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: PIC16F628A Will not run at all....

    Hi,
    The problem is that previously there was two different ways of setting the CONFIG bits depending on which assembler you were using. With the introduction of PBP3 both those ways got superseded by a, MUCH better, third way.

    With PBP3, which you must have since you've been using the #CONFIG/#ENDCONFIG directives the easiest way is to look in the DEVICE_REFERENCE folder and open up the .INFO file for your particular device. There you will find two things, A) What PBP is using by default and B) All the options available. Just remember that whenever you put the #CONFIG/#ENDCONFIG in your program ALL of the PBP default settings will be replaced so make sure that you either include a setting for all selections or know what they are by (hardware) default.

    Yet another option is to use the new meCONFIG from meLabs and let it generate the CONFIG code for you.

    The internal oscillator of the 16F628A is 4MHz by default, and there is no oscillator register setting, only a frequency select bit in PCON, so you shouldn't need to do "anything" really - except for selecting it of course. The .INFO file for the 16F628A shows two selections INTRC_OSC_NOCLKOUT and INTOSC_OSC_NOCLKOUT however they both result in the same thing, namely that the two LSB's of the CONFIG word being cleared which matches the datasheet for the INTOSC with I/O on RA6/RA7 selection.

    My pic has a 14 bit config and I want 10000111111000 but I cannot figure out the command to enter it....
    This, however does not look correct if what you want is the internal oscillator. As far as I can see this would select external low power crystal mode - not internal oscillator.

    Then, in your actual code you had
    Code:
     #CONFIG
     __config 10000111100001
     #ENDCONFIG
    Which again doens't look correct, this would select XT-oscillator.

    So, please clarify which mode it is you want. If it's the internal oscillator then the code in the original post looks fine to me. There are no analog functions on PortB.

    Which device programmer are you using? Are you sure that it's actually programming the CONFIG bits into the device?

    /Henrik.

    EDIT: OK, you posted while I was researching and typing.
    Last edited by HenrikOlsson; - 19th May 2014 at 06:42.

Similar Threads

  1. RTC run too fast
    By pedja089 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th December 2012, 19:17
  2. Run-Time Config
    By Darrel Taylor in forum PBP Extensions
    Replies: 1
    Last Post: - 1st February 2012, 16:26
  3. 16F628 does not run. I can't believe this
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd October 2009, 15:41
  4. Intermittent code cannot run
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th November 2008, 02:45
  5. How to run program in parallel?
    By vanxn in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th July 2006, 21:59

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