Teensy 4.1 PWM on D13 Invalid

Status
Not open for further replies.

mstopps

New member
I'm having problems with using Pulseio with the Teensy 4.1. For example, D13 (LED) to my knowledge is a PWM capable pin, however on use it errors: Invalid pin.

Adafruit CircuitPython 6.0.0-alpha.1 on 2020-07-03; Teensy 4.1 with IMXRT1062DVJ6A
>>> import board
>>> import pulseio
>>> led = pulseio.PWMOut(board.D13)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid pin
 
It definitely works in Arduino. Maybe this is a limitation or bug in Circuit Python?

Some of the Teensy 4.1 pins use "FlexPWM" timers and others use "QuadTimer" hardware. Details here: (scroll down to "PWM Frequency")

https://www.pjrc.com/teensy/td_pulse.html

Pin 13 is controlled by QuadTimer2.0. Maybe try some of the other pins controlled by QuadTimer timers. If all of those fail, but the others work, I'd guess Circuit Python may only support the FlexPWM hardware.
 
Teensy 4.0 PWM and analogio

I'm new here, but started with Arduino years ago, then changed to teensy, because found them really awesome! Then three years ago we changed completely to ESP with micropython. A few days ago I received the new awesome t4.0 and t4.1 boards for testing with circuitpython. At the moment we only test for possible future implementation in our robot controllers. We for this need the network library on 4.1 for mqtt messaging.
We now wanted to test PWM, we found your note on the FlexPWM and used a FlexPWM pin. Code is working but no PWM signal on the pin!!!
Further we wanted to test analogOut. analogio library is loaded but getting error "Function not supported" for analogOut!

Is there any online documentation to find out what is supported on t4 and t4.1 by circuitpython?
 
I'm new here, but started with Arduino years ago, then changed to teensy, because found them really awesome! Then three years ago we changed completely to ESP with micropython. A few days ago I received the new awesome t4.0 and t4.1 boards for testing with circuitpython. At the moment we only test for possible future implementation in our robot controllers. We for this need the network library on 4.1 for mqtt messaging.
We now wanted to test PWM, we found your note on the FlexPWM and used a FlexPWM pin. Code is working but no PWM signal on the pin!!!
Further we wanted to test analogOut. analogio library is loaded but getting error "Function not supported" for analogOut!

Is there any online documentation to find out what is supported on t4 and t4.1 by circuitpython?

Generally, we add functionality at the module boundary and the circuitpython.org page lists the available modules under the version: https://circuitpython.org/board/teensy40/

Unfortunately, `analogio` is in an in-between state because AnalogIn is implemented but AnalogOut isn't. The best way to see this is the source: https://github.com/adafruit/circuitpython/blob/main/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c The naming of the implementation is regular, `common-hal/<module>/<class>.c`, so it's not too bad to investigate.

Following the open issues can also give an idea of what is left: https://github.com/adafruit/circuitpython/issues?q=is:open+is:issue+label:mimxrt10xx

No one is actively working on the iMX RT port at the moment so these won't be added any time soon.
 
Status
Not open for further replies.
Back
Top