Config problem PIC16F886


Closed Thread
Results 1 to 40 of 56

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    35


    Did you find this post helpful? Yes | No

    Smile

    Hi Skimask,

    Thank you !

    Now it starts working, have changed the config in the 16F886.INC file and moved the configuration over to the real program. But still have the warning from PicKit2.

    Have to work on and make some small changes and see if the warnings will go away.

    I'm not proffessional, but have learned very much from this forum and are very greatful for all your help.

    Thank you ALL

    Bosse

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bosse View Post
    Now it starts working, have changed the config in the 16F886.INC file and moved the configuration over to the real program. But still have the warning from PicKit2.
    Probably means that you typed something in wrong, missing a space here or there, have an extra ' character, maybe a " character in there somewhere that shouldn't be...

    Post the real CONFIG part that you're using. We can guess at your problem all day. Could be that the tire pressure is low...we'll never know...

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Probably means that you typed something in wrong, missing a space here or there, have an extra ' character, maybe a " character in there somewhere that shouldn't be...
    Just got back from dinner . . . That is why I asked him to post the .inc file and first 8 lines or so, to see if he introduced an extra character . . .
    Post the real CONFIG part that you're using. We can guess at your problem all day. Could be that the tire pressure is low...we'll never know...
    we can hope . . .
    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
    Sep 2006
    Posts
    35


    Did you find this post helpful? Yes | No

    Default

    Hi skimask, Joe and Darrel

    Can not find out how to find out about the CONFIG word. Have comment out the CONFIG word in the program. using MPASM assembler. Now I'm really confused. Have been lucky with my other programs for other Controllers, that I can see now.
    Really wants to find out how to configure CONFIG word for 16F886.

    ;************************************************* ***************
    ;* 16F886.INC *
    ;* *
    ;* By : Leonard Zerman, Jeff Schmoyer *
    ;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. *
    ;* All Rights Reserved *
    ;* Date : 05/26/06 *
    ;* Version : 2.47 *
    ;* Notes : *
    ;************************************************* ***************
    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F88x.INC' ; PM header
    device pic16F886, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F886, r = dec, w = -302
    INCLUDE "P16F886.INC" ; MPASM Header
    __config _CONFIG1, _INTOSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    NOLIST
    endif
    LIST

    I wants to have 8 MHz Internal Oscillator, my PCB have 4k7 resistor to MCLR pin so think MCLR have to be ON?
    Also want ALL I/O to be DIGITAL.

    Have printed out the INC file from the MPASM directory and the PDF file for 16F886 from MicroChip. Have much to read, but if I understand all???

    What can I do to get it work?

    Include a short version of the program.

    All the Best

    Bosse
    Attached Files Attached Files

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bosse View Post
    Can not find out how to find out about the CONFIG word.
    The config fuses are explained in the 16F886 datasheet in the 'Special Features of the CPU' section.

    Have comment out the CONFIG word in the program. using MPASM assembler.
    If you comment them out in the 16F886.INC file in the PBP folder, you need to put them in your main program.
    If you don't put them in your main program, you can temporarily/permanently set them in the 16F886.INC file in the PBP folder.

    Really wants to find out how to configure CONFIG word for 16F886.
    And again...if you read, and re-read, and re-read, and heed, this thread:
    http://www.picbasic.co.uk/forum/show...ght=presetting
    You will understand what needs to go where...
    Get the list of available/recognized config fuses settings from the 16F886.INC file in the MPASM folder...just like the thread says to do...

    ;************************************************* ***************
    ;* 16F886.INC *
    ;* *
    ;* By : Leonard Zerman, Jeff Schmoyer *
    ;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. *
    ;* All Rights Reserved *
    ;* Date : 05/26/06 *
    ;* Version : 2.47 *
    ;* Notes : *
    ;************************************************* ***************
    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F88x.INC' ; PM header
    device pic16F886, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F886, r = dec, w = -302
    INCLUDE "P16F886.INC" ; MPASM Header
    __config _CONFIG1, _INTOSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    If you're going to put the config fuses in your program, comment out the above line
    If you're going to make the config fuses temporarily/permanent, change the above line to what you need using the available settings in the 16F886.INC in the MPASM folder
    NOLIST
    endif
    LIST

  6. #6
    Join Date
    Sep 2006
    Posts
    35


    Did you find this post helpful? Yes | No

    Smile

    Hi skimask,

    Thank you very much for all your help, now I will change the config in the INC file.

    Wish you all the best

    Bosse

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bosse View Post
    Hi skimask,

    Thank you very much for all your help, now I will change the config in the INC file.

    Wish you all the best

    Bosse
    Ya Know, I would only add an <b><font color=red> ; </b></font color> there. What I would do is save the configs you want saved as a file, call it 16F886 Setup and open it for each new project, then when you get ready to compile just save it as your new project's name: MyNewProject.BAS
    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.

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


    Did you find this post helpful? Yes | No

    Default

    HI BOSSE,
    Time to ask, what is / is not working? Your file compiles nicely here, only changes I see are as follows: add, OSCTUNE = %00000000 ' SET OSC TO CALIBRATED VALUE
    VRCON = 0 and change to OSCCON = %01110101 , these may in fact do nothing differently, but I would try them. Does your circuit come alive and do anything ? Have you tried adding a heartbeat code just so you can see if life exists? Simple LED works wonders.
    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.

  9. #9
    Join Date
    Sep 2006
    Posts
    35


    Did you find this post helpful? Yes | No

    Default

    Hi skimask,

    Have changed to INTOSCIO in 16F886.INC and have the following config in program

    OSCCON = %01110001 '; Internal 8 mhz Osc
    'OSCCON = %01100000
    ANSEL = 0 '; All Digital
    ANSELH = 0
    CM1CON0 = 0
    CM2CON0 = 0
    ADCON1 = $0F
    ADCON0 = 0

    TRISA = %00000010
    TRISB = %00001111
    TRISC = %11100100

    The program will not work perfect yet ???

    Bosse

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    That's the register setup, not the CONFIG fuse setup

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bosse View Post
    Hi Joe,

    Forget to tell you the Warning from PicKit2.

    Warning: Some configuration words not in hex file.
    Ensure default values above right are acceptable.

    Configuration 2FF9 0700

    Bosse
    According to that CONFIG word, and according to the PIC16F886 datasheet, this is your configuration:

    DEBUG mode is OFF
    RB3 is I/O
    Fail Safe Clock is ON
    Int/Ext Clock Switching is ON
    BOR is ON
    CPD is OFF
    CP is OFF
    RE3/MCLR is MCLR
    PWRT is OFF
    WDT is ON
    Oscillator mode is INTRC, ClkOut on OSC2, R/C input on OSC1
    All Write Protects are Off

    What's not right?
    I'd be betting it's your spelling of INTRC. Check the 16F886 INC file in the MPASM directory to figure out how to spell it so the assembler is happy.

  12. #12
    Join Date
    Sep 2006
    Posts
    35


    Did you find this post helpful? Yes | No

    Default

    Hi again skimask,

    Have also changed to MPASM assembler and it works better now

    Bosse

Similar Threads

  1. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 01:48
  2. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  3. Error 0X0000008E when connecting a 18F2550 USB HID
    By FranciscoMartin in forum USB
    Replies: 8
    Last Post: - 16th October 2008, 17:20
  4. PortE problems (PIC18F4455)
    By RubenR in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th July 2006, 15:26
  5. Installation sequence
    By Demon in forum General
    Replies: 23
    Last Post: - 11th July 2006, 03:56

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