I design/build custom circuits, some use teensy modules and some are custom designs based on the same MCU/bootloader. Not surprisingly, there can be yield issues and a few don't work. So I'm looking for quick ways to find the problem. I understand that a JTAG boundary scan is the standard, but with teensy modules, this isn't an option (no JTAG access). So I started looking for something similar. I found that I can tell a lot about what is or isn't connected to a pin by looking at how long it takes to change state. For example, running this code and comparing to a known good circuit will tell me that a pin is/isn't connected to something (even a trace). Also useful to know is if a pin wont pull up or down over any time period. Any thoughts? Other quick ways to find problems (usually soldering)?
Code:
int x[100];
pinMode(i, INPUT_PULLUP);
delay(20);
int j = 0;
pinMode(i, INPUT_PULLDOWN);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
x[j++] = digitalReadFast(i);
for (j = 0; j < 20; ++j) {
if (x[j] == 0) {
Serial.printf(" %d ",j); // how long to change state
break;
}
}
Last edited: