CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ram, rom

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ILLIAS28



Joined: 11 Jan 2011
Posts: 42

View user's profile Send private message

ram, rom
PostPosted: Wed May 28, 2014 1:41 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 28, 2014 2:27 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 28, 2014 2:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 28, 2014 2:46 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu May 29, 2014 12:40 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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