Arduino fail...

Arduino projects on the go
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Arduino fail...

Post by Stew »

Hi all.
Didn't know if I should be posting this in the 'help' section. Anyhoo, here goes.
I have two Arduino Micros. One is the real deal, the other is a cheapy one. Neither will talk to my computers. I just get errors when uploading the code. I tried the basic blinky sketch, and Phils 7ch one too. It's not happening.
My 'big' computer runs Windows 7, and the laptop is on Ubuntu 17.10.

Any ideas?

Cheers fellas.

Stew.
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Re: Arduino fail...

Post by Stew »

I've got a banging headache at the mo from reading the Massimo 'Make' Arduino book, and trying various methods to get either of the Micro's to work, plus I think I finally need glasses, which ain't improving my headache at all, so I'm retreating to lick my wounds. I will report back soon with a blow by blow account of what I'm doing (I'll use the genuine board) and give you as much info as possible.

Cheers

Stew.
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Re: Arduino fail...

Post by Stew »

Just thinking out loud.
According to the sketch, I'm not to use the bootloader, and instead use an external programmer. Which one?
I will have to find out too why I'm not able to click on the 'serial port' bit on the drop down menu in the IDE.
(Unless I'm using the non genuine Micro, in which case it does show up).
the LED's are coming on on both of them, which suggests the USB cables are not an issue?
Hmmm, and the box says I'll be up and running in ten minutes!
Once I have this cracked I will be a happy chap. I can see how these things could be very interesting.
Martin
Posts: 745
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Arduino fail...

Post by Martin »

When you say 'micros' which Arduino board do you mean? Is it a Pro-Micro (which has a USB connector on the board) or something else? The normal Arduinos that people start with are the Uno, Zero, or Nano - all of these also have USB. The other popular ones are the pro mini or the pro mini expand - which usually don't have USB.

The pro micros use a slightly different chip to the other ones I've mentioned - the 32u4 which means that some sketches have to be slightly modified to work with them. All the other ones use an ATmega328 - though even then there can be different operating voltages and crystal-clock speeds.

If you're told you must use an external programmer, get a USBASP which will program all the common 8-bit Arduinos whether they have a USB connector or not. Ideally get one that can be switched to either 3.3V or 5V operation and then it will work with anything. USBASPs are cheap on Ebay.

Maybe post some more details about the boards, or photos if you can take them and we can help you with more specific advice. You can ignore the rest of this post if you want to do that.

If it's a board with USB connect it to your Windows 7 PC and go to Device Manager (from Control Panel, System). Look in the Ports section and you should see the Arduino appear as a COM port when it's connected. If you do then great - make a note of the COM port number and select that as the Port in the Arduino IDE. You also have to select the correct 'board' type in the Arduino IDE - Uno, Nano, or whatever.

If it has a USB but doesn't appear as a COM port, you may need to install some Windows drivers.

If the board doesn't have USB then for debugging an external USB-to-serial board is useful too. Again, these are also cheap on Ebay, and if you get one, the sort that can be switched to either 3.3V or 5V are the most universal and versatile.
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Re: Arduino fail...

Post by Stew »

Righto. Read the replies and had another crack this morning. Here's where I am.
Dell PC running Windows 7. IDE installed and opens up fine.
Arduino is a 'Micro' with ATMEGAGA32U$ with built in USB controller. Operating voltage 5V.
It has a micro USB port. I used a cable I had laying around, no joy, but this morning used the one from my JCB phone and voila, progress. In device manager it's showing as 'Arduino Micro (COM4).
Tried to upload blinky program, and got this:

Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Micro"

Sketch uses 4130 bytes (14%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.

avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: sorry no info avail
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: sorry no info avail
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: sorry no info avail
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "þ"; type = È
Software Version = ".
Martin
Posts: 745
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Arduino fail...

Post by Martin »

Right. Try this from the Windows PC. With the Arduino plugged in and showing in Device Manager as COM4, close device manager then launch the Arduino IDE.

In the tools menu, make sure that the "Board:" is showing as "Arduino/Genuino Micro" (select that option from the drop-down Board list if it's not)

In the tools menu make sure that the "Port:" is showing as "COM 4 (Arduino/Genuino Micro)" and select that option form the drop-down Ports list if it's not. Note that the COM 4 is the important part. It may not say "Arduino/Genuino Micro" but my Windows Arduino IDE does that when a Pro Micro is plugged in. Obviously the '4' is the port you found the board on in Device manager, so on a different PC or with a different Arduino board you might have to change this to 3, or 5, or whatever.

Now go to to File menu, Examples, 01.Basics, Blink and a window with the Blink sketch should appear. You can now close any other Arduino IDE windows so that just the Blink window is open. Maximize it to fill the screen so you can see it more easily.

From the Sketch menu choose the Upload option, and the Blink sketch should compile, upload and execute.

Assuming success on the upload, the LED probably now WON'T be blinking! :shock: This is because the Pro Micro has its LED on a different pin to the usual one that the default Blink Sketch uses.

Delete the line: digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
and replace it with: TXLED1; // that's a one at the end, not an L or an i

Similarly delete the line: digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
and replace it with TXLED0; // thats a zero at the end, not a letter o

You can also delete the line: pinMode(LED_BUILTIN, OUTPUT); though it will still work if you don't.

Now choose Upload from the Sketch menu again and once the upload is compete, one of LEDs should be flashing on and off. To convince yourself that the sketch is really working try altering both the delay(1000); lines to delay(100); and re-uploading and the LED should then cycle five times per second instead of every two seconds.

You can use the right pointing arrow icon instead of the Sketch, Upload option.

Let us know how you get on. What sketch are you wanting to upload eventually? Like I said, it might need modifying to run on a 32U4 chip, as that chip is slightly different to the 328P chip that most of the sketches that are featured on the Mode Zero are designed for. You may wish to consider purchasing a cheap Arduino Nano clone board from Ebay - the Nano is the board that lots of people here use. It also has a built-in USB connector but it uses the 328P chip.

Code: Select all

// Blink for a 32U4 Arduino

void setup() {
}

void loop() {
  TXLED1;
  delay(500);
  TXLED0;
  delay(500);
}
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Re: Arduino fail...

Post by Stew »

Hi Martin. I carried out your instructions word for word, and although my computer recognised the board at first, and showed up on COM4, after I'd gone about modifying the sketch as instructed, I went to upload, and got this error message.
Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Micro"

Sketch uses 3872 bytes (13%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Couldn't find a Board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So it looks like the board is a little flaky when it comes to getting recognised by my PC. It triggered some kind of update process when I initially plugged it in, but it's not recognising it now.
The fun continues!!
Martin
Posts: 745
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Arduino fail...

Post by Martin »

32U4's are a little weird as the USB interface is built right into the chip itself. You might get success just by unplugging and replugging the board and trying again.

It is possible that the existing sketch loaded on the board is making use of the serial port and that is preventing the blink sketch from uploading. You can sometimes get around that by resetting the board just as the upload begins. Unfortunately my Pro minis don't have a reset button, so the advice about pressing and releasing the reset button is useless - but you can achieve the same thing by dabbing a wire link between the pins RST and GND.

If that doesn't work, you may have to use a USBASP which you connect to the Arduino micro's RST, GND, VCC, and 14, 15, and 16 pins. That will enable you to 'upload using programmer' and also to 'burn bootloader' to get the USB connector working again.

Don't spend too much time and get too frustrated with the micro. They are awkward. If you get stuck, a Nano is much easier to get started with and you can then return to the micro once you've gained some experience.
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Re: Arduino fail...

Post by Stew »

Martin, Success!! I now have a small orange LED on my Micro that I'm changing the blink rate of by altering the numbers in the code. I turned up the volume on the Logitech speakers and I could hear the board dropping out and coming back in. So I looked and it was updating some driver or other. It then changed to COM7, so I kept the device manager open so I could see what was happening when I was uploading, and I managed to sucessfully upload. So I'd call that progress. Thanks so much for your help Martin, I'm very grateful. Now, I'm going to call that quits for today before my luck runs out, and have a further fiddle tomorrow. I will order a Nano from fleabay and have go with that.

Onwards and upwards!
User avatar
Flynn
Posts: 64
Joined: 17 Feb 2018, 14:48

Re: Arduino fail...

Post by Flynn »

When you get a chance find yourself a magnifying glass and try reading the writing on the top of the processor - it will either say Amtel 328P or 32u4...the 328p is 8 bit and the 32u4 is 32 bit. The confusion arises because the Chinese listings often have multiple entries like - "Mini/Micro USB ATmega328P UNO R3 CH340G Replace ATmega16U2 Compatible to Arduino"... which is misleading. The best way of being sure what you are using is get the chip ID off the top of the uP
You only ever need two tools....WD40 and duct tape.
If it doesn't move when it should use the WD40 and if it moves and it shouldn't use the tape.
Post Reply