Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Deepsleep Pin Interrupt now working on newer firmware versions

    Scheduled Pinned Locked Moved Issues & Bugs
    6 Posts 2 Posters 54 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      MichaelWojcik
      last edited by

      Hello,

      I have set up a pin interrupt, but I have found that on versions newer than: pybytes 1.6.0 and pycom micropython 1.20.2.r1 the interrupt will not trigger.

      I am using a Pytrack 1 and Lopy 4.

      here is the code.

      from pytrack import Pytrack
      import pycom,time
      
      pycom.heartbeat(False)
      pycom.rgbled(0x040400)
      time.sleep(2)
      
      pt = Pytrack()
      
      
      #go to sleep
      pt.setup_int_pin_wake_up(True)
      
      pt.setup_sleep(1000)
      pt.go_to_sleep(gps=False)
      
      

      I have the sensor externally pulled down with a 10k resistor to make sure it triggers.

      The sensor being used here is a SparkFun OpenPIR sensor.

      Has anyone else had a similar problem? Is there a way to fix this so that it works with newer firmware?

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        MichaelWojcik @MichaelWojcik
        last edited by

        EDIT: I know that at the very least the interupt does attempt to wake the chip from deepsleep, as it starts to resume its normal power draw. However, it does not appear to run any of the code. My guess is the chip is browning out for some reason.

        I have disabled LTE, Wifi, and Smart Provisioning on Boot, so I am not entirely sure what else the issue could be.

        Any Ideas?

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          jcaron @MichaelWojcik
          last edited by

          @MichaelWojcik how are you powering the device? A battery or an external power supply?

          M 1 Reply Last reply Reply Quote 0
          • M Offline
            MichaelWojcik @jcaron
            last edited by MichaelWojcik

            @jcaron said in Deepsleep Pin Interrupt now working on newer firmware versions:

            supply?

            I have tried using both to the same result.

            The batteries I have are standard 3.7V 2000mAh E&J 674361P Batteries.

            The power supply/battery simulator that I also have been using is a Techtronix 2281S-20-6 Precision DC Supply & Battery Simulator.

            M 1 Reply Last reply Reply Quote 0
            • M Offline
              MichaelWojcik @MichaelWojcik
              last edited by

              @MichaelWojcik After doing more testing, the issue seems to be time-based. On the firmware versions that work, it seems that you need to wait at least 30 seconds before triggering the interrupt or you run into the same issue. The module spikes to 65mA at fairly consistent intervals after it fails, so it seems that the chip is somehow not initializing properly.

              1 Reply Last reply Reply Quote 0
              • M Offline
                MichaelWojcik
                last edited by

                So it looks like the issue has something to do with the pin being pulled high for too long. If I let the signal stay high while it is booting up, the chip will not run any code. It seems like the easiest solution to this problem is to have the interrupt trigger low side after the interrupt signal is over, or have a signal inverter between your interrupt and the pin.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom