Shop Learn P1 Docs P2 Docs
Reciprocal Counter Demo - Page 5 — Parallax Forums

Reciprocal Counter Demo

1235»

Comments

  • jmgjmg Posts: 14,963

    @Ramon said:
    I don't want to save any wire. The wire is a requirement, to be able to test the pins output and input.

    Yes, a wire is useful for complete connection testing, but you can also use internal loopback if you wanted to do a simpler self-test at startup (no user intervention needed).

    Is it possible to generate a test frequency and calculate its frequency, with just two pins?

    The code above gives a Reciprocal Frequency Counter, so it captures both Whole window Periods and time for those periods.
    It uses 2 smart pin cells, but does not fully consume the second pin, it can still be used for general SW IO tasks

    Then Cycles/Time gives frequency, and has a very wide dynamic range. eg The numbers you gave in #97, show a LSB of 0.4ppm

    If you can accept lower dynamic range (do not need to precise measure 1kHz to 100MHz) then you could configure for a simpler, non reciprocal fixed time gate, and count cycles on a single pin cell.
    eg a 100ms time gate, with 1KHz in, counts 99 or 100 or 101, so only has 1% precision, but at 5MHz it is 2ppm. ( not nearly as good as the reciprocal counter, but may be ok )

  • evanhevanh Posts: 13,574

    @jmg said:

    @Ramon said:
    I don't want to save any wire. The wire is a requirement, to be able to test the pins output and input.

    Yes, a wire is useful for complete connection testing, but you can also use internal loopback if you wanted to do a simpler self-test at startup (no user intervention needed).

    I don't think the external wire has any use.

  • jmgjmg Posts: 14,963

    @evanh said:

    @jmg said:

    @Ramon said:
    I don't want to save any wire. The wire is a requirement, to be able to test the pins output and input.

    Yes, a wire is useful for complete connection testing, but you can also use internal loopback if you wanted to do a simpler self-test at startup (no user intervention needed).

    I don't think the external wire has any use.

    It does if someone wants to check 100% the PCB wiring and pin soldering, which is why I suspect it is stated as being 'a requirement'
    Self-test internal loopback is ok, but it only reaches so far.

  • evanhevanh Posts: 13,574
    edited 2021-04-09 01:52

    That's not testing the chip any longer is it.

    You'd also want to load up the pins for solder testing. Make sure there's no parasitics making the test pass when it should fail.

    And then put the whole board in a test jig as well.

  • evanhevanh Posts: 13,574
    edited 2021-04-09 02:09

    Frequency response of the different drive strengths could be used for board level pass/fail, still without any external loop-backs. An advantage available due to every I/O pin capable of simultaneous output and input, including threshold setting and DAC/ADC options.

  • Exactly what jmg said. The wire is the load. Otherwise you are just testing until the I/O die pad, right?

    Variable frequency output/input response plot. Better than just pass/fail test (like a Shmoo plot, maybe?)

  • AribaAriba Posts: 2,591

    @evanh said:
    I don't think the external wire has any use.

    You can use the same wire to measure the frequency of the the source with unknown frequency, for which you have made this whole frequncy counter ;-)
    There is a world outside the P2 in that you can do practical things...

    Andy

  • evanhevanh Posts: 13,574

    Lol, now you've completely change the subject. The "wire" was only a link between two pins that Ramon wanted for checking I/O function. Now it's a dangly antennae with a kitchen attached. :)

  • evanhevanh Posts: 13,574

    @Ramon said:
    Variable frequency output/input response plot. Better than just pass/fail test (like a Shmoo plot, maybe?)

    In terms of board testing, that can be done without any external loopback.

  • @evanh said:

    @Ramon said:
    Variable frequency output/input response plot. Better than just pass/fail test (like a Shmoo plot, maybe?)

    In terms of board testing, that can be done without any external loopback.

    I don't think so. Based on my limited but previous experience doing exactly that kind of testing for telco equipment.

    The main question is: where is your loopback? My guess is that you are just testing the I/O pad, with some extra 'antenna' wire attached to it. So in case that you wanted to test the board, your not testing it. Imagine that some chip packaging machine gets crazy and bonds all your pads (except power, xtal, and uart 62/63) to wood pins instead of metal ones (how crazy, right? It's just some example) and because you are shorting the pins at I/O pad level it will show PASS.

  • evanhevanh Posts: 13,574

    When it comes to frequency response, there is an expected ideal for a given layout. Each I/O pin can be mapped with a unique signature from a selection of drive strengths. When testing, the further away from that ideal the more likely you've got a problem with the soldering.

    With the Prop2, the input of each pin can monitor that response while the output is driving it with varying strengths. It's a huge advantage that every pin has the full set of I/O resources to select from. You couldn't do this with just any chip.

  • evanhevanh Posts: 13,574
    edited 2021-04-10 02:10

    On the very left of that block diagram earlier you can see how there is four blocks all connected to the physical pin - https://forums.parallax.com/discussion/comment/1521778/#Comment_1521778
    It is simplified but still accurately depicting the way each I/O pin is wired internally. The input circuits are always active irrespective of if an output circuit is driving the pin.

    DAC outputs are settable to strengths of 75 ohms to 990 ohms, while logic outputs are settable to strengths of 20 ohms to 150 kohms. Inputs can be simple 50% threshold logic, or 1 volt hysteresis Schmitt Trigger, or comparator threshold, or even using the ADC.

    Performance of the output is affected by what's connected externally and how hard it's being driven. The input circuits can monitor that performance. And can do it in multiple ways in parallel thanks to the %AAAA and %BBBB input selectors.

    EDIT: Typo correction

  • evanhevanh Posts: 13,574
    edited 2021-04-10 01:49

    @evanh said:
    It is simplified but still accurately depicting the way each I/O pin is wired internally. The input circuits are always active irrespective of if an output circuit is driving the pin.

    I've noticed there is a 600 ohm resistor in the schematics that could be added to the block diagram. It's inline from the physical pin to the logic/compare/schmitt input circuits. But not for the ADC interestingly. EDIT: Ah, that's because the ADC has it's own input resistors.

  • @cgracey

    Howdy,
    I tried the rcd when you first posted it. I have been out of the loop for almost two years.
    Tried it again in Pnut and Prop tool. Getting nothing at the
    baud = 1_000_000.0 'serial baud rate on P62 (float)
    Is there something I am missing?
    Thanks in advance.
    Martin

  • evanhevanh Posts: 13,574

    It doesn't print anything until the measurement pin is toggling. Wipe pin P0 with your finger.

  • @evanh

    Thanks.
    Got it working, forgot about the finger triggering the code.

Sign In or Register to comment.