Skip to content

pulseio.PulseOut's fixed carrier pin (D3/OC2B) is undocumented #33

Description

@begeistert

pulseio.PulseOut(pin, ...) refuses on every pin except D3 (the ATmega328p's OC2B):

import board
import pulseio

pulse = pulseio.PulseOut(board.D9, frequency=38000, duty_cycle=32768)
error: CompileError: a pulse train's carrier comes out of OC2B, which is PD3 (D3 on an
Arduino Uno) ...

This is a deliberate hardware constraint (Timer2 fast-PWM mode 7 is the only carrier
generator this HAL wires up, per pymcu/hal/avr/pulse/atmega328p.py) and the message
explains it well -- but the README's pulseio row ("Pulse lengths in microseconds; a 38
kHz carrier gated by a pulse list") never says PulseOut is pinned to one pin. A user
following an Adafruit IR-blaster guide, which typically wires the emitter to whatever
pin is convenient, hits this only at build time.

Ask

Add "PulseOut only drives D3 (OC2B) on this chip" to the pulseio row / known
limitations list, alongside the other AVR-specific pin constraints already documented
there (e.g. countio needing D2 or D3).

Corpus program (pymcu-circuitpython test corpus)

  • 40_pulseout_wrong_pin_refuse.py -- pulseio.PulseOut(board.D9, ...).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions