If you pull the cable the buffer won't fill and it will sit there patiently waiting. If noise is interpreted as data, then it may program rest of memory with that and the chip will get a garbage-program. (As I don't verify data yet.) However, the code is written so that it won't touch it's own code. And, it will always load. The bootcode actually announces itself on the RS232 and waits a short while for a Flash-reply. If none is received it continues to boot the regular program. If received, it asks for a data-block, then erases memory and programs the block before asking for a new block. After the final block, it tells the computer it is done, and doesn't want another block before halting in anticipation for a full reset. I like the sum idea. It should be quick and simple. (Adding it now while I wait for other bright ideas, but I really think it would be enough :) ) Kyrre ----- Original Message ----- From: "David VanHorn" To: Sent: Saturday, June 26, 2004 4:55 PM Subject: Re: [PIC:] 16F88 RS232 bootloader. > At 04:49 PM 6/26/2004 +0200, Kyrre Aalerud wrote: > > >My bootloader is coming along nicely :) > >I have most of the functionality in place now. > > > >Specs are now: > >- uses 106 words > >- saves interrupt states and goes to a new interrupt-vector. > >- receives data in 32 word blocks (32x2 bytes) wich are programmed and acked > >for next block. > >- does not reprogram first 256 words or memory as this block can be > >protected by the internal memory fuse. > > What happens if I pull the cable in mid-load? > Will the system recover, or become a "brick" that can only be recovered with a chip programmer? > > You could use LRC, which is simply an addition of all the bytes in the packet, throwing away the overflow, or "add, triple, add" which is used in UPC/EAN barcodes. > Both are very easy to implement, and for short packets, pretty reliable. > > -- > 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 > -- 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