"Format" of the "cinit table" (solved)
Hi everyone, Ive been doing a bit of searching about this, but havent yet managed to find a suitable answer so far.
I decided to give myself a little challenge to write some code for a PIC16F886 for a little project - its basically a PIC connected to an RTC that turns a relay on and off at certain times of the day to connect/disconnect a battery from a charger.
Anyway, Im using some idata/udata_shr sections, and as I learned, you need to write/include some code to actually initialise the idata sections. The compiler or linker, which ever, includes some "tables" at the start of program memory to describe how many sections need initialising and their start/end addresses etc. But I cant work out how this information maps to my application.
The table generated is:
Which to me, based on a description I found in an example included with mpasm says:
There are 2 idata sections
The first starts at 0x0003, ends at 0x0026 and is 0x0001 words long
The second starts at 0x0078, ends at 0x0023 (????) and is 0x0002 words long
Or something close to that effect (Ive had to sleep on it, so going by slightly hazy memory now that Im at work).
The problem is, my variables are only using the memory range idata 0x20-0x26 and udata_shr 0x70-0x75, and I cant for the life of me figure out how the above table relates to those two memory ranges (although as I understand it, udata_shrt should not appear in that table). And if the first starts at memory address 0x03, its going to effectively initialise a whole bunch of SFRs?
Hoping someone can tell me what is that I simply dont understand about this? Or do I understand it correctly and something is just broken with the implementation?
post edited by toms - 2020/01/23 14:52:09