Showing posts from September, 2005

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…

Back from summer holidays

Every time I build a new computer or I rebuild and old one I run into trouble. This time I transfer my old computer to one of my children and I bought a new ASUS Pundit-R with the cheapest Celeron I could find (a 2.4GHz one).

Because my kid wanted to play games I replaced the ATI Rage 128 16MB RAM with a NVIDIA 440MX 64MB RAM I had lying on the drawer. However, I needed to get a new fan before as the old one on the card was making a lot of noise. Once the installation blues was over and the kid started playing he came back telling me that the system was freezing. A quick check-up showed the new fan was not properly fitted, so I removed the card and I re-attached the new fan (with funny LED's by the way). Minutes later, same problem. Ok, over time I've developed the attitude that the best brand of hardware is "brand-new". I was not 100% sure the card was ok so I went to the shop and I bought a non-NVIDIA graphics card. This time it was an ATI Radeon 9250 128MB RAM and…