We recommend using the approach described in our In-System-Programming Application Note.