Hi,

Just wondering if anyone has any experience or thoughts on setting the ID of a PIC by using the ADC and a resistor network, and mapping the value to an ID on startup. I would like to be able to use an 8-pin chip in a project where I have about 30 devices on a common serial line, but will only have a single free pin. I am aware that the maximum impedance recommended by the datasheet is 10 kOhm and the ADC is 10-bit. I believe the 1% tolerance resistors come in frequent values, hence my thought was something along the lines of a 1k pull up resistor, and using values spaced from 0 to 9k between the pin and ground, thus producing a range of voltages between 0 and 4.5V (5V supply).. Naturally the ADC value will not be exact (nor will resistor voltages), but if I aimed for 50 devices, by my calculations that would leave me +/- 9 ADC values before reading the wrong ID. Is this too small? This is also assuming I can find a perfectly spaced range of resistor values. Space and cost are crucial, hence the choice of small and cheap resistors. Doable?

Daniel