Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FrequencyIO in CircuitPython 8.2.x always returns '0'. #8653

Open
cormalenv opened this issue Nov 23, 2023 · 2 comments
Open

FrequencyIO in CircuitPython 8.2.x always returns '0'. #8653

cormalenv opened this issue Nov 23, 2023 · 2 comments
Labels
bug circuitpython api espressif applies to multiple Espressif chips needs retest
Milestone

Comments

@cormalenv
Copy link

cormalenv commented Nov 23, 2023

CircuitPython version

Adafruit CircuitPython 8.2.8 on 2023-11-16; Bee-Data-Logger with ESP32S3
Board ID:smartbeedesigns_bee_data_logger

Adafruit CircuitPython 8.2.0-rc.0 on 2023-06-23; Bee-Data-Logger with ESP32S3
Board ID:smartbeedesigns_bee_data_logger

Adafruit CircuitPython 8.2.8 on 2023-11-16; ESP32 Devkit V1 with ESP32
Board ID:doit_esp32_devkit_v1

Code/REPL

import frequencyio, board, time

frequency = frequencyio.FrequencyIn(board.D41)

while True:
    print(frequency.value)
    frequency.clear()
    time.sleep(1)

Behavior

Frequency returns as '0' when 71 kHz square wave applied.

Serial output in CircuitPython 8.2.0 and 8.2.8 on all boards tested.:

0
0
0
0
...

Description

Signal generated by external sensor (Vmin 97 mV - Vmax 3.2 V, 71 kHz square wave as below) to digital pin. FrequencyIO returns '0' in all scenarios.

Additional information

Debugging:

  1. tested on multiple Esp32S3 and ESP32 Dev Kit v1 - FAIL
  2. Switched GPIOs - FAIL
  3. Boards were reset and firmware reflashed - FAIL
  4. Tested GPIO digital function via keypad lib (below) - PASS
import board,keypad,time

while True:
    with keypad.Keys((board.D41,), value_when_pressed=False) as keys:
        event = keys.events.get()
        if event:
            if event.pressed:
                print("pressed")

>> pressed
>> pressed
...

Frequency input signal

Screenshot 2023-11-23 154252

@cormalenv cormalenv added the bug label Nov 23, 2023
@cormalenv cormalenv changed the title FrequencyIO on CircuitPython 8.2.x only returns 0. FrequencyIO in CircuitPython 8.2.x always returns '0'. Nov 23, 2023
@tannewt tannewt added circuitpython api espressif applies to multiple Espressif chips labels Nov 27, 2023
@tannewt tannewt added this to the Long term milestone Nov 27, 2023
@tannewt
Copy link
Member

tannewt commented Nov 27, 2023

Please test with an "Absolute Latest" build. This has updates to the ESP IDF that might fix this.

@cormalenv
Copy link
Author

cormalenv commented Nov 27, 2023

Thanks Scott (@tannewt ),

Adafruit CircuitPython 9.0.0-alpha.5 on 2023-11-15; Bee-Data-Logger with ESP32S3
Board ID:smartbeedesigns_bee_data_logger

No luck. Same result using the above example code. Repeatedly returns '0'

For reference

Screenshot 2023-11-28 102929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug circuitpython api espressif applies to multiple Espressif chips needs retest
Projects
None yet
Development

No branches or pull requests

3 participants