John Ferrell wrote: > On 6/25/2011 3:12 PM, jerry james wrote: > > Check out AN1310. > > http://www.microchip.com/stellent/idcplg?IdcService=3DSS_GET_PAGE&nodeI= d=3D1824&appnote=3Den546974 >=20 > AN1310 seems to imply that a programmer must be able to select a=20 > "bootloader mode". My programmers do not have that option. I haven't seen AN1310, but it sounds like it may be somewhat confusing. The key concept is that you use a programmer OR a bootloader, not both at t= he same time. You use the programmer to put the bootloader on the target chip, and then use the bootloader to put the application code on it. Sometimes it= 's possible to arrange things so that the bootloader and the initial copy of t= he application get put onto the chip by the programmer in one go -- that's wha= t I did with my custom SPI-based bootloader for a deeply-embedded power suppl= y controller. It can get a bit tricky to make sure that the bootloader and th= e application remain as two completely separate projects that can be built independently, sharing data (if necessary) only in well-specified ways. The other key concept is switching between the application and the bootload= er once the chip is installed in its application (this may be what AN1310 was actually talking about). Sometimes this is handled by having the bootloader briefly take control on every hardware reset and look for some indication that it should NOT run the application; other times, the application gets control following reset, but has a "hook" that it can jump to in order to invoke the bootloader on command. Again, in my custom bootloader, we took t= he latter approach, because it was important for the application code to get t= he power supply controls into known states ASAP following power-up. -- Dave Tweed --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .