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

    Support for Pulse Counter

    Scheduled Pinned Locked Moved Enhancements
    pulse counter
    6 Posts 3 Posters 3.2k Views 4 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.
    • E Offline
      Eric24
      last edited by

      Is support for the ESP32's built-in pulse counter (and specifically for counting pulses in deep-sleep mode) on the schedule?

      1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino
        last edited by

        The Pulse counter is not available in deep sleep mode. You can however count pulses via the ULP and GPIO, but those are two very different implementations.

        E 1 Reply Last reply Reply Quote 0
        • E Offline
          Eric24 @jmarcelino
          last edited by

          @jmarcelino I see. I was not able to find much information (in the ESP32 docs) about the pulse counter. I had assumed it used the ULP, but you're saying there's a different way to count pulses using the ULP (and not using the built-in pulse counter, if I need to do this in deep-sleep mode)? That's fine, but I guess that means that this item is waiting on ULP support, too.

          What I'm needing to do is count pulses from a water flow meter while sleeping, then wake up periodically and get the read the count. Any thoughts on how to do that without ULP support?

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @Eric24
            last edited by jmarcelino

            @Eric24

            The best information are the examples in ESP-IDF:

            ULP Pulse Counting Example

            Example: pcnt peripheral

            As you can see very different things. Also ULP requires special assembly code, so I'm not sure how or when this will work in Python.

            How about an external counter chip like the SN74LV8154 ?
            That only requires about 20 μA active and 5 with the output off.
            For more flexibility you can also use a small ultra low power microcontroller...

            E John BairdJ 2 Replies Last reply Reply Quote 1
            • E Offline
              Eric24 @jmarcelino
              last edited by

              @jmarcelino Yep, I'm currently using an NXP PCF8593, which draws less than 8μA in counter mode and an I2C interface. I was just trying to see how much of the ESP32 I could use and how many external components I could eliminate. For now, this sounds like something for a future PCB revision.

              1 Reply Last reply Reply Quote 0
              • John BairdJ Offline
                John Baird @jmarcelino
                last edited by

                @jmarcelino Is it still the case that we cannot access the counter through Python? Or has a driver been written? I'm looking to monitor a system fan, but with as little overhead as possible. If I count the fan tachometer output and check it every so often, I should get a good idea of how it's going. The system is busy, so I don't want lots of interrupts happening and was hoping to take care of this in the already available hardware.

                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