Maximum variable array ?


Closed Thread
Results 1 to 11 of 11
  1. #1
    Keith55555's Avatar
    Keith55555 Guest

    Default Maximum variable array ?

    How does one calculate the maximum availabel size, for an array ,with byte size data, on the 12F675?Thanks,Keith

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Maximum variable array ?

    Hi Keith,

    On the PIC16F877 an array can only be 96 bytes.
    I believe that's the amount of RAM in one bank.
    I'm not sure how the memory on the 12F675 is organized.
    If you have more than one bank (I doubt it) you should be able to create one array that holds as many bytes as are available in that bank. The other bank will be used for your program's variables and overhead created by the PBP compiler.
    It's going to be tight to be sure.
    If there is only one bank then you are simply going to have to feel it out for yourself.

    Cheers.
    ---> picnaut

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


    Did you find this post helpful? Yes | No

    Default

    Easily calculated with the aid of PBP itself... write your program, define your array and compile. If it's too big, PBP will respond with an error message. So just keep increasing the array size until you reach the point PBP will fail compiling.

    Little factors will affect the array size... like if you define other variables before or after your array. Unfortunately, trial and error is the only surefire method to determine the best arangement.

    I did play around with this for a program I wrote a couple of years back, and surprisingly discovered that the maximum array for PIC's like the 16F84 can be as little as 40-something bytes.

    Melanie

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Melanie,

    Just for a thought.....

    Since the chips store arrays as a string of characters, and using the idea of using programming space.

    Could you not put large strings at the end of your Programming space, and access it? Thus increasing the size of a array?

    Am I just thinking all wrong? or is this not a possibility?

    And then ( I am adding this about 2 hours later <g>) Since the 675 has 128 bytes of EEProm, could not this be used as a Array also? Granted, I realize that you would have to manually manipulate the array to some degree.


    Dwayne(Sometimes this kid just has to be straightened out by the professional PBP'ers!)
    Last edited by Dwayne; - 3rd May 2004 at 20:01.

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


    Did you find this post helpful? Yes | No

    Default

    All those are good and valid idea's... but there are drawbacks.

    I did a thread on this... "Making Program Code Space your playground" last November. Do a search on "Playground".

    Yes, you can use EEPROM space too... it's just that with EEPROM there is a time-factor of around 10mS in the write operation.

    I use both those methods for storing strings for LCD Displays... things like Setup Menu Trees etc... as MeLabs string handling is cumbersome for large quantities of messages etc.

    Being too slow during the write cycle, neither are any good however for fast applications (like using a circular buffer for Serial Comms for example).

  6. #6
    Keith55555's Avatar
    Keith55555 Guest


    Did you find this post helpful? Yes | No

    Default

    My application involved exactly that : 'a circular buffer',so the E2prom was out because of 'write time'.What I worried about using data space was being confronted with read/modify/write complications within the program itself.I would have to have something within the program that monitored the space I allocated for this buffer.I think this may be a case of short sightedness in laying out my circuit(more like wishful thinking in retrospect).I am about to re-design the board and am considering external hardware so as to have plenty of 'ceiling' for a substantial buffer.Some SRAM comes to mind but I was looking at some E2PROM that seems to have a much improved write times (compared to the on-chip E2PROM)that seem to come within the timing parameters. -Keith

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


    Did you find this post helpful? Yes | No

    Default

    If you can't chose a PIC with a lot more RAM inside for your circular buffer (easiest and probably cheapest option), then consider FRAM...

    http://www.ramtron.com/doc/AboutFRAM/overview.asp

    non volatile (like EEPROM), but fast (like RAM).

  8. #8


    Did you find this post helpful? Yes | No

    Default FRAM

    Hi Melanie,

    Those FRAM chips look cool.
    I don't suppose they make any in a dip package do they?
    I didn't see any.
    Maybe I'm just blind.

    Cheers.
    ---> picnaut

  9. #9
    Keith55555's Avatar
    Keith55555 Guest


    Did you find this post helpful? Yes | No

    Default

    Those ARE way cool.I see a DIP package in the photo ,under products.For my money,there are some very sexy SMTs,thoughThey're like a static(and I do mean,'does not move) drive.Bet those cost a bit.Digikey does not have them.Think I've read about them a while ago but this is the first I see them outside of a press release.

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


    Did you find this post helpful? Yes | No

    Default

    They're all SMD but perfect for Datalogging - especially the one with an RTC built in... just perfect for instant plastic Chicken applications...

  11. #11
    Keith55555's Avatar
    Keith55555 Guest


    Did you find this post helpful? Yes | No

    Default

    The parallel one's at the bottom of the page,marked with a 'P'(for example the fm1608 ,I believe was the number) are both SMT AND DIP . All the serial one's are smt

Similar Threads

  1. EEPROM Variables (EE_Vars.pbp)
    By Darrel Taylor in forum Code Examples
    Replies: 79
    Last Post: - 26th October 2012, 00:06
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 04:46
  3. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  4. Array to simple Variable converting
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2006, 16:44
  5. display lcd variable array Ascii
    By volcane in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd November 2005, 21:36

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