Help with identifying usable PWM pins on Metro M4 airlift

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
RumiTheIsotope
 
Posts: 43
Joined: Mon Jan 13, 2020 7:59 pm

Help with identifying usable PWM pins on Metro M4 airlift

Post by RumiTheIsotope »

Hello,

I am using CircuitPython 8 on a Metro M4 airlift lite. I have a project that requires as many PWM outputs as I can muster up. These will be driving LEDs.

Using the sample code for identifying PWM outputs (found at the bottom of https://learn.adafruit.com/circuitpytho ... python-pwm) I get the following output - which is pasted at the end of this post. According to the list, there are up to 25 pins identified as having PWM output. However, as I have been trying to work through them, I have come up with the following problems:

#1. If I try to assign PWM to pin 13 such as the following:

Code: Select all

testPWM = pwmio.PWMOut(board.D13, frequency=100, duty_cycle=0)
Then I receive the error "ValueError: All timers for this pin are in use." I am assuming that this is related to the fact that D13 is also connected to the red LED. Is there any way to fix this?


#2. For pins MOSI/MISO/SCK, the notes on https://learn.adafruit.com/adafruit-met ... /pinouts-2 state "These are also used by the ESP32 so they should not be used for anything but SPI connectivity - not for GPIO." Does that mean that I can assign PWM to these pins anyway if I am not using the airlift thingy? Do I need to include some code to disable the ESP32 first?


#3. PWM on RX and TX: Is this just referring back to to pins D0 and D1?


#4. PWM on ESP_RX, ESP_CX: I don't see how these would be accessible as there is no physical pin for them.


Thank you for reading! I greatly appreciate this forum for all of its help! I know very little...


No PWM on: A0
PWM on: A1
No PWM on: A2
No PWM on: A3
No PWM on: A4
PWM on: A5
PWM on: D0
PWM on: D1
PWM on: D10
PWM on: D11
PWM on: D12
PWM on: D13
PWM on: D2
PWM on: D3
PWM on: D4
PWM on: D5
PWM on: D6
PWM on: D7
PWM on: D8
PWM on: D9
No PWM on: ESP_BUSY
PWM on: ESP_CS
No PWM on: ESP_GPIO0
No PWM on: ESP_RESET
No PWM on: ESP_RTS
PWM on: ESP_RX
No PWM on: ESP_TX
PWM on: LED
No PWM on: LED_RX
No PWM on: LED_TX
PWM on: MISO
PWM on: MOSI
No PWM on: NEOPIXEL
PWM on: RX
PWM on: SCK
No PWM on: SCL
PWM on: SDA
PWM on: TX

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Help with identifying usable PWM pins on Metro M4 airlift

Post by dastels »

Being connected to the D13 LED is not an issue. The SAMD51 only has certain number of timers. Just because there are many PWM capable pins doesn't mean you can use them all at the same time. I suggest looking at https://www.adafruit.com/product/1411 if 16 PWM channels is enough, or https://www.adafruit.com/product/815 if you need more (the board does 16 but you can chain them to get up to 992 PWM channels.

Dave

User avatar
RumiTheIsotope
 
Posts: 43
Joined: Mon Jan 13, 2020 7:59 pm

Re: Help with identifying usable PWM pins on Metro M4 airlift

Post by RumiTheIsotope »

OK thanks again Dave!

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”