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
pulseio.PulseIn does not work on FeatherS3 #7817
Comments
I don't have a Feather S3, but using CircuitPython 8.0.5 on an Espressif ESP32-S3-DevKitC-1-N8R8 pulsein worked correctly. |
I ran the test code using CP 8.0.5 on an ESP32-S3-DevKitC-1-N8R2 and an Adafruit Feather ESP32 S3 4/2 but didn't get any output. When I ran it on a Pico, it did display output as expected. One possibly related issue I noticed while testing is that after running the test code, if I press ctrl-C to break out of the loop, the board crashes into safe mode if I press ctrl-D. This only seems to happen if I have sent a PWM signal to the receiving pin. If I just start the test program and then break out of it without ever attempting to send a PWM Ctrl-D works fine. |
@DavePutz How are you generating the input signal? I will see if I can reproduce. @RetiredWizard I noticed intermittent restarts on the ESP even if it wasn't detecting anything. Not sure if this is the same cause. |
@jschachter - I am running this script on a Pico using pulseout to generate the signals.
I did also note that breaking out of the receive loop with CTRL-C sent the ESP32S3 into safe mode. I |
I was simply using I'm not sure the S3 results are correct though. The S3 board printed a constant value of 330, while the Pico printed sequences that were somewhat similar to the test signal (65535, 404, 229, 290, 331, 482 was an example of one of the sequences). |
Seems continuous signals are ignored on purpose on
|
I assume this is because an 8.0.5 PR hasn't been moved to the main branch yet, but when I use 8.1.0beta.1 on the S3 boards the receiving program doesn't display any output, switching back to 8.0.5 results in the 330's being displayed again. |
The |
Okay, I'll keep poking at it 😁 |
I think I found the regression in this 1063ec0 merge to main. Specifically, If I undo the following change: void port_background_tick(void) {
} to the current main branch, the S3 board running the test program above displays values of 330 when the test transmit program is run and connected. I'm still concerned that the 330 values aren't correct and the S3 should be displaying a sequence similar to the one that the Pico displays. |
Using @DavePutz's code on a pico, and the following code on the FeatherS3 (running 8.0.4), I get the following response, which matches the last part of the signal.
|
Emulating a servo pwm output, on the pico and reading the input with the code above yields no output.
Code on the ESP32S3:
|
I'm not sure why, but this script shows all the incoming pulse values, not just the last 2:
The only differences are the addition of maxlen and idle_state on the PulseIn init line. |
@DavePutz idle_state is unneeded, and maxlen defaults to 2, thus getting the two measurements. |
Looks like the pwm not showing results is due to this line in Espressif common-hal/pulseio/PulseIn.c: |
@DavePutz fwiw default is 12000 in https://github.com/espressif/esp-idf/blob/c9646ff0beffc86d2c6d1bfbad34da16e328e0e3/components/driver/include/driver/rmt.h#L126 i'm not sure that's the issue, though. two pulses with a similar frequency were picked up. was using 50Hz as the frequency above. |
Re-closing due to accidental re-open |
@jschachter did you delete your remark that it wasn't working? |
Yes, I should not have replied.
…On Mon, Apr 10, 2023 at 8:39 AM Dan Halbert ***@***.***> wrote:
@jschachter <https://github.com/jschachter> did you delete your remark
that it wasn't working?
—
Reply to this email directly, view it on GitHub
<#7817 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEXFUUEG7MEQC2LXCUIYTXAQSUHANCNFSM6AAAAAAWMRAGJQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
CircuitPython version
Code/REPL
Behavior
No output.
Description
Connected a RC receiver outputting PWM (3.3 volt output, I checked w/ scope).
The same code does output a series of numbers on a Raspi Pico.
Also discussed here: https://forums.adafruit.com/viewtopic.php?p=966813
Additional information
No response
The text was updated successfully, but these errors were encountered: