PIC16F628A Will not run at all....


Closed Thread
Results 1 to 14 of 14

Hybrid View

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

  2. #2


    Did you find this post helpful? Yes | No

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

    Sorry. Yes I am using an external on that chip. What I am doing is building a self-acquiring satellite system for data. (HughesNet) It will have a MC in the dish itself where all the "important thinking" will be happening. And then there will be a wireless handheld device connected via HC-05's. This will also allow for a cell phone app to control it via a customized BTserial-type app.

    I just got the handheld to start (sorta) working now (minus the blown LCD I'm now waiting for)
    I got the HC-05's linked

    I just blew the last 688 I had for the embedded half. I switched out to a PICAXE14M2 I had laying around. (BTW this is the chip that got me over to PIC from Arduino) Since I now have a picKIT3, I wiped the bootloader and am using it as a 1825. This board is soldered already, and I used the pins for the CLK for something else. The internal clk would be fine but now a 10000 pause is 80 seconds. I cannot go down past OSC 4, and this is still 8 times to slow. How do I rectify this?



    Is it really hijacking if it was your own thread?? ;-)

  3. #3


    Did you find this post helpful? Yes | No

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

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    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.
    Yes, thank you. I had found this right before reading your post. Honestly, with the three different ways, plus finding C code in searches as well, this makes learning how to do the config extremely frustrating. Every time you think you understand a little part of it, it gets changes on you 2 more times...lol I found the reference to the configs in the device folder in the PBP manual and now FINALLY I understand it. (Sure wish I had known about that low voltage programming before I scrapped out that chip turning off MCLRE!) I haven't checked out the melabs tool yet, maybe I will. So far I am totally unimpressed with MPLAB altogether. I am so sick of retyping my work because they have boycotted the tilde for some reason. Also, pasting ANYTHING with most symbols locks it up tight too. I'm about to try out MC Studio....

  4. #4
    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,
    Yes, I understand it's confusing with the pre PBP3 style CONFIG. It's a lot better with PBP3 than it was before though! However, I've got no sympathy for looking at C code and trying to implement THAT in PBP :-)

    As for MPLAB(X) there is ONE reason (for me that is) to use it with PBP and that's source level debugging, if you don't need that then you don't need MPLAB(X). Personally I've tried to get MBLABX up and running twice and given up both times, feeling very stupid on both occasions.

    /Henrik.

  5. #5


    Did you find this post helpful? Yes | No

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

    I have now been on MC Studio for a couple days, and I have to say it rocks compared to mplabx. It auto-corrects capitalizations, and best of all it doesn't seize like an epileptic in a disco every five minutes...

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