On Sat, 18 Oct 1997 15:17:59 -0700, you wrote: >I would like to design my projects/products so the ubiquitous ON indicator >LED is serving the secondary purpose of sending debug info serially, to a >phototransistor or some such which I have placed over it. This would be >useful for development, but also for periodic sample testing of production >devices, don't you think? > >I've found that spacing out the bytes, and sending at reasonably high data >rates results in a visibly steady LED glow (comm feature transparent). My >problem is that I can't find phototransistors fast enough to switch fully >on and off with so little illumination (a few mA through a standard >brightness LED). > >Yet it seems to me that this SHOULD work. How about you smart folks who >have done this kind of thing a million times giving me the benefit of your >wisdom? > >Bruce Cannon Always use a red LED - phototransistors have poor response to anything else. Use a low-value pullup on the p/trans (10K or less). Consider using a protocol other than RS232, as unpredictable coupling can alter pulse width, and rise/fall times will usually not be the same. Consider using a high-frequency carrier (20-40KHz) and send bursts of it with different lengths for '1' and '0' bits - this is what IR remote control chips do. This makes it easier to reject ambient light and noise - you can use an IR pre-amp chip to demodulate it. For short-distances (<10mm), you shouldn't need to go to these lengths - a 10K pullup with the right photodiode gives a good 5V signal which should manage a few KBits/sec. A 2-way link can also be done in this way for lid-on calibration - the LED sends a timing reference pulse, and the test jig wiggles the supply voltage (or some other accessible line)slightly within defined timeslots, which is read by the on-Pic ADC Most importantly, though USE A RED LED!!!