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

Effective memory management tricks.?

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



Joined: 27 Nov 2023
Posts: 2

View user's profile Send private message

Effective memory management tricks.?
PostPosted: Mon Jan 01, 2024 7:38 am     Reply with quote

hello CCS community!!
new here, keen to understand the strategies for when using the CCS C Compiler for PIC microcontrollers. Anyone here may assist on this, would be grateful. Thanks.!!
temtronic



Joined: 01 Jul 2010
Posts: 9236
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 01, 2024 8:31 am     Reply with quote

1) Buy the biggest PIC in a 'family' ! Yes, it'll be 'overkill' for 99.44% of your projects BUT you should never run out of memory or I/O pins. I settled on the then new, PIC18F46K22 in 40 pin DIP even though there's smaller version(22pin). I prefer LARGE PCB with room to grow.

2) Only use 'global' RAM if needed. That way RAM gets 'recycled' as required.

3) 'memory' comes in many types RAM, ROM, EEPROM each has tricks to using them.

4) one 'trick' I use. Seems every project has need for 'time',so I use an RTC/EEP module. The RTC has battery backed RAM( few bytes) which can be handy for when power fails.... the EEP can store tables or arrays of 'fixed data'( say text for screens, font tables or similar )

5) using a 'fprintf' subroutine / function can save a lot of space. a 'generic' print that prints all variables to LCD screen, with 'dummy data' as place holders.
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