> >I'm just full of questions today. ;-) > >I'm noticing that when I set the User ID memory in my >18LF2320, MPLAB lets me set 8 nybbles (i.e., >DEADBEEF), but when I read it back, I can read 8 >memory locations (starting with h200000 and going >through h200007). > >The result is "0D0E0A0D0B0E0E0F". Errata and >manual are no help; apparently this is the desired >behaviour. > >What's the mystery here? I'm using MPLAB 6.60; >should I update? I'd rather not, at least, no right now, >unless I have to. I'm programming with the ICD2. I'd >like to try with my WARP-13a, but I don't have the >right PC software to go with the firmware I have on it, >and I don't have any 18F252s to program with the >proper firmware. Although I do have both the latest >firmware and software; I downloaded them a few days >ago, before the hullabaloo. > >I don't need all 8 bytes of storage, but it'd be nice. >Nicer still would be to really understand what's going >on here, beyond my guess of weirdness in MPLAB. > >Mike H. This, believe it or not, goes way back to the code protection on early PICs like the 16C5x. When code protecting such a device, the memory contents would read out in a scrambled form. The three nibbles in the 12-bit core parts were XORed together and read out as 00x where 'x' was the XOR of the three nibbles. This scrambling included the ID and config word. Because of this, microchip recommended that only the lower nibble of the ID was used with the upper two nibbles set to '0' This meant the ID in a code protected part could still be read. Microchip eventually extended this recommendation to other PIC devices like the 16C71 even though the scrambling method was different and you could in fact get seven useful (readable) bits of ID per word (if the upper 7-bits were set to '1' as the scramble was a NOT XOR of the lower 7-bits with the upper 7-bits.) (Actually, it was a NOT something, not a NOT XOR but I just cannot recall. Ah! XNOR, that's it! (Ok, I just looked it up.)) It is just and artifact of history that this recommendation is enforced by MPLAB to this day for ALL pics (with ID locations). Now, of course there is no reason to limit your ID values to just one nibble on any PIC other than a small number of original 16C5x parts. Certainly there is no reason on the 18F parts. The WARP-13 will let you use the whole byte. Grab yourself a 18F252 or 18F2520 or 18F2620 and do the upgrade if you would like the option of using the full 8-bits. Regards, Jim -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist