16f883


Closed Thread
Results 1 to 14 of 14

Thread: 16f883

  1. #1
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52

    Default 16f883

    Hi folks,

    I got a bunch of 16f883 chips last week, and am having some ah, issue, with the clock progrmamming in PBPro.
    Using the string:
    'INITIALIZE
    @ DEVICE INTRC_OSC_NOCLKOUT, MCLR_OFF, WDT_OFF, BOD_OFF, PWRT_ON

    I get an illegal operation warning when it compiles. It's complaining about the clock statement. Ok, so continuing blindly along, I set the Oscillator to either INTOSC IO or INTOSC Clockout in the Config window, and press Program, returns an error and a whole bunch of mismatch in the compare. The Config dropdown reverts to XT for the clock and all is not overly happy.
    What the heck.
    I've changed the INTRC to every flavour that I can find in the datasheet and it's simply does not want to go.

    Anybody have any insight?

    Cheers
    Gary

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Gary, I was just reading "THE FUSES SETTING SAGA" few days ago, I think you should read it to have the insight you are searching.

    http://www.picbasic.co.uk/forum/showthread.php?t=543

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Thanks Al,

    Having just read enough of that nonesense to really give me a headache, I'll just go back to using the trusty 12f675 chips. This stuff clearly does not need to be this complicated, with soooooo many niggly differences based on what Microchip was thinking on that particular day. For some of us (me particularly) I have 4 different telephony manufacturers worth of niggly data plugging my cells, and can't rmember 1/2 of that stuff I -need- every day!

    Pics should be fun, not another reason to spend hours digging through freakin datasheets for that one bit of data that puts you back on track, or necessitating reams of posts to get supposedly "simple" stuff working.....

    (Maybe it's time for a holiday)

    Cheers
    Gary

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


    Did you find this post helpful? Yes | No

    Default

    What version of PBP are you using?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Dave,

    PBP 250c
    Microcode Studio 3.0.0.5
    MPASM/MPLAB/win 8.36
    Using the MELabs U2 programmer with MEup46 Firmware.

    The funnny thing is, I've never been able to get the "@ device, blah blah" stings to work, and I've been through almost all the possible iterations every time I try, even cutting and pasting directly from posts, from people who seem to know what they are talking about...... I'm sure that it's some stupid user thing, but eventually something should work.........

    All I want to do is use the 16F833 with the internal oscillator. Can't be that difficult. (My code, however.. heh..heh..)

    Cheers
    Gary

  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 Meriachee View Post
    Dave,

    PBP 250c
    Microcode Studio 3.0.0.5
    MPASM/MPLAB/win 8.36
    Using the MELabs U2 programmer with MEup46 Firmware.

    The funnny thing is, I've never been able to get the "@ device, blah blah" stings to work, and I've been through almost all the possible iterations every time I try, even cutting and pasting directly from posts, from people who seem to know what they are talking about...... I'm sure that it's some stupid user thing, but eventually something should work.........

    All I want to do is use the 16F833 with the internal oscillator. Can't be that difficult. (My code, however.. heh..heh..)

    Cheers
    Gary
    Hi Gary,
    You need to open the 16F833.inc file located in the PBP Root directory and add a semicolon ahead of the default configs. Then the @ DEVICE . . . will work without the error message. There are configs for both PM and MPASM assemblers there. You will have to redo this when you "UPGRADE" PBP to a newer version as the upgrades overwrite those files. You must do this for each part number PIC you are using to use anything other than the default config, or modify the default config to your particular liking.
    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
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I set the Oscillator to either INTOSC IO or INTOSC Clockout in the Config window, and press Program
    Config window???

    I seem to remember others having trouble like this and I think part have the solution was to shut that "window" stuff off. I do not have the programmer you have so...

    You need to (how ever you can)set things up so ALL of the code and configs are in files. Either change the *.inc when needed or comment out the appropriate lines and set the configs in code. Relying on software to set things up in my opinion is just plane stupid. What happens when you go with another programmer that does not have that option?
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    After inserting a ; into the inc file in front of the "offending" lines, I recompiled the code and with only the following line:
    @ DEVICE INTRC_OSC_NOCLOCKOUT
    As the ONLY text, I get the following:
    Warning [207] c:\progrm-blah-blah 54: found label after column1. DEVICE
    Error [122] c:\progrm-blah-blah 54: Illegal opcode (INTRC_OSC_NOCLOCKOUT)

    It almost looks like PBPro doesn't like this oscillator. ?

    The confusion continues.
    Gary

  9. #9


    Did you find this post helpful? Yes | No

    Default

    I am using this line with the 16F883 with no other @ DEFINE lines or anything else, jus the one line.

    Code:
    @ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_ON & _CPD_ON
    and I modified the file C:\PBP\16F883.INC

    Code:
    ;****************************************************************
    ;*  16F883.INC                                                  *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2009 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 07/02/09                                        *
    ;*  Version   : 2.60                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            include 'M16F88x.INC'	; PM header
            device  pic16F883, intrc_osc_noclkout, wdt_on, mclr_on, lvp_off, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 16F883, r = dec, w = -302
            INCLUDE "P16F883.INC"	; MPASM  Header
    ;       __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
            NOLIST
        endif
            LIST
    Comment out the __config line and save the file.
    This works good for me.
    K

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Meriachee View Post
    After inserting a ; into the inc file in front of the "offending" lines, I recompiled the code and with only the following line:
    @ DEVICE INTRC_OSC_NOCLOCKOUT
    As the ONLY text, I get the following:
    Warning [207] c:\progrm-blah-blah 54: found label after column1. DEVICE
    Error [122] c:\progrm-blah-blah 54: Illegal opcode (INTRC_OSC_NOCLOCKOUT)

    It almost looks like PBPro doesn't like this oscillator. ?

    The confusion continues.
    Gary
    If you use the
    @ DEVICE
    method,then you have to compile using PM. You are using MPASM to get the error and warning you have.
    Dave
    Always wear safety glasses while programming.

  11. #11
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Absolutely, almost fabulous.

    Everything works, up to the verify stage of the programmer without so much as a burp, but then:

    Code verify error at 0000
    3FFF should be 2828

    and on and on it goes 3FFF at 0001, 3FFF at 0002 etc etc.
    Erasing the target doesn't clear it.

  12. #12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Meriachee View Post
    Absolutely, almost fabulous.

    Everything works, up to the verify stage of the programmer without so much as a burp, but then:

    Code verify error at 0000
    3FFF should be 2828

    and on and on it goes 3FFF at 0001, 3FFF at 0002 etc etc.
    Erasing the target doesn't clear it.
    I have had the same type of problems with the MElabs U2 programmer. The only way I could fix it was to reload the defaults to the programmer.

    meProg - Options - More Options - Set Options to Default

    I have not had this problem with other chips but the 16F883 seems to do it late and night or early in the morning. I went so far as to think my programmer was either out of date or broken. I purchased a new one with updated code and it did the same thing. Restoring defaults does seem to fix the strange errors with the U2.

    K

  13. #13
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Reset it a couple of times, and same issue. I am going to contact MeLabs over this one....

  14. #14
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Once again Charles comes through. It was the U2 programmer, indirectly. MeLabs updated the programmer code after the 883 chip was released. When the programmer was up-issued to 4.31 from 4.20 it worked exactly as it should. The firmware is current at #56.

    Thanks all for the help!

    Gary

Similar Threads

  1. 16F883 and Problems with HIGH statement
    By aaanekre in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th October 2009, 01:09
  2. 16F883 Code Verify Problem
    By munromh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2009, 11:47
  3. Using weak pull-up
    By Sharky in forum General
    Replies: 6
    Last Post: - 11th September 2007, 06:44

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