Read the newbee threads, 16F877A no go.


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Talking Small wager

    Quote Originally Posted by mister_e
    I can agree. It should be something like illegal crystal speed definition but, once you know the problem source... it will never happen again. Well i guess.
    Hi Steve,

    I'd be willing to make a small wager, perhaps a drink, that if another assembler were selected the same mistake would produce a different error.
    Call me a cynic but I'll go double or nothing that it's equally obsure...

    BR,
    Bobby

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    you know, in ALL programming language, error message are often helpfull but often they wouldn't point you the exact line or part of code where the error is. It's amazing what a missplaced or missing ENDIF, WEND, Variable declaration could do also

    here's a reaally short example
    Code:
    b1 var byte
    
    I2cread PORTB.0,PORTB.1,0,0,[b1]
    try this as is. Without anything else It compile O.K right ???

    Now remove the first line and compile the code and see what's happen

    ERROR Line 3: Expected '['. (a.bas)
    Last edited by mister_e; - 1st August 2005 at 00:38.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BobbyA
    I'd be willing to make a small wager, perhaps a drink, that if another assembler were selected the same mistake would produce a different error.
    For sure, different systems produce different (nonsense) Error Messages.

    The best one I have ever seen was:

    A Nonexistent error has occured in Module xxxxx at Address yyyy

    (Guess what: It was Intel Hardware running a Microsoft OS . . .)
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  4. #4
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Default Favorite errors.

    Hi Ralph, I sit corrected, it does say somewhere the "acceptable clocks speeds are". Although in my defense you didn't find it first time either.

    Steve, My favorite error occurs on a PC running MS too. If you remove the keyboard the error on POST is: Keyboard bad or missing, press F1 to continue.

    By the way adding the other configuration switches to the .inc file didn't resolve the need to press reset to get the program to run. Still learning.

    BR,
    Bobby

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    > For the 16F877A, the datasheet calls out many configuration bit switches that are not addressed in the c:\pbp\16F877A.INC file, when using PM.

    Many? Name just one. Every item in the Configuration Word Address (Datasheet Register 14-1) is replicated in the PICBasic INC file. Try looking in \pbp\inc\M16f87XA.INC.

    If you correctly read the FAQ, I wrote...

    3.a. When using MeLabs default (PM) Assembler

    Open up the PBP directory, and in it you will find an INC subdirectory. Opening that up and you'll see a heap of files. Find the Mxxxx.INC file for the PIC you're interested in... (example M12F675.INC). If you can’t locate your exact PIC, it might be listed under a family of PICs that share the same settings (example chose M16F62X.INC if you need the settings for a 16F628).

  6. #6
    BobbyA's Avatar
    BobbyA Guest


    Did you find this post helpful? Yes | No

    Default Switches

    Hi Melanie,

    As I said I'm a newbee to PBP, and it's still not clear to me the purpose of the c:\PBP\INC\M16F87xA.INC vs. the C:\PBP\16F877A.INC file.

    I do know the suggested fix was to edit the xt_osc to be hs_osc in light of the clock speed used, and to check the Special Features section of the datasheet. While in the PIC datasheet I noticed there were other configuration bit options that didn't have entries in that file.
    So I stand by the statement, "the datasheet calls out many configuration bit switches that are not addressed in the c:\pbp\16F877A.INC file, when using PM."

    Maybe they don't need to be there, I'm not well versed yet on the effect each configuration bit has on PIC performance. I have to assume if they were not included in this file they are not critical for simple functioning, same with an initial set or cleared condition. This may yet lead me to grief.

    BR,
    Bobby

  7. #7
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Going through the forum posts, I encountered the same problem as in Post#21 above.

    Here is the simple code trying to write to DS1307.

    Code:
    Start:
    
    I2CREAD PORTA.3,PORTA.2,$D0,0,[0,0,0,0,0,0,0]
    
    GOTO Start
    
    
    END

    I get;
    ERROR Line 16: Expected '['. (Untitled8.pbp)
    ERROR Line 16: Expected ']'. (Untitled8.pbp)

    No variable or alias; just direct values...

    What is the cause of this issue?
    me?


    Thanks.
    -------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  8. #8
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Aw c'mon Sayzer, that's a no-brainer...

    Too much wine, women and song this festive period...

    You're trying to READ from a device, and then attempting to store that data into a series of CONSTANTS??? Maybe that's where CONSTANTinople comes from...

    I prescribe a large mug of Turkish coffee and a code revision to something like...
    Code:
    	dA var BYTE
    	dB var BYTE
    	dC var BYTE
    	dD var BYTE
    	dE var BYTE
    	dF var BYTE
    	dG var BYTE
    	
    Start:
    
    	I2CREAD PORTA.3,PORTA.2,$D0,0,[dA,dB,dC,dD,dE,dF,dG]
    
    	GOTO Start
    
    	END
    Alternativelty swap IC2READ with I2CWRITE if you are really intending to WRITE.

    Happy Holidays everyone!

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. Q: using MCLR for Input on 12F683
    By picster in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 31st January 2009, 15:25
  5. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34

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