Hardware Counter support

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
Bartelime
Posts: 2
Joined: Sat Jul 30, 2022 8:30 am

Hardware Counter support

Post by Bartelime » Sat Jul 30, 2022 8:36 am

Hi all
The latest doc from the micropython shows the Counter Support for esp32.
https://micropython-tve.readthedocs.io/ ... unter.html

Unfortunately I get an error importing the Counter module. (from machine import Counter)
I have installed latest esp firmware (1.19.1).
I can not figure out why this does not work? Where can I find out from which firmware revision this should be supportet?
As far as I understand I can not manually install this module right?

I appreciate every help
Regards
Bartelime

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Hardware Counter support

Post by Roberthh » Sat Jul 30, 2022 8:45 am

Counter and Encoder are not available in the current firmware. There are several PRs for it since more than a year, but not merged yet. There are so Python modules for that feature available, which may be good for purpose, depending on the frequency range. And it is also very easy to implement it yourself using the pin.irq() method.

Bartelime
Posts: 2
Joined: Sat Jul 30, 2022 8:30 am

Re: Hardware Counter support

Post by Bartelime » Sat Jul 30, 2022 8:04 pm

Hi Roberthh

You are just great! Thanks for your fast response. That helps me a lot. So I will not loose more time in this documented Counter Module.
I will go with the irq variant, like you suggested.

Have a goog time

Regards from Switzerland
Bartelime

Post Reply