I am attempting to use PWM on the Uno Q, and when I include the analogWrite() function in my sketch, it causes some (but not all) of the GPIO pins to stop working. I am not using the pinMode() function for the PWM pins due to this known issue.
Here is my test sketch:
Lines 35 and 36 have the analogWrite() functions for 2 PWM pins (D3 and D11), which I can comment out to see the resulting effect on the GPIO pin behavior.
When a GPIO pin stops working, the GPIO pin always shows a logic low (0 voltage) as read by a DMM attached to the pin. When the GPIO pin works, I see that the pin toggles from logic low to logic high and back again, as expected, using the above test sketch.
The PWM pins always work as expected, when they are either enabled or disabled, by either including or commenting out the analogWrite() functions, respectively.
If I comment out both of the analogWrite() functions, then the GPIO pins D2, D4 to D10, and D12 and D13 all work correctly and toggle low/high, as programmed in the sketch.
If I include the analogWrite() function on line 35 for pin D3, then the following GPIO pins stop working: D6 and D8
If I include the analogWrite() function on line 36 for pin D11, then the following GPIO pins stop working: D5, D12, D13
If I include both of the analogWrite() functions on lines 35 and 36, then the following GPIO pins stop working: D5, D6, D8, D12, D13 (basically a combination of the two).
I have a Google spreadsheet that summarizes the results here:
The first two columns of the spreadsheet show whether the PWM function is Active (uncommented) or Inactive (commented out) and the remaining columns show whether the GPIO pin works (0/1) or does not work (0).
In rows 9 and 10, I've included the STM32 Timer block and channel number, respectively, from the Zephyr DTS. It seems like there is a correlation between the enabling of PWM on a Timer block and the problematic GPIO pin that appears to share the same block (?).
Am I doing something wrong here? Is this a known issue? I could not find anything in the documentation or the forums about this behavior.
I ran into this problem when helping a friend get his Arduino Motor Shield to work with the Uno Q. The shield appears to use a fixed pin mapping, so changing pins here is not an option. My test sketch here models the pin assignments of this motor shield (direction, brake, pwm).
I am using App Lab version 0.7.0
![]()