Jump to content

Loading Code from Bankstick


Calphool
 Share

Recommended Posts

Hello,

I've been working on a Midi2CV project that I'm using to control the minimoog model d clone I built. I've basically run out of flash on my PIC and I'm at the point where I'm (dangerously) sharing variables in order to keep code size down.

I'm wondering, is there some way that I can compile my code so that I put some of it on my bankstick and overlay it into flash at run time? I'm too cheap to switch to the newer 32 bit hardware.

Has anybody tried this? Is any kind of interrupt invoked if you try to write beyond the end of your flash memory? If so, would it be possible to build some kind of bankstick code memory manager?

Thoughts?

Joe R.

Link to comment
Share on other sites

Depending on what you mean by "sharing" variables, but one way to do save memory for temporary variables is to declare them within the scope of the function where they're used. This way they are generated from the C stack each time the routine is called and the stack space get used and reused over and over very efficiently (and is good coding style).

Updating the flash program from eeprom (presumably frequently ) is likely to wear out the flash memory of the PIC. Its also nontrivial to code, unsupported, and I suspect, putting a huge hurdle between you and your desired project outcome :-(

My suggestion is to get a job and go 32bit! ;-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...