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.

Expanding a PIC Program memory

Status
Not open for further replies.

CoTang

Member
Hello, I was wondering how would you go about expanding a pic program memory. For example, I have a HUGE program and it doesn't fit on a 16F877A. How do I got about getting the PIC to run off an external EPROM?
 
An PIC can run programes only in its own memory (even an CPU in an PC has to copy programes in its own memory befoe it can preform them)
 
So basically what i have to do is store the program in an external EEPROM and have the PIC load sections of the code into itself, excute the program then delete it then copy another section and excute and so forth and so forth?
 
oOo - 'could' work.

But will be a bummar to make and a pain to program around.

Why not upgrade to a 18F? what language u program in?
 
CoTang said:
So basically what i have to do is store the program in an external EEPROM and have the PIC load sections of the code into itself, excute the program then delete it then copy another section and excute and so forth and so forth?

You can't do that on a PIC 16F877, you CAN execute bootloader code, so you could possibly reprogram the 877 from a program stored in externla EEPROM - but it would be very slow and clumsy.

I suggest you need to go back to first principles!, WHY is your program so large? - what is it written in?. Change the language for something more sensible?, or rewrite your program to be more space efficient?.

Or, as suggested, change to a larger device?.

8K is a huge amount of memory for a device like a PIC, it would take some filling!.
 
CoTang said:
Hello, I was wondering how would you go about expanding a pic program memory. For example, I have a HUGE program and it doesn't fit on a 16F877A. How do I got about getting the PIC to run off an external EPROM?

You should now consider upgrading to a PIC18F452. This chip is pinout compatible to the PIC16F877A and has double the program capacity. Program migration at the assembly language level is relatively easy.
 
Well, I work in the electronic industry for 5 years now (just gaining exp.) and there were custom "Microcontroller" boards that the company design for there own use and each one had one or two external EPROM (range from 256K-512K) that the program was stored in. Although those weren't PIC's, I thought there might be a way to expand the PICs Program memory. I guess those CPU (Intel, Motorola) requires external EPROM for their program. Or maybe I'm mistken. :?
 
CoTang said:
Well, I work in the electronic industry for 5 years now (just gaining exp.) and there were custom "Microcontroller" boards that the company design for there own use and each one had one or two external EPROM (range from 256K-512K) that the program was stored in. Although those weren't PIC's, I thought there might be a way to expand the PICs Program memory. I guess those CPU (Intel, Motorola) requires external EPROM for their program. Or maybe I'm mistken. :?

The small size of a PIC rather gives it away, there isn't the pin space for external memory - that's more a microprocessor facility than a micro-controller one. The whole point of a PIC is that it's small, and doesn't require many external components.

As I asked before, wny are you using so much memory?.
 
No CPUs have there own memory for programes.the external RAM is for the variables.It on the chip for the reson to run faster

I some PICs you can use the program memory to store data (insted of the small internal EEPROM)if the pocesor has reed/write acses to the memory (it can write the program or some data in the program memory by it self )

the only difrence by an CPU and an PIC is that the CPU dosent have an EEPROM and internal RAM (they also need a lot more external components)
 
Hi,

If not all I/O ports are occupied, ther may be an alternative.
Increase the number of PIC's in your design, and let each PIC, monitored and controlled by "the main" PIC carry out sub tasks.

Bye,

JWB
 
:shock: You can not expand the program memory (code/data mem) of pics 12xx 14xx or 16xxx or 18xxx BUT with the 17xxx YOU CAN !!!!

:idea: You can use 17Cxxx Microchip PICs ... they can work in microcontroller mode (like other pics) or in µprocessor mode where you can execute your code from an external eprom/eeprom or static ram.
 
I think they have ROM less PICs too that dont even have program memory.These things are considerd to be realy slow.
 
I'm just to lassie to read all this comment's, so if someone already give your answer than ignore mine.

If you need to store a large amount of "TEXT" in your code for LCD/Serial message than you should move your "TEXT" to a external EEPROM !
I2C only use up 2-3 I/O line and you can share whit other devices.
32/64k add on to your project is great.

For example :

1;If you click on Add an Attachment, you will see the box for adding 2;Attachments.
3;If you click on Posted Attachments, you will see a list of already 4;attached Files and you are able to edit them.


If you wan to display line 3 and 4 than you read your EEPROM location from where is line three start from and keep reading until you reach the end of line 4. "read from 0x4E to 0x68"

For common words like "Yes", "No", "Exit", "Menu" and 100's more what you might use in your program, just keep referring to the same location every time you need to use them.

If your code large because of the size of your program, than maybe you should look for a more efficient Compiler !

8kbyte is a lot of codespace !

Good luck.
STEVE
 
bluex_scf said:
:shock: You can not expand the program memory (code/data mem) of pics 12xx 14xx or 16xxx or 18xxx BUT with the 17xxx YOU CAN !!!!

:idea: You can use 17Cxxx Microchip PICs ... they can work in microcontroller mode (like other pics) or in µprocessor mode where you can execute your code from an external eprom/eeprom or static ram.

Hey that cool! I didn't know that. You can expand your code memory up to 64K. So anyone got a tutorial on how to set that up? Thanks again
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top