Showing posts from August, 2007

Moving code from ESP8266 to ESP32

A while ago I made a mashup of Dan Royer's code CNC 2 Axis Demo with my own code for trapezoidal motion stepper and servo control for ESP8266.

I assumed porting the code to the ESP32 would be trivial, and that was true for the most part: changes like library name being Wifi.h instead of Wifi8266.h were not a problem. UDP now does not like multicharacter writes but you can use print instead. So far so good.

However, when it came to the interrupt code I was stuck with the stepper interrupt causing an exception sometimes. And to make things weirder, the servo interrupt worked flawlessly (both of them had the IRAM_ATTR directive if you ask me).

Going little by little, I could narrow down the culprit to a floating point operation during the interrupt, that would cause problems sometimes but not always. Browsing around I found this post. Where the solution was simple: do not use floats within the interrupt routines but doubles. The reason was the float calculation would be performed by…

Go home with the CD-ROM

While on vacation in Sweden I started having a lot of pain on my lower back. I thought it might be a kidney problem and after a few days without the problem going away by itself I went to the Emergency Room at Sundsvall's hospital (sjukhus in Swedish in case you are wondering). Though I was kindly asked to return on the evening as my condition was not life threatening.

When I returned my condition worsen quite a bit and I was told to stay overnight at the hospital (not a good thing when you are on a vacation trip). Fortunately, after three days my blood tests had improved and I was allowed to leave the hospital. We were very lucky as our friends in Sundsvall helped us to go through this (once again, thank you very much guys!!).

While at the hospital they performed a CT scan to determine what and where the problem was. They found a 2.5mm stone leaving my right kidney and I was told the problem will likely dissappear without surgery, which luckily did.

When I left the hospital I was p…