James, I am not going to try to change your mind about having a way to change the train id. And (this may sound cold) I am not interested in debatting your reasons for you wanting this ability. So the following information is for thoses that are faced with a simular problem. Software and hardware only does three things. It works, it doesn't work, or it does something unexpected. Once it works, it will never get any better, it can only stop working or give unexpected results. So by NOT installing pieces of hardware or software, it will NEVER go bad. Clive Sinclare had a way of designing things. He designed the little Z80 computer that sold for $100 while the rest of the industry was charging $2,000 for their computers. Any way, his way was to design the thing and get it working. Then he would start pulling out parts until it stopped working. After putting that part back in, he would continue by pulling out other parts. By not putting something into the mix, there is no need to pull it out later. And after the thing works, you will see things that are not necessary or that can be done a simpler and better way. But one has to be carefull that the hardware and software is designed so that possible features can be added easily. The question "Why can't we...?" can become a command from hell if one does not keep a eye on the future. While trying not to be negative about the ideas that have been sugested, and the one you have selected, I am going to describe some of the difficulties you may expierence with this method. It requires software and hardware. The software for setting the id on pic reset and on "track data grounded" Also you mentioned having the pic use one of the pins (normally a output for a light) to send its current id serially. This is not trival software. The hardware, while simple, will require board space and will require adjustment at some point after it is set and painted shocking pink. This adhustment may not be necessary for a day or thirty years, but it can't get any better, it can only go bad. You describe the method for setting the id. It looks like this would involve removing the train from the track. dissasembly so you can get to the board, and hooking the PC serial line to a pin. And then setting the id. If there is any question about a train's id, as when things don't work like you thank they should, the same procedure will be necessary to confirm the id of one or more trains. While I do not know your reason for wanting to assign a specific id to a specific train, one reason may be to have the id's reflect the engine type, number or line. All good reasons. Keeping this in mind, I make a suggestion. As you add controls to the trains, program each pic with a unique ADDRESS. Please notice I said ADDRESS. Then in the PC control program, have a routine that will assign a specific train id to a specific pic ADDRESS. Now here comes something that is a little off topic but is important. As people we number things starting with 1 and go to n. 1, 2, 3....n Computers number things starting with zero, and go to n-1 0, 1, 2....n-1 When the first person thing is refered to as #1 and the computer knows it as unit 0, confusion, the people kind, will occure. So either use the same numbers as the computer uses, and you don't have to use number zero, or use some completly different method of refering to the people things. Such as bird names robin, red bird, wren ...... owl It seems like for trains it would be approate to refer to them using their engine number. And let the big, all powerful and knowing Personal Computer translate between the engine number (id) and the pic ADDRESS. Submitted for your viewing pleasure, Bill C. bill@cornutt.com >For the locomotive model driver chip, I'd use a trim-pot. A multi-turn >pot would be good. Using the presumably 5v regulated supply on the >circuit would be the most stable, without having to add a voltage >reference. I'd run the A/D in the way you described, and have it read >at two times; > >1) at reset, >2) on seeing a continually grounded track data input line. > >While the track data is grounded, I would have the chip read the value, >then convert it to RS-232 serial 2400 baud and emit it on one of the >pins used for controlling the locomotive lights. Continually. > >So the procedure for setting the identification becomes; > >a) ground the track data input line, >b) connect a PC to the RS-232 serial output, >c) apply power to the chip, >d) watching the ID displayed on the PC, adjust the trim-pot to be > midway between the thresholds of the desired ID, >e) apply significant other's nail polish to trim-pot. > >Some temperature stablisation may be required. ;-}