Olin Lathrop wrote: > It hasn't come up. Why do you need to? > > I have occasionally needed to verify that a PIC contained the > information in a specific HEX file. You kind of answered your question. Just that I don't have access to the PIC, but to a hex file that contains what was in the PIC (and of course the original hex file that contains what should have been in the PIC). > For that I use my PIC_PROG program with the -V command line option. It > looks up the particulars of the PIC in a data file. This information > includes which config bits are relevant and which ones are not. > Mismatches in the irrelevant bits are ignored. This looks like what MPLAB's verify function also does (like probably every programmer's verify function). But it seems both need a programmed chip to compare against. Which I usually have, but not this time. >> Can I set the unused bits to 0 in the original hex file? > > You can set them to anything you want in the source code. That then does seem to do the trick, doesn't it? But the remainder of your message leaves me with some doubts about my interpretation of this phrase of yours... :) >> If that's not an option, does that mean that normal hex file >> comparison tools are not really that useful in this scenario? > > Right. If I understood you correctly, you just said that it's ok to set the unused bits to 0 in the hex file that is used for programming. This would allow to create hex files for programming that look identical to the ones read from a chip -- making it possible to compare them with a standard hex file comparison tool. Did you mean that I can "set them to anything [I] want" if the programming device is smart enough not to program them, or did you mean that it really doesn't make a difference whether they are set to 0 or to 1? If so, is there a good reason why most (all?) header files set them to 1? > 1 - Don't do that. Sorry... don't do what? Set the unused configuration bits to 0? Compare two hex files? > 2 - You can use the facilities in my PICPRG library to get used/unused bit > information for any of the PICs I currently support. Thanks, that sounded like an option if I had that need more often. This was the first time, and I think it won't come up so soon again -- so the need to produce a tool that does this is not that pressing, and when needed, I can always go back to bit-fiddling in my head :) I just thought that most of the (even rare) things that do come up usually came up before for someone else... and maybe I overlooked something. Thanks, Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist