You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How many PWM pins are available on STM32C011F6? I tried the following test code driving 8 LEDs. It did not perform as I thought. PA7_ALT1 and PA0 did not turn on but PC14 and PA8 showed up instead. I used the second pwmPin[] with a different order. It gave a different result. Thanks in advance for giving me suggestions.
/* Test Code for STM32C011F6 */
#include <Wire.h>
#define DELAY 500
const int pwmPins[] = {PA8, PC14, PA2, PA7_ALT1, PA6, PA1, PA0, PC15};
//const int pwmPins[] = {PA0, PA1, PA2, PA6, PA7_ALT1, PA8, PC14, PC15};
const int numPins = 8;
void setup() {
// 1. Configure UART1
Serial1.setTx(PA11);
Serial1.setRx(PA12);
Serial1.begin(115200);
// 2. Configure I2C1 on Port B
Wire.setSCL(PB6);
Wire.setSDA(PB7);
Wire.begin();
for (int i = 0; i < numPins; i++) {
pinMode(pwmPins[i], OUTPUT);
}
}
void loop() {
for (int i = 0; i < numPins; i++) {
analogWrite(pwmPins[i], 255);
delay(DELAY);
analogWrite(pwmPins[i], 0);
delay(DELAY);
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
How many PWM pins are available on STM32C011F6? I tried the following test code driving 8 LEDs. It did not perform as I thought. PA7_ALT1 and PA0 did not turn on but PC14 and PA8 showed up instead. I used the second pwmPin[] with a different order. It gave a different result. Thanks in advance for giving me suggestions.
Beta Was this translation helpful? Give feedback.
All reactions