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

Feather M4 Express no PWM out on RX (0) or TX (1) #349

Open
caternuson opened this issue Aug 4, 2023 · 1 comment
Open

Feather M4 Express no PWM out on RX (0) or TX (1) #349

caternuson opened this issue Aug 4, 2023 · 1 comment

Comments

@caternuson
Copy link

Re this thread:
https://forums.adafruit.com/viewtopic.php?t=203518

Pinout page indicates PWM out is available on RX and TX:
https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/pinouts

Test sketch:

#define PWM_PIN 0

void setup() {
  pinMode(PWM_PIN, OUTPUT);
  analogWrite(PWM_PIN, 128);
}

void loop() {
}

Setting PWM_PIN to either 0 or 1 produces no output on either RX or TX (resp).

@philggg
Copy link

philggg commented Mar 3, 2024

The documentation for the board is incorrect. if you run this code on the board:

# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT

"""CircuitPython Essentials PWM pin identifying script"""
import board
import pwmio

for pin_name in dir(board):
    pin = getattr(board, pin_name)
    try:
        p = pwmio.PWMOut(pin)
        p.deinit()
        print("PWM on:", pin_name)  # Prints the valid, PWM-capable pins!
    except ValueError:  # This is the error returned when the pin is invalid.
        print("No PWM on:", pin_name)  # Prints the invalid pins.
    except RuntimeError:  # Timer conflict error.
        print("Timers in use:", pin_name)  # Prints the timer conflict pins.
    except TypeError:  # Error returned when checking a non-pin object in dir(board).
        pass  # Passes over non-pin objects in dir(board).

You will get this list of pwm supported pins:

PWM pins available are:
*PWM on: A1
*PWM on: A3
*PWM on: D0
*PWM on: D1
*PWM on: D10
*PWM on: D11
*PWM on: D12
*PWM on: D13
*PWM on: D15
*PWM on: D17
*PWM on: D25
*PWM on: D4
*PWM on: D5
*PWM on: D6
*PWM on: D9
*PWM on: LED
*PWM on: RX
*PWM on: SCK
*PWM on: SCL
*PWM on: SDA
*PWM on: TX

The board documentation should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants