That's awesome. Thanks alot. Quintin Beukes On Tue, Oct 6, 2009 at 1:19 PM, Isaac Marino Bavaresco wrote: > Quintin Beukes escreveu: >> Hey, >> >> I am using the HiTech compiler, since I know this might be compiler depe= ndent. >> >> I was hoping for some advice/corrections on dynamically allocating memor= y. >> >> My understanding is this: >> 1. The device has X bytes of memory. >> 2. I can assign the address of memory I wish to use to a pointer, and >> work from there. >> 3. I need to somehow make sure I don't use memory which is already >> assigned by the compiler. >> 4. I _assume_ the compiler will use the lower memory ranges, so if I >> know how much memory the compiler has assigned, I can use any other >> above that address? I can determine this from the following output: >> Memory Summary: >> Program space =A0 =A0 =A0 =A0used =A0 8DEh ( =A02270) of =A08000h bytes = =A0 ( =A06.9%) >> Data space =A0 =A0 =A0 =A0 =A0 used =A0 =A0A9h ( =A0 169) of =A0 600h by= tes =A0 ( 11.0%) >> EEPROM space =A0 =A0 =A0 =A0 used =A0 =A0 0h ( =A0 =A0 0) of =A0 100h by= tes =A0 ( =A00.0%) >> External data memory None available >> ID Location space =A0 =A0used =A0 =A0 0h ( =A0 =A0 0) of =A0 =A0 8h nibb= les ( =A00.0%) >> Configuration bits =A0 used =A0 =A0 7h ( =A0 =A0 7) of =A0 =A0 7h words = =A0 (100.0%) >> >> >From here I figured, I can choose an address range based on the followi= ng data: >> 1. I have a PIC 18F2520. >> 2. It has 1536 bytes of SRAM (600h), as seen in row 2 of the summary abo= ve. >> 3. The compiler assigned 169 bytes (A9h) of memory. >> >> Then chosen as follows: Any addresses above A9, and to accommodate >> future changes, use any above 200, and carefully monitor my compiles? >> >> Alternatively. I had a quick glance over the compiler's manual, and >> noticed memory areas called "psects", which can be user defined with >> #pragma psect, but I don't see how I can use this for the described >> purpose. >> >> Any/all advice would be appreciated. >> >> Quintin Beukes >> > > Greetings, > > Take a look at my page: > > Directly related to your needs, probably off-the-shelf. > > See other PIC-related stuff also: > > > Best regards, > > Isaac > > __________________________________________________ > Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger > http://br.beta.messenger.yahoo.com/ > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist