James Cameron wrote: > How feasible is it to adjust code in an OTP chip? > > For example, I've made a mistake on a 12C509 OTP, in that a BTFSS > should be a BTFSC instead. Rather than chuck the chip, how do I just > fix that instruction? > > The bit change is from a one to a zero. > > 0111bbbfffffff BTFSS > 0110bbbfffffff BTFSC > > Do just I code up an assembly file with an "ORG" at that point, with the > BTFSC instruction, and then attempt to program it? > > I should I take the whole file, make the small change, and then assemble > and program it? > > What do people do? Panic! ;) Seriously, you can do it in one of two ways : 1) Write your major routines in sections. Have a look-up table with pointers to the addresses of these routines. In your look-up routine, you check for h0000's. If you get a h0000, you go to the next table entry. To make a change, you append the new routine to the end of your program. The current table entry is programmed to h0000, and the next one is programmed to contain the address of the new routine. 2) If you want to change a bit from '1' to '0', you can. You can't change a bit from '0' to '1' though. -- Friendly Regards Tjaart van der Walt mailto:tjaart@wasp.co.za |--------------------------------------------------| | WASP International | |R&D Engineer : GSM peripheral services development| |--------------------------------------------------| |SMS mailto: tjaart@sms.wasp.co.za (160 chars max)| | http://www.wasp.co.za/~tjaart/index.html | |Voice: +27-(0)11-622-8686 Fax: +27-(0)11-622-8973| | WGS-84 : 26¡10.52'S 28¡06.19'E | |--------------------------------------------------|