More SAMD21 M0 weirdness
My assumption was that using Arduino IDE was the quickest and simplest way to venture into the world of 32 bit ARM processors, but I am starting to think otherwise. This post is the second about things not working as expected and time used to figure out what's wrong. For a motor-controller project, I was testing Allegro's A4950 h-bridge when I realized that while varying motor speed using a PWM signal, sudden torque spikes were happening. My first idea was that the power supply was to blame, so I replaced it, to obtain exactly the same result. The code I was running was very simple and on close inspection, I could not find any reason for the observed glitch, that somehow had a periodic nature: one acceleration and deceleration period would work ok and the next one will show three or four torque spikes. As I was using an Arduino-form M0 board (SAMD21-based) I decided to bring back my trusted Arduino UNO and to run exactly the same code. This time all worked nicely, no s