pic wrote: > Yes, I want to integrate the programming function into another > application. > > We have a range of wireless products that control remote equipment. > > Our main application sets up the wireless devices and provides control > functionality > via software on a PC. > > Many of our devices have serial ports so we use a Bootloader for > programming these. > For those devices without a serial port, we want to supply a ICSP > programming function > that can be run within our main software. There are ways of achieving this without writing all the software yourself. The easiest way is to run the command line programming program from within your app. You can capture standard output if you wish. The important thing is to check the exit status code of the programming program. For example, PIC_PROG (the programming program for the Embed Inc PIC programmers) returns a 0 exit status when it was successful, and something non-zero on error. I've had customers encapsulate PIC_PROG into larger production test applications running in LabView. If you really want tighter integration, your app can call a programmer library if such a thing exists for your programmer. This is the PICPRG library in the case of our programmers. You will have to combine multiple lower level calls to program a whole PIC, but at least you don't have to re-create all the protocol handshaking details. Details of the PIC_PROG program and some information on the PICPRG library are available at http://www.embedinc.com/picprg/sw.htm. Another thing to consider is designing the circuit for ICSP. No programmer can handle all target circuits. There are a few things you can do to make ICSP possible that are usually easy if considered as part of the design. It may not be so easy to add on later. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist