Beginer Help!


Closed Thread
Results 1 to 15 of 15

Thread: Beginer Help!

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Find the 16F628.inc file in your PBP directory. The comment out the fuse lines with a ';'
    Code:
         NOLIST
        ifdef PM_USED
            LIST
            include 'M16F62x.INC'   ; PM header
        ;    device  pic16F628, xt_osc, wdt_on, pwrt_on, mclr_on, lvp_off, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 16F628, r = dec, w = -302
            INCLUDE "P16F628.INC"   ; MPASM  Header
        ;    __config _XT_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
            NOLIST
        endif
            LIST
    Then use the config statements from Melanie.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Read post #1 and #5.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    thanks for your attention.

    I did check in the .inc of the 16F628, all defined terms are there.
    should i have a little bit of time to understand and figure out

    thanks again

    Minh Le

  3. #3
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Smile

    hi MACKRACKIT

    it works now.

    as you suggested: i change IN THE .INC FILE


    IFDEF PM_USED
    ......

    DEVICE PIC16F628 INTRC_OSC_NOCLKOUT, MCLR_OFF, ....

    XALL

    ....

    MY QUESTION IS I KEEP THE ORIGINAL INC. FILE , IN THE PROGRAM I ADD AS MELANIE SUGGESTED

    @DEVICE PIC16F628 INTRC_OSC_NOCLKOUT
    ......

    IN THIS CASE THE INC. FILE OF 16F628 SHOULD BE CALLED AND EXECUTE THE INCLUDED FUNCTION OF INTRC_OSC_NOCLKOUT AND MCLR_OFF.

    BUT NOTHING HAPPENED!!!

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Not sure I understand the question now.

    Keep the *.inc files as Pic Basic will look for it even if it is not being used.

    Most of the time I set the *.inc file the way I want the configuration to be. Others like to do it in their code.

    If you set the config in code the lines in the *.inc need to be commented (rem) out, if not you will get errors.

    If I understand when you were using the*.inc file nothing happened. There may be another setting in that file that was causing the problem. ??? How is MCLR set in the *.inc?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    hi,

    sure I have to return the orignal config. but first of all i should see how it looks like.

    the MCLR was set to off (MCLR_OFF), I try another way to test the circuit in oder to bring back to the original setting.

    thanks for your attention

    Minh LE

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MINHLE View Post
    hi,

    sure I have to return the orignal config. but first of all i should see how it looks like.

    the MCLR was set to off (MCLR_OFF), I try another way to test the circuit in oder to bring back to the original setting.

    thanks for your attention

    Minh LE
    Hi Minh LE,
    Actually you do not have to return it to the default settings. The Default settings are there, mostly to help beginning programmers get started, as they likely do not know how to set them in code. You have 3 choices, return them to default settings, comment them out and always set them in your main code, or set them to the setting you use most often and do not include them in your code.
    JS
    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.

  7. #7
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    Hi, Mackrakit,

    I did a mistake:

    when add the @device pic16f628 intrc_osc_noclkout
    and @device 16f628 mclr_off

    in the conf. window should be :

    1- oscillator: intrc clockout
    2- Mclr input pin

    -------------------------------------------------
    for several ouput pins @ port B, the story is different. I am trying to read in the data sheet of the 16f628.

    regards,
    Minh le

Similar Threads

  1. Beginer problems
    By luxornet in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th February 2010, 04:55

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