Tjaart van der Walt wrote: > > Gerhard Fiedler wrote: > > > > I wanted to put my _own_ data in OTP EPROM locations (no reset vectors, no > > chip configurations or whatever) -- but data I only know after having > > loaded the PIC with some program to get me this data. That's why I'd have > > to do this in a second programming run. Tjaart confirmed that it might work > > as intended. > > > > But probably I won't check it really out, because some further > > investigation led me to believe that I need more than 8bit ADC resolution, > > so I'll use a 16f84 (with a LTC1288 ADC) instead of the intended 16c711 -- > > and then I have an on-chip EEPROM. > > > > (But still I think this is something useful and that I'll use it sooner or > > later; often you have to calibrate an ADC or DAC, but you just do it > > _once_, so that the results can very good be stored in OTP memory. And if > > you have a little spare room for the routine in your program space, that's > Here's another one :) We are going to write serial numbers in all the > PICs we > program. Because Mchip won't let us read the chip ID from within the PIC > software, we decided to do it in the ROM. In the software, there is a > lookup > table filled with retlw FFs (unprogrammed) During the manufacturing > process, the > serial number is written in this space as a set number of retlw > instructions. The > PIC can read this and we can identify each individual chip made by us. > I need to do a similar thing. Although I want my serial bumber to be a 16 bit random number. As I'm using 16C84s, I going to put it in EEPROM. I plan to use another 84 that will work as a random number generator, using its own EEPROM to store that last value to use as the seed for the next value. This PIC will "talk" to the target 84 via the 2 lines that are used for dip switches in the final product. one for the clock, and one for the data. It works like this. the 84 is programmed with the application, in circuit. Then, the circuit is connected to my serial number programmer. The randon serial number is then passed accross and stored in as EEPROM data. This way I don't need to program every board with a different program. -- _______________________________________________________________________ Peter Homann email: peterh@adacel.com.au Work : +61 3 9596-2991 Adacel Pty Ltd Fax : +61 3 9596-2960 250 Bay St, Brighton 3186, VIC, AUSTRALIA Mobile : 014 025-925