|
|
View previous topic :: View next topic |
Author |
Message |
ILLIAS28
Joined: 11 Jan 2011 Posts: 42
|
ram, rom |
Posted: Wed May 28, 2014 1:41 pm |
|
|
Hi,
When we build and run a project with ccs, the compiler show us at the end the percent of ram and rom used. Which rom does it mean, the flash rom or the eeprom?
Thank you very much. _________________ i am newbe |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Wed May 28, 2014 2:27 pm |
|
|
The program memory.
Flash.
The EEPROM is a separate peripheral. Not part of the code as such. Only used by you calling functions to access it. |
|
|
ILLIAS28
Joined: 11 Jan 2011 Posts: 42
|
|
Posted: Wed May 28, 2014 2:39 pm |
|
|
many thanks Ttelmat for your help,
still a question please,is it possible to save data in the program memory?
for exemple i would like to save the start times and stop times of a machine during a month.the Ram of a pic16f876 would not be enough,so is it possible to save them in the program memory where it still give enough space? _________________ i am newbe |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Wed May 28, 2014 2:46 pm |
|
|
You have several options...
1) choose a PIC with a large amount of flash (program) memory AND can program itself (not all PICs can).
2) add an external memory device. Typically it's an I2C memory device
Other options include FRAM, Vinculum based flashdrives, MMC/SD cards, WiFi to PC for logging,etc.
You'll have to decide what works best for you as we don't know your required memory requirements, cost factors, time to complete project,etc.
hth
jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Thu May 29, 2014 12:40 am |
|
|
Key problems with the flash memory are:
1) It is _page_ based. Unlike the EEPROM, that can erase a single cell, on flash you have to erase an entire page. Just writing one byte, involves reading the whole page, modifying that one byte, erasing the page, and writing the whole page back. In your case the page is a single instruction word, so this is not a problem. On later chips the page is much larger. Up to 1Kword....
2) It has much lower numbers of supported write/erase cycles than EEPROM. Some chips have a small area defined as 'high endurance', which supports a larger number of cycles than the rest of the memory. Otherwise it is surprising how quickly the 'life' can be used up. Your chip only has a write life of 1000 cycles on the flash memory. Even something updated just once a day, would use this in less than 3 years.....
3) It is not 'byte' orientated. The flash program memory is organised in words. On the 876 each word is 14bits. So you can't store two bytes in a word.
4) The chip _stops_ during a write/erase operation. No instructions execute during these operations. If for instance your chip has to receive serial data at 9600bps, characters will be lost every time the program memory is updated.....
On chips that do support program writes to flash, CCS supplies the functions to access this. write_program_memory read_program_memory.
You have EEPROM on your chip. Use it.
You could code a date and time as an int32. The EEPROM could then hold 64 values. Use a value of FFFFFFFF as a flag to say this is the next value to use, and just use the memory as a ring buffer for the last 63 start/stop times. You can even use one bit of the value as a flag to say that the time is a start or a stop. If you need more storage than this, then switch PIC's, or use an external memory. FRAM is nice because it is _fast_. As soon as the data is clocked to the chip, it is already stored. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|