PIC18F8527 Array Limit


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    upgraded to MPASM 5.39, no change.

    I'll try reloading all the software when I get a chance.

  2. #2
    Join Date
    Jul 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    I found the problem.

    I am using assembly interrupts that reserve a location in each bank for the wsave register. This effectively limits an array size to 255 bytes since the array can't cross this reserved register.

    Luckily this processor has a special stack that will store the W, STATUS, and BSR registers automatically and then automatically restore them if a "fast" retfie command is used. This removes the requirement to reserve a memory location in each bank for the wsave register. Using this method works as advertised. This will only work if high priority interrupts are not used, which was the case in my code.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    On 18F types you can force your context saving vars to be placed in access ram so there's no need to put them in more than 1 place.

    wsave var byte BANKA SYSTEM ' location for WREG
    ssave var byte BANKA SYSTEM ' location for STATUS register
    bsave var byte BANKA SYSTEM ' location for BSR register
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jtowich View Post
    I found the problem.

    I am using assembly interrupts that reserve a location in each bank for the wsave register. This effectively limits an array size to 255 bytes since the array can't cross this reserved register.
    You might want to use DT_INTS, it makes it pretty easy to use interrupts, and doesn't cause the problems you are seeing, whether using asm or pbp type interrupts.

    http://darreltaylor.com/DT_INTS-18/home.html
    http://www.scalerobotics.com

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