Nice Sergio, but I don't use optimizing compilers and I don't use basic... I write in asm. Besides... No fun in using someone elses loader :) I wanna make it myself. (But... moooom, I wanna, I wanna, I wanna LOL) Thanks for the info though. Kyrre ----- Original Message ----- From: "Sergio Masci" To: Sent: Wednesday, June 23, 2004 1:11 AM Subject: Re: [PIC]: Self-programming via rs232 of the 16F88 ? > ----- Original Message ----- > From: Kyrre Aalerud > To: > Sent: Tuesday, June 22, 2004 11:47 PM > Subject: Re: [PIC]: Self-programming via rs232 of the 16F88 ? > > > > I was planning on using a different approach actually. > > Programming the flash would be a password-protected option in the regular > > rs232 comm dialog. > > There would not be a bootloader of such. The loader function will be at the > > very last block of memory (small loader I > > will write myself...) and the only thing that will be done is dump the > > incoming data onto the program memory up to the point of the loader. > > > > I realize now that this method could cause the program to be corrupted and > > thus, I would not have any means of entering the loader again... > > I would need a short loader init or something that would not be reprogrammed > > so that I would have a way of entering rs232 programming at startup. I > > guess waiting a timeout value for a character on the rs232 would be > > suffichient... Maby as simple as the character F for "flash"... If it is > > received upon powerup, go directly to the flash routine and ask for a > > password before beginning flash programming. Only programming and > > verifcation would be needed I think. No need to add advanced stuff like > > crc's and stuff. > > > > Hmm... Reset is at 0000 as usual and interrupt is at 0004. To have the > > most effichient interrupt routine I would like to stay clear of that area. > > It does seem however that I can protect the first memory page from ever > > being written internally and that is the smallest block I can protect like > > that. It will allow me to reprogram the rest of the memory even with the > > entire chip code protected, but I will have to select a new interrupt > > vector. This means I will also have to include the context-saving in the > > protected section to be sure I save the right data. > > > > Hmm, this will be fun!!! > > > > > > Kyrre > > The XCSB pro compiler comes with a bootloader (including source) for the 88. > > Regards > Sergio Masci > > http://www.xcprod.com/titan/XCSB - optimising PIC compiler > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.