Harold Hallikainen wrote: > I don't like to ever rewrite anything in the boot area, whether that's the > vector table or boot code. In my bootload applications, the vector table > points to a jump table in the application area. The reset vector, of > course, points to the bootloader (in the boot area) where a check is made > to decide if the user wants to bootload. If not, it jumps to the first > location in the jump table in the application area. From there it goes on > to the application. All interrupt vectors, whether I use them or not, > point to gotos at the start of the application area (in fixed locations). > Unused ones point to some error detection code or just return. That way, > if I later decide to use an interrupt that was not used at first, I can > still bootload in the new code. > > On configuration bits, I think you can write protect those addresses > individually (write protect all config bits), so you don't need to avoid > erasing a 1k block. > > I've used this approach on 18LF6722 and 24HJ256GP610. Next is a PIC32! > > Harold > > > I've written several bootloaders. One scheme that works is to maintain two copies of critical updater code. Switch to the second while the first is being overwritten. Use CRC16 to make sure the data is good before you switch back. --Bob -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist