Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Software to debug teensy hardware

Threaded View

  1. #1
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    644

    Software to debug teensy hardware

    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 by jonr; 08-02-2020 at 08:28 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •