-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 source= http://www.piclist.com/piclist/2003/09/10/121616a.txt? Olin, I'm exploring the other parts of your post. It promises to be an interesting journey. But a quick first response. One of my interests is to have documents that work smoothly for a motivated, intelligent layman. You don't count as a layman, as you have extensive PIC experience. I do, marginally, in that this is my first PIC project, although the fact that I know lots of assemblers and have embedded experience may mean that I am too experienced to see the beginner's traps. One of the things that I would observe ( "count" ) is the number of posts in this very thread that have some error in them. The larger the "count" of errors in a public forum using prepared statements by experienced people, the crummier the "grade" on the documentation. Continuing this line of thought, I haven't used the relocatable project before about 2 days ago. So I took the '874.lkr file, read everything in the Help, read the entire .lkr file until I thought I comprehended it, and read several posts from the archive. Then I tried to move my working, absolute code to relocatable form. I experienced errors, most of which are just dumb new user items, but some of which I attribute to the quality of documentation. Again, I only marginally count as a layman, as I know what a linker does, I know what a librarian is, I know what relocatable code is (and even position independent code -- PIC). I have worked with linkers that have multiple symbolically named sections. I have used linkers that do partial linking of some files, intermediate between total linker and librarian. I do read INHX8 records and use the PIC '874 programmer that I made. So I *should* be able to read a template file and the instructions, and 'just do it.' I *should* be able to use the examples without tripping. To qualify as excellent, the Microchip examples should work with *NO* gotchas. This 'should' statement is a specification for the quality of documentation, or market feedback. If the example code needs to grow as the projects require more experience and more nuance, the burden on the examples should be to work as is for beginners, not to give beginners an endless list of "oh, yeah." Of course, that is a grey line, but as a PIC novice I see that line a little closer than the old hands in the list. So, in the linker example file I find: DATABANK NAME=gpr0 START=0x20 END=0x7F DATABANK NAME=gpr1 START=0xA0 END=0xFF What will a novice do? Copy it and try to use it unchanged! Read it and try to comprehend it. Is this broken? Should I complain in public without any reasonable alternative? Here is one alternative that is a very tiny change from the provided examples, but which I think is superior. It works, it serves as an alert to the more careful reader, *but* an overwhelmed beginner won't trip, the more experienced user will, of course, make more extensive customization in the fullness of time. (However, as it is my first PIC project, I will surely abandon all of this approach within a year for another style.) DATABANK NAME=gpr0 START=0x20 END=0x6A <-- end differs DATABANK NAME=gpr1 START=0xA0 END=0xEA <-- Combine this with my code, following your influence: AllocG MACRO var,size GLOBAL var var RES size ENDM System UDATA_SHR ;<-- share to avoid speed penalty. AllocG w_temp0,1 ;variable used for context saving ; This extension then becomes obvious, to save bank management ; overhead. AllocG status_temp,1 ;variable used for context saving AllocG SystemStack,3+8 ;need really fast access here. SHAREBANK NAME=wtmp START=0x6A END=0x7F <-- Protected ? SHAREBANK NAME=wtmp START=0xEA END=0xFF What does this give me? Together with the cut and paste for the interrupt scaffold it gives an example that can be used immediately, and (possibly) never be changed in a later project. It clarifies how to make a design decision between really fast access in a tight interrupt system, at the expense of using 2 RAM locations per variable. It is better. In a real experiment, I would produce two versions of the data sheet, and see which ones give fewer support calls, or faster time to market. The outcome is measurable. I speculate that the measurement would show that the existing stuff leads to programmer errors, and my patch does not. Lost time doesn't count as "broken" but programmer error do. That is my justification to say it's broken: not that an expert can review and finally see how it is correct, but that a novice can't trust it. Whew, I wonder if my students will write like this on my evaluation? .... Olin wrote: >DATABANK NAME=gpr1 START=0xA1 END=0xFF //Does 0x20 & 0xA0 >map together? Argh, no!!! Each separate region of RAM should have its own DATABANK or SHAREBANK (SHAREBANK in this case). You are telling the linker it's OK to allocate your RAM on top of all the FSRs in bank 1. - --- Aubrey McIntosh http://www.piclist.com/member/AM-vima-Y84 PIC/PICList FAQ: http://www.piclist.com -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 7.0.3 for non-commercial use iQA/AwUBP1+7CAKlSw8yssF7EQJvawCg/suliQB/DcScTb1cXpys/Adf/DgAoKwU VxBEKvrcdKhBWPbkIL2B8xI+ =nlqv -----END PGP SIGNATURE----- -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics