Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16F876 Rom

Status
Not open for further replies.

SocMatt

New Member
Au revoir,

I am writing a program to control timings in an oxygen sensor using interrupts.
The chip I am using is a PIC16F876 and the code is written in 'C'.
The code I wrote worked correctly, however, now i need to add more processing to the code and it wont compile, as it says the PIC16F876 has not got enough ROM for this program.
Is there anyway of expanding the ROM with an external chip??
Any help would be most appreciated

Cheers

Matt
 
You can't add any extra ROM to the 876, writing in C is probably adding a great deal of extra code that may not be needed. You should try and optimise your code, try and find alternative ways to do things - ones which use less code space. Using a high level language tends to make you lazy, and not look for better ways of doing things.
 
I read in the help to the compiler:

Out of ROM, A segment or the program is too large

A function and all of the INLINE functions it calls must fit into one segment (a hardware code page). For example, on the '56 chip a code page is 512 instructions. If a program has only one function and that function is 600 instructions long, you will get this error even though the chip has plenty of ROM left. The function needs to be split into at least two smaller functions. Even after this is done, this error may occur since the new function may be only called once and the linker might automatically INLINE it. This is easily determined by reviewing the call tree. If this error is caused by too many functions being automatically INLINED by the linker, simply add a #SEPARATE before a function to force the function to be SEPARATE. Separate functions can be allocated on any page that has room. The best way to understand the cause of this error is to review the call tree.


is it possible that this is the problem??
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top