Quintin Beukes wrote: > I was hoping for some advice/corrections on dynamically allocating > memory. Some compilers come with heap and dynamic memory management routines. Use them if they are there, or roll your own if you want or need to, but don't just go grabbing memory you think isn't in use. Why do you need to dynamically allocate memory anyway? This is rather unusual in a small embedded system, and likely indicates big system thinking on a small system. I've only done on the fly real persistant memory allocation on a PIC once that I can remember, and in that case the memory being allocated was actually out on a ENC28J60 ethernet MAC/PHY with the PIC keeping track of the allocated regions. I have sometimes needed a temporary buffer and the like inside a single routine on a 18F. In those cases I have so far just temporarily appended the buffer to the data stack. What problem are you really trying to solve? > 4. I _assume_ the compiler will use ... This sounds like really bad design. Don't assume, know. But even if you did know for sure, that only applies to this rev of this compiler. Guessing where unused memory is without using the proper mechanisms to allocate it is heading for trouble. For example, how do you know the data stack isn't allowed to grow into the left over memory? > Then chosen as follows: Any addresses above A9, and to accommodate > future changes, use any above 200, and carefully monitor my compiles? Yuck! That is really bad design. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist