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

Thread: Odd digitalread problem

  1. #1

    Odd digitalread problem

    I'm digitally sampling a pin @80khz. The readings are coming back all zero and they should not. I am measuring the pin with a scope and it shows the square wave I am expecting with 3.3v max. If I short the input pin to the 3.3V pin on the Teensy, the readings come back as all '1's. I also drove it with a square wave generated by the teensy and it seemed to read the pin just fine. It only seems to be failing when its driven by my existing circuit, even when the voltage levels observed at the pin are 3.3v.

    Can it be possible that my circuit is not supplying enough current or some such? Are there specs on this?

  2. #2
    Senior Member
    Join Date
    Aug 2019
    Location
    southwest USA
    Posts
    117
    if your generator is 0 to 3.3 no load and 0 to 3.3 when hooked to teensy then current load is not a player.
    have you looked at the gen both before and after connection to teensy? also - just be be safe set gen
    to do 0.25 to 3.0 v so that even with some measurement error you are not driving the input past 0 and 3.3.
    which teensy?

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,501
    Check the ground wire between your external circuit and Teensy's GND.

    These sorts of ground problems can be particularly frustrating when using grounded test equipment like an oscilloscope. Teensy gets an earth ground connection via the scope probe ground and things work and everything appears to be correcnt, but then you remove the test gear and suddenly nothing works.

  4. #4
    This was actually a miracle of bad sampling. My diagnostic output perfectly jumped in the troughs of the square wave I was sampling and falsely output zero the whole time.

  5. #5
    Senior Member
    Join Date
    Aug 2019
    Location
    southwest USA
    Posts
    117
    maybe not a miracle - Murphy never sleeps

Posting Permissions

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