Skip to content

Inconsistent behaviors of analogWrite and pinMode on Due and Uno #2455

Closed
@HanaJin

Description

@HanaJin

I connected an RC circuit between D3 and A1 pins. Basically, D3 is connected to a 100K resistor, then to a 1uF capacitor. The voltage drop on the capacitor is measured on pin A1.

With the code below, I get reasonable readings on Uno R3.
image

However, using a Due and the same code, after changing the pinMode to INPUT and then OUTPUT manually, analogWrite stopped working as shown below. You can rule out the malfunctioning of analogRead as I had confirmed that using a DMM.

image

Is this behavior expected on Due? Which mode should I set it to for PWM on the Due to make it work?

Metadata

Metadata

Assignees

Labels

Architecture: SAMApplies only to the SAM microcontrollers (Due)Board: Arduino DueApplies only to the DueComponent: CoreRelated to the code for the standard Arduino API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions