On 7/9/07, Jeff Anno wrote: > Hi pic-listers, > > I have an interesting programming problem. I have a sensor that has 4 > pins available to the outside world (+24 V, 24 Common, + analog out > (4-20 ma or 0-10V), -analog out (not always used). Sometimes this is > configured a 3-wire transducer and sometimes it is a 4-wire transducer > (but 4 pins will always be present). I am planning on using a > pic16F677 (small 4x4x0.9 mm Body [QFN]). What I am trying to do is > come up with a way to program the micro when it is enclosed in its > final package (using only the 4 pins described above). I think it is > possible by using negative voltages and some diodes. My brain won't > let me see a clear solution. Please help my poor, tired brain. > This is common in the sensor world. Typically you will need a bootloader. Circuits converting the voltage level (transistors will do) will be necessary. I saw many optical proximity switches employ this scheme. In fact there are a standardization going on by companies like Siemens/SICK/etc. For analog output transmitter, maybe you need to take extra care not to causing errors (eg: leakage current) depending on the accuracy. By the way, 16F877 is not for new design. You can use 16F876A or some other new PICs. Xiaofan -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist