Neil: Maybe consider the three resistor divider outside the pcbs on the panel therefore when they are snapped out of the panel the inputs have no input except the sensor.. three resistors should then do the whole panel. Same as a tester I did for ribbon cable years ago shorts are easy to identify and opens as well if you weak pull ups or leds and resistors and low for active. Assuming each led is connected via a res to Vcc then with the exception of the active (low) all lines should read 1 (opens tested)(shorts tested) Duff (short) segments is a little more difficult these need a fixture or observation. Regards, Steve -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of PicDude Sent: 14 June 2007 00:46 To: PIC List Subject: [PIC] Self-testing methods Long-ish post, so here's a summary: how I'm self-testing a PIC circuit now, how else I'll be self-testing, and what/how else can I do more self-testing? For a specific circuit that's in production now, I have a PIC16F913 connected to some discrete and 7-seg LEDs. Considering the most common failures I've had after assembly (solder bridges, bad joints, etc), I've modified the code to run self-tests to quickly identify some of those issues -- IE: on initial power-up, the PIC code sequences thru all LED segments individually, then cumulatively in reverse order. This has worked very well, as specific failure patterns on the display can quickly tell me where the problem should be -- a row, column, blown LED, etc. After the self-test, a value is changed in EEPROM to tell the code not to run those tests ever again. In the next version (very soon), I will have all V+ and Gnd wires on a panel (of 10 units) connected together, so I can run the self-test on all 10 units simultaneously. But I want more ... This circuit also has 2 analog inputs, and an external (to the PIC) voltage reference. I believe I can test the voltage reference by switching that I/O to be a regular analog input and sampling that value vs. the supply voltage, then verifying that it's in a certain range. For the analog inputs, I'm going to setup the panelization so that all inputs are connected together and a single voltage applied to the panel will supply all the analog inputs during testing. For simplicity, I think I should be able to put a 2-resistor voltage divider on each panel (ie: one voltage per panel of 10 circuits) to supply all the analog inputs. Or maybe a 3-resistor voltage divider to supply the 2 analog inputs per circuit with different voltages. This would ensure shorts between the 2 analog pins can be identified. I also have a tact-switch on each circuit, and to test that I'll display a prompt for the operator (me for now) to press the switch to continue. Now the problems... With the visual tests for the LED segments, the operator has to watch the LED's carefully. It takes no more than a minute to run the full sequence, but it adds up to a bunch of time when 500+ of these are assembled. And if I do run the self-test on a full panel of 10 at once, I would need to slow down the test-display sequence so the operator can see it. What I'm wondering is if there is some way to have the PIC check itself for shorts/opens. Shorts should be simple -- the code can toggle the RB3 output for example, and check RB2 and RB4 to ensure that they don't follow RB3. But checking for shorts at other points on the board (where pins are not necessarily adjacent to each other, but may run to PCB traces very close to each other) may be tedious. Is there any clever way to check for opens? Is there any clever way to check if the LED's actually light up (by checking their voltage drop), but keeping in mind that I don't have any spare I/O's. I doubt, but I'll ask anyway since I still periodically get fascinated by some trick I see on here. :-) If there is some way, then the operator won't need to sit thru the self-test, but just wait a few seconds until they see "PASS" on the displays on a panel. Cheers, -Neil. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist