Configuration fuses in source file for 18f252


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Location
    Austin, TX
    Posts
    68

    Default Configuration fuses in source file for 18f252

    I have been struggling for a while now trying to set the config fuses I need in the source code of an 18f252 project.

    What I need is:

    HS Osc
    mclr disabled
    wdt disabled

    I am using mpasmwin, but I just don't seem to get the includes and syntax right.

    An example would be great.

    Thanks,

    Mike

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


    Did you find this post helpful? Yes | No

    Default

    This thread is a good read
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    For an example the best place to look will be in the file the above thread speaks about. The inc file for the chip you are using in the PBP directory.

    To find all of the options for the chip go to - program files - micro chip - mpasm suite and find the inc file there for your chip. Do not change anything in this one. Look near the end of the file for all of the config options.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Mar 2010
    Location
    Austin, TX
    Posts
    68


    Did you find this post helpful? Yes | No

    Default must be dense

    I believe I have already done all of that. I found out about needing mpasm. I found the include file for the 18f252 and I copied the config statement near the bottom into the source file. It gives me a syntax error every time.

    Do I need to copy the .inc file into the project?

    I really need to see a sample code section to see exactly how it is supposed to look inside the PBP .bas file.

    Thanks,

    Mike

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


    Did you find this post helpful? Yes | No

    Default

    Can we see your code?

    You do not copy the whole file, just the config lines.
    Might be better at this point to not set the fuses in code. Just modify the PBP inc file.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Mar 2010
    Location
    Austin, TX
    Posts
    68


    Did you find this post helpful? Yes | No

    Default



    ' using 20 MHz Resonator Pause 1 = 200 usec, 10 = 2 msec

    __CONFIG _CONFIG1H, _HS_OSC_1H

    symbol LED = 0 'Rename pin 0 of portb (PIC 16F84 pin 6) to LED

    trisb = %00000001 'Setup port b as RB7-RB1 inputs, RB0 as output

    main: 'Label for beginning of main loop
    High LED 'Set pin 0 of portb high (5 volts) which turns the LED on
    pause 10 'Pause 2 milliseconds with LED on
    Low LED 'Set pin 0 of portb low (0 volts) which turns the LED off
    pause 90 'Pause for 18 milliseconds with LED off
    goto main 'Jump to the main label and do it all again and again

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


    Did you find this post helpful? Yes | No

    Default

    @ __CONFIG _CONFIG1H, _HS_OSC_1H

    try that
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 2

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