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

running out of memory space

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



Joined: 22 Nov 2003
Posts: 32

View user's profile Send private message

running out of memory space
PostPosted: Tue Dec 16, 2003 9:09 am     Reply with quote

I'm currently using an 16f876a and am coming very close to running out of ROM. I've used every method I know to tweak (and many that I have found on this forum) and have one very large function which uses the atan, sin and cos functions in a calculation and thus uses alot of ROM space.

So, does anyone know of a better math library than the one supplied that does not use so much memory? I am not concerned about more than 5 decimal places.

I'm also considering spending some more money on the PCH compiler and going to the 18f252 which seems to be pin compatible with the 16f876a. It appears to me that my circuit would still work using the 18f252. Are there any problems or pitfalls software or hardware going in this upgrade direction?

Any other ideas would be greatly appreciated as well.

Thanks,

Bob
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Tue Dec 16, 2003 11:01 am     Reply with quote

If you are NOT using the Analog comparator function in the PIC16F876A then you should find not problem dropping in a PIC18F252 .
bcs99



Joined: 22 Nov 2003
Posts: 32

View user's profile Send private message

PostPosted: Tue Dec 16, 2003 12:05 pm     Reply with quote

Thanks for the reply.

Would I have to make any coding changes if I changed to PCH using the 18F252 instead of 16F876A?

Bob
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Tue Dec 16, 2003 12:24 pm     Reply with quote

It depends on your code.

If you are using
#byte = address
Then you will need to adjust the address values.
Same goes for any defines that reefene memory or registers, the need to be updated for the PIC18 values. This takes just a few minutes, and some people make a .h file to handle all their own defines.

Interrupts default to what you are already used to in pic16F and should compile and work without problems.

Reading counters is faster, and for free.

I converted from PIC16F876 (not a) to PIC18F252 with a minimum of problems.

You can take advantage of the 4X PLL oscillator and get increased speed.
I don't know your xtal Freq. but if it's 10MHz and under you can simply enable the 4XPLL (FUSE H4 ) and get a 4X increase in speed. Remember to set the #use delay (to 4X of what you have now)

PCH has come of age, and is now a stable product (big smile and tongue in cheek). It's good.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Dec 16, 2003 12:55 pm     Reply with quote

I believe that timer0 is now 16bit or 8bit so you might will probably need to keep that in mind and make sure that it is setup correctly.
bcs99



Joined: 22 Nov 2003
Posts: 32

View user's profile Send private message

PostPosted: Wed Dec 17, 2003 5:42 pm     Reply with quote

Thanks for the tips.
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