On-Chip RAM


Closed Thread
Results 1 to 13 of 13

Thread: On-Chip RAM

  1. #1
    Join Date
    Mar 2008
    Location
    Gerogetown, Texas
    Posts
    94

    Default On-Chip RAM

    I have a 18F2515 it has no EEPROM but has 3K of RAM. I know how to read and write to EEPROM using "DATA" and "EEPROM" statements. I can not find anything on accessing the on-chip RAM.

    1. Can you write to RAM at Program time?
    2. How do you write and read the RAM while running the program.

    Thanks

    Dave

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DaveC3 View Post
    I have a 18F2515 it has no EEPROM but has 3K of RAM. I know how to read and write to EEPROM using "DATA" and "EEPROM" statements. I can not find anything on accessing the on-chip RAM.
    1. Can you write to RAM at Program time?
    2. How do you write and read the RAM while running the program.
    Thanks
    Dave
    On chip ram is variable space, i.e.
    my_variable var byte[2000]

    There's your 2000 bytes of on chip ram right there...Use it as you please...

  3. #3
    Join Date
    Mar 2008
    Location
    Gerogetown, Texas
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Thanks Skimask

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DaveC3 View Post
    Thanks Skimask
    Take note that unless you have a look at your .LST file, you'll never really know how much extra 'ram' is available.
    When I'm writing a program, I set up a rather large array, i.e. emptyspace var byte[3900], and when it fails to compile because it can't fit the 'emptyspace' variable, I turn down the number a bit until it fits.
    Helps me keep tabs on how much memory (ram in this case) I'm using so I know how many other useless 'features' I can add to whatever I'm working on.

  5. #5
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DaveC3 View Post
    I have a 18F2515 it has no EEPROM but has 3K of RAM. I know how to read and write to EEPROM using "DATA" and "EEPROM" statements. I can not find anything on accessing the on-chip RAM.

    1. Can you write to RAM at Program time?
    2. How do you write and read the RAM while running the program.

    Thanks

    Dave
    Keep in mind however, that the RAM is volatile, so will get wiped when the PIC is powered down. Thus the reason for EEPROM.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

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


    Did you find this post helpful? Yes | No

    Default

    One more thing to add....

    EEPROM has much longer life time compared to the RAM.

    If you keep writing to RAM , how frequent is the question there, then you will end up with a dead RAM in much shorter time as if you used EEPROM.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    Uht-oh,

    I know dyslexia is for numbers, but I think I read that backwards.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Uht-oh,

    I know dyslexia is for numbers, but I think I read that backwards.
    <br>

    Dyslexia manifests primarily as a difficulty with written language, particularly with reading and spelling. It is separate and distinct from reading difficulties resulting from other causes, such as a non-neurological deficiency with vision or hearing, or from poor or inadequate reading instruction. Evidence also suggests that dyslexia results from differences in how the brain processes written and/or spoken language.

    Dyslexia is most commonly characterized by difficulties with learning how to decode words, to spell, and to read accurately and fluently. Dyslexia also makes mathematics more difficult as people with dyslexia might mix numbers up. Dyslexic individuals often have difficulty "breaking the code" of sound-letter association (the alphabetic principle), and they may also reverse or transpose letters when writing or confuse letters such as b, d, p, q, especially in childhood. However, dyslexia is not a visual problem that involves reading letters or words backwards or upside down, nor are such reversals a defining characteristic of dyslexia.


    And, to whom did you address DT?
    Last edited by sayzer; - 28th July 2008 at 08:45.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer View Post
    And, to whom did you address DT?
    You, of course.

    I know you know this. Something just got crossed when you were typing it.

    Just re-read post #6. You'll get it.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    You, of course.

    I know you know this. Something just got crossed when you were typing it.

    Just re-read post #6. You'll get it.
    <br>
    If you are pointing to EEPROM and RAM life, I referred to datasheet stating
    "
    -100,000 write Flash endurance,
    -1,000,000 write EEPROM endurance

    "

    Thus, EEPROM has longer life then RAM.

    If the way I understand it is wrong, please correct me.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    RAM is commonly refered to as "General Purpose Registers".
    That's the area where all the variables are placed.

    Theoretically, you can read or write to RAM every microsecond until the end of time (or the end of the chip, which ever comes first).

    The Flash area is where the program is stored. And the EEPROM is just a place to store periodically changing values that retain their data when power is removed.

    RAM loses it's data when power is removed.

    hth,
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    RAM is commonly refered to as "General Purpose Registers".
    That's the area where all the variables are placed.

    Theoretically, you can read or write to RAM every microsecond until the end of time (or the end of the chip, which ever comes first).

    The Flash area is where the program is stored. And the EEPROM is just a place to store periodically changing values that retain their data when power is removed.

    RAM loses it's data when power is removed.

    hth,

    Thanks DT.

    In that case, when we use WRITECODE command, are we using up flash life?

    Our friend did not mention losing data.
    Thus, I wanted to add something for his consideration.


    Last edited by sayzer; - 28th July 2008 at 10:04.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer View Post
    In that case, when we use WRITECODE command, are we using up flash life?
    Now you got it.

    And WRITE uses EEPROM life.

    Thus, I wanted to add something for his consideration.
    It worked!
    <br>
    DT

Similar Threads

  1. Camera with PIC chip
    By The Master in forum Off Topic
    Replies: 5
    Last Post: - 1st July 2008, 14:28
  2. TV Display Chip
    By zadok in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 17th April 2008, 22:17
  3. 16F877 RAM Question
    By Art in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th August 2005, 11:47
  4. chip selection aid
    By PICMAN in forum General
    Replies: 4
    Last Post: - 21st February 2005, 18:33
  5. 18f452 tables in ram - code?
    By rshanks in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st October 2004, 05:06

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