PIC16 Max Array Size


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2011
    Location
    Michigan, USA
    Posts
    33

    Default PIC16 Max Array Size

    PBP Manual says max word array elements for PIC16 device is 48. I receive "unable to fit variable" compilation error if I try to put more than 40.
    I would like to keep the pin count of device to 14 so thats why I am not going with a PIC18.

    Here is entire program:
    Q1 var word[48]
    Main:
    goto Main
    end

    Is the manual incorrect?

    MPlab v8.83
    PBP v3.0.4
    device PIC16F1825

    b.t.w.
    Just purchased PBP3. So far I like the improvements. Good to know this development tool is moving forward.

    Mike -

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


    Did you find this post helpful? Yes | No

    Default Re: PIC16 Max Array Size

    The manual is right. But, you have to read the fine print

    Under the asterisk, it says that for PIC16 devices, the array must fit in one RAM bank. If you look at the data sheet for the PIC16F1825 it talks about each bank. Although it has 128 bytes in each bank, only 80 of those are for General Purpose RAM. I believe that is why the largest array you can have on this chip, is an array of 40 words.

    3.2 Data Memory Organization
    The data memory is partitioned in 32 memory banks
    with 128 bytes in a bank. Each bank consists of
    (Figure 3-2):
    • 12 core registers
    • 20 Special Function Registers (SFR)
    • Up to 80 bytes of General Purpose RAM (GPR)
    • 16 bytes of common RAM
    http://www.scalerobotics.com

  3. #3
    Join Date
    Feb 2011
    Location
    Michigan, USA
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: PIC16 Max Array Size

    Ahh I see your right. My mistake. I should have not assumed 128 bytes. Sorry about that.
    Thanks ScaleRobotics.

Members who have read this thread : 1

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