Thursday, 25 May 2017

My Arduino has arrived - finally.

I should probably have expected no less, but the Arduino arrived today - on the very last day in the expected delivery period, over a month since I ordered it.  Oh well, at least I have it now.  The package was actually well protected, with the board (and a bonus set of header pins I wasn't expecting) in a static-proof bag, and then that in turn was vacuum sealed in an outer bag for delivery.

My excitement at receiving the package was dulled a little when I opened it and actually held the board in my excited clammy hands... it has a USB MICRO socket on it - not the USB MINI that I was expecting... DAMN!  Luckily, after a little digging around, I found that I had a USB lead probably from an old phone (think it may have been a Samsung Galaxy... but not sure) that fit the bill.

My next observation was that the extra 3 rows of connection points described in the ebay listing (Serial Comms, I2C @ 5V, and an extra set of 3.3V/GND outputs)... was actually only 2 rows - and which was the one missing? You guessed it - the one for 5V I2C connection that I was hoping to use for my LCD unit :-( 
However - instead of the extra 3.3V/GND connections, they have provided a set configured for I2C connections at 3.3V, so I'll have to check if that can drive the LCD (and backlight) when the LCD arrives (probably next week if that goes to the last delivery day as well...)

So, being a little upset at the time (having fallen foul of the very things I half-expected would happen, back when I placed the order) I let the ebay seller know how disappointed I was - in no uncertain terms!!  Maybe that was a bit churlish of me for something that only cost $4 and was quite obviously a cheap clone anyway, but it was the principle of the thing - I checked with the seller before I ordered; waited 5 weeks for it to arrive; and then found it did not match the description of the article I purchased - or thought I had purchased (vague though they were).  I just needed to vent and didn't really expect a response to my rant, except that I threatened them with neutral fedback.  That got their attention - and to their credit, they responded within an hour and offered me a 30% refund!  Cool - thank you very much - I accept :-)

But - oh dear - that refund will go into my PayPal account, which means I will just have to spend it on something else now (first world problems...)!

So having got over my initial disappointments, and with excitement rising again (while already planning what to spend my extra $1.40 on...), I plugged the board into one of my power supplies (9v@1A).  The ON light came on, and the L light (attched to pin 13) started flashing rapidly - great news... it works - apparently.


My next move was to plug in the USB cable, and upload the simplest sample sketch that would give me a visible indication of success on the board itself, with no other devices plugged in - in other words, the 'Blink' sample code.

USB connected? Check.
Sample sketch opened in IDE? Check.
Arduino UNO selected it Tools | Board? Check.
COM port?  Well, it lists COM1 and COM3 - I know what COM 1 is connected to, so it must be COM3... right? Check!

I clicked on the Upload button - the sketch compiled - and...

"Houston? We have a problem..." (apparently, though Tom Hanks said this in the movie, that's not what the actual crew members of the Apollo 13 said.  I imagine what they said was something more like "What the f@*$ was that?", but I digress...)

No upload - no flashing Tx/Rx lights - and after about 20-30 seconds, a whole string of error messages in the IDE, indicating that it cannot communicate with the board.  This can't be good..?



That's OK, I seem to remember reading something about this (but it was well over a month ago when it was all fresh in my mind!!).  As I said, COM 1 and COM3 were both listed in the IDE Tools | Port menu option, but neither of them vanished when I unplugged the UNO :-/ 
OK - this means that they must both belong to pre-existing devices.
I went to the device manager on my PC to look for an unrecognised device listed in the COM ports, but there weren't any.  BUT - I saw a device labelled as "USB 2.0 - Serial Device" listed under "Other Devices", which had the little exclamation mark on the icon - meaning Windows has no idea what it is, but knows it is there.  I selected the device and tried to do a driver update - letting windows 'Search automatically...', but this did not find a suitable driver.  Next, I tried pointing the search to look at the Drivers folder in the Arduino folder on my PC.  This also failed to find a suitable driver. By now, I am starting to get a bit fed up again...

Then I had one of those "Aha!" slap-my-forehead moments and remembered what it was I had read a month ago...  Dammit - I even wrote about here it in my first post!! The Chinese clone UNO boards do not use the standard licensed USB controller chip.  Instead, they use the CH340 or CH340G chip, which requires a specific driver.  A check of my UNO confirmed it has the ...G variety of chip, and google search listed a few locations where I could download the driver.  This is the one I used - it is for Windows 8 and above and for both x86 and x64 (I am on W10 x64).  NB - you need administrator rights on your PC to install this driver.  After downloading the driver (zip file), I unpacked it into a new folder under the ...Arduino\Drivers folder.

My 'normal' ID on my computer has been specifically configured to NOT have admin rights, so when I pointed the "USB 2.0 - Serial Device" driver update at this specific folder, it still wouldn't work, and I ended up installing the driver manually, by right-clicking on the driver's setup.exe and running it 'as Administrator'.  The setup ran, and the device manager screen updated to show a new device "USB-SERIAL CH340" as COM4.

I went back to the Arduino IDE, looked in Tools | Port, and lo... there was COM4 listed :-)  Deep joy!

I hit the upload button again, the sketch compiled, there was the briefest of flickers on the RX and TX lights (blink and you'd miss it... maybe the sketch should be called DON'T blink?), and then the L light changed from the initial rapid blinking to a more stately 1 second on, 1 second off.

SUCCESS - I have a functioning UNO board, and connection to my PC.  Now I can start to play :-D

No comments:

Post a Comment