Showing posts from January, 2018

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 sudden ac…

Guess who is coming home?

Have you ever wanted to know if someone is coming home even before they ring the bell? I do not have a dog (they have that kind of power too) so I have to look for a solution on another domain.

So last weekend I decided to see if I could use an ESP8266 for that purpose, given that my sample subjects, aka sons, are equipped with smartphones with a MAC address I am aware of.

But the point is that if I wait till I can detect their phones are joining the home wireless network, they are probably at the door already. I am looking for something else that can pick them up sooner, even if their phones cannot yet pick up the home network wifi signal.

Googling around I found this code. It is a basic sniffer of wifi control frames. In particular, it is looking for probe frames that wireless stations can emit from time to time to discover nearby wireless networks.

But be warned that while the trick seems to work fine for Android phones, it does not seem to work for iPhones as they use to use a ran…

Wemos M0 PWM weirdness

One of the things I have received as Xmas gift is thus Arduino UNO form factor board with a Cortex-M0 processor running at 48 Mhz.

After getting some trouble with the Arduino IDE I managed to get it working as an Arduino M0 in 1.8.5 IDE. However, though I could upload code, analogWrite seem not so work for me.

I used Fade example code that should work with built-in LED on pin 13 but it did not.

I had to use my logic analyzer to check which pins work with PWM and which do not. I could see that Adafruit using a similar processor mentioned some trouble with some pins but my board was even worse than that. Only pins 12, 11, 10, 9, 8, 5, 4, 3, & 2 worked with PWM while others, like pin 13 should work but did not.

At least now I know which pins I can use for analogWrite. I am not sure what the root cause of the problem is though.