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 support@ccsinfo.com

save char on flash memory

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



Joined: 16 Mar 2013
Posts: 7

View user's profile Send private message

save char on flash memory
PostPosted: Sat Jun 08, 2013 4:36 pm     Reply with quote

hi every body...
i want save char in flash memory like in codevision
flash CHAR m[250];
is any Function or something that i can do that in ccs
flash CHAR m[250];
thanks alot
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat Jun 08, 2013 6:32 pm     Reply with quote

the PIC has EEPROM
and program flash

i suggest EEPROM

its in the CCS manual
under "read_ and write_eeprom()
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sat Jun 08, 2013 6:37 pm     Reply with quote

Don't forget to look up the WRITE ENDURANCE of BOTH.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jun 08, 2013 7:47 pm     Reply with quote

Quote:
i want save char in flash memory like in codevision
flash CHAR m[250];

Do you mean a font table for a graphic lcd ?
If so, see the GLCD.c driver file in the Drivers folder of the CCS compiler.

You can tell the compiler to store a table in Flash by using the 'const' keyword.
Example:
Code:

const BYTE TEXT[51][5] ={0x00, 0x00, 0x00, 0x00, 0x00, // SPACE
                         0x00, 0x00, 0x5F, 0x00, 0x00, // !
                         0x00, 0x03, 0x00, 0x03, 0x00, // "
                         0x14, 0x3E, 0x14, 0x3E, 0x14, // #
                         0x24, 0x2A, 0x7F, 0x2A, 0x12, // $
meysam.za



Joined: 16 Mar 2013
Posts: 7

View user's profile Send private message

PostPosted: Sun Jun 09, 2013 3:33 am     Reply with quote

`pcm programer no const for font ...
i need variable to save sms from GSM modem (sim900) and i must :
char sms[250];
but size of ram is not enogh.....
and i want use flash memory
Ttelmah



Joined: 11 Mar 2010
Posts: 19338

View user's profile Send private message

PostPosted: Sun Jun 09, 2013 4:19 am     Reply with quote

You can't use flash memory like this....

Flash memory, has a very limited 'write life' (how often you can write to it), and has to be written in pages. To change a single byte, you have to read the whole page, change just the one byte, and write the whole page back. One life used.....

EEPROM is better - supports single byte writes, and has typically tens to hundreds of times the write life of flash, but still quite limited (you can kill the memory in just a few seconds writing as fast as possible).

Both memories are also _slow_. Takes typically 4mSec to perform one write. Too slow to accept something like an SMS message.

Seriously, change your PIC for one with more RAM. This is not what flash memory is designed for.
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Jun 09, 2013 10:38 am     Reply with quote

FRAM is even better!
_________________
Google and Forum Search are some of your best tools!!!!
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