-
-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
Labels
Description
Arduino Nano 33 BLE mbed os crashes when PWM on more than 2 digital pins once we use 4 other.
We are using ARDUINO NANO 33 BLE, Model NINA-8306
Below I distilled a piece that crashes the mbed os.
We are using IDE 1.8.13 with Mbed OS 1.3.0 (whatever the board manager latest downloaded) with a manually edited wiring analog cpp adding the object destruction. My Nano 33 BLE is also stock. I got a second confirmation from a very nice person over at the arduino forum that they can reproduce the problem.
void setup() {
// D2
pinMode(D2, OUTPUT);
analogWrite(D2, 255);
// D4
pinMode(D4, OUTPUT);
analogWrite(D4, 255);
// D6
pinMode(D6, OUTPUT);
analogWrite(D6, 255);
// D8
pinMode(D8, OUTPUT);
analogWrite(D8, 255);
// Destroy D2, D4, D6, D8
analogWrite(D2, -1);
analogWrite(D4, -1);
analogWrite(D6, -1);
analogWrite(D8, -1);
// At that point we have again 4 pins available since the previous 4 were presumably destroyed.
// D3
pinMode(D3, OUTPUT);
analogWrite(D3, 255);
// D5 or any other pwm not part of the above pin set
pinMode(D5, OUTPUT);
// This next line will crash mbed
analogWrite(D5, 255);
}
void loop() {}