Showing posts from March, 2008

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…

Reviving an old laptop

Not sure what is the proper adjective for a three year old laptop. But apart from the language issue the thing is that I was asked to give a clean start to an HP nc6000 laptop. It seemed a no-brainer to install Windows XP SP2 or so I thought.

While the install worked as expected, there were bad news afterwards: The system booted but nothing worked as expected: Graphics card,Ethernet, SD memory slot, Cardbus slots and Wifi adapter did not work at all.

I am not sure whether the laptop was shipped with a driver's CD-ROM or not. The owner told me he had nothing like that.

A few Google searches later I've discovered several drivers websites trying to make a buck out of the poor souls that could not find the drivers CDs. Some users also complained about HP not making the drivers available and, of course, standard drivers on SP2 not working with HP hardware.

Later on I did find an entry on an HP website that contained the drivers. The problem is that it actually contained too many driver…

Buying Arduinos in Spain

Unfortunately, my mood light project destroyed the microcontroller when I plugged in the protoboard shield with the RGB led while the power was on.

A few days ago I've ordered another arduino board that I would use as the controller for the mood light. I was looking for a cheaper alternative so I've found a good deal on eBay from NKC Electronics, a company in Florida that sells different kits. I bought from them a serial arduino (or Freeduino as they call it) in kit form.

While I am aware of twodifferent companies in Spain selling arduino boards (but not kits), they have a shipping cost which is almost double than many USA-based companies. The fact that the Euro is now stronger than the dollar makes the shipping cost even cheaper now.

It is beyond my knowledge how come shipping cost from Florida to Valencia can be cheaper than from another city in Spain. But this seems to be the case. Of course a local supplier may be preferred if you are in a hurry.

Now that my only arduino at ho…

Arduino mood light

I recently saw the cool mood lamp by Philips and I liked it. What I did not like was the price. I set myself to discover what the industry has to offer in terms of high-power LEDs. It turns out that since the old 20mA red LEDs the market has evolved in such a way that it seems the light appliances of the future might be completely LED-powered.

Now there are 3W and 10W LEDs available. Either monochrome or RGB. I like LEDs as they last forever (I've never seen a LED that stopped working unless it was due to a current overload).

High power LEDs are not cheap but they are very easy to control from a micro-controller using PWM (Pulse Width Modulation). They need DC low voltage power sources.

I did a test with an Arduino board and a protoboard with a ULN2003 that I've used to control a 3W RGB LED.

I programmed a never ending random sequence and this is the source code. Just connect each led (R,G,B) to the outputs 9,10 and 11 of the Arduino. If you need more current then use a Darlington…

Not impressed with Apple service

As I mentioned on my previous post, my iMac needs a new RAM. I called the shop to be sure they have a technician on the shop and I was told they had one from Monday to Friday. As it was Friday afternoon I thought that if I was lucky they could double check Apple's diagnostic software diagnose: Faulty RAM. This way I could be back home with the iMac in the same trip.

I brought the iMac to the Apple shop I've bought it from, but I was told I had to leave it there (why am I not surprised?) and luckily they will call me next Wednesday. In hindsight I realized they should have stressed the "luckily" part.

Next Monday I've got a call from the "technician". The conversation goes more or less like this: Hi Sir, this is from the Apple shop. I'm trying to have a look at your computer but it is password protected so I cannot log in. I mentioned him that all that I did was to run Apple Diagnostic software and I've got a RAM error right away. Using the system,…