How to resolve assembler error 306?


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: How to resolve assembler error 306?

    Since version 1.00 of DT_INTS-14, it is best if you DO NOT comment or un-comment lines in the include file.
    Changing the include file can affect compiling with other chips that have different BANK configurations.

    Instead, copy the wsave variables block from the file into your source code, and un-comment the lines that the compiler refers to in the errors.
    Code:
    ;-- Place a copy of these variables in your Main program -------------------
    ;--   The compiler will tell you which lines to un-comment                --
    ;--   Do Not un-comment these lines                                       --
    ;---------------------------------------------------------------------------
    ;wsave   VAR BYTE    $20     SYSTEM      ' location for W if in bank0
    ;wsave   VAR BYTE    $70     SYSTEM      ' alternate save location for W 
                                             ' if using $70, comment wsave1-3
    ' --- IF any of these three lines cause an error ?? ------------------------
    '       Comment them out to fix the problem ----
    ' -- Which variables are needed, depends on the Chip you are using -- 
    ;wsave1  VAR BYTE    $A0     SYSTEM      ' location for W if in bank1
    ;wsave2  VAR BYTE    $120    SYSTEM      ' location for W if in bank2
    ;wsave3  VAR BYTE    $1A0    SYSTEM      ' location for W if in bank3
    ' --------------------------------------------------------------------------
    The errors you posted indicated to ADD wsave, wsave1, wsave2 and wsave3.
    It also indicated "OR" change to wsave VAR BYTE $70. If you add that line, you don't need the other wsaves.

    So a simple ...
    Code:
    wsave   VAR BYTE    $70     SYSTEM
    in your code will suffice.

    Also, the 16F886 doesn't have a Low Voltage Detect circuit (LVD). So LVD_INT cannot be used.
    DT

  2. #2
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: How to resolve assembler error 306?

    Thanks, Darrel. That solved the problem.
    However, I might suggest that you flag this info on the DT_INTS-14 web site for others that may be having this problem. I checked there first to see if I could find anything related to these errors.
    John Ellis

  3. #3
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: How to resolve assembler error 306?

    Quote Originally Posted by Darrel Taylor View Post
    Also, the 16F886 doesn't have a Low Voltage Detect circuit (LVD). So LVD_INT cannot be used.
    Thanks for pointing that out, Darrel. I see now that I have to find another way to detect low battery voltage. In that regard, I am wondering if their is some way to hook the battery output on my PCB to one of the comparator inputs and comparing it somehow to an internally generated reference voltage. I tried to study the Comparator section of the 16F886 data sheet to see if this was possible, but I got lost in the complexity of the comparator circuits and how to generate a CVref into it from internal circuitry.
    Can you point me to any posts or tutorial that might explain how to do this?

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Not sure, but maybe this thread will help.
    It might look familiar.

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

  5. #5
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: How to resolve assembler error 306?

    Thanks, Darrel. I am embarassed to say I had forgotten all about this thread

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