Arduino Fio V3 - getting it working

Hi all,

I had a fair of bit trouble getting my new Fio V3 board to work with Arduino IDE, but eventually got it. Thought I’d share in case I can save someone else the heartache. It’s also probably more useful here than the forum.

First off a disclaimer: I’ve got a bit of experience programming microcontroller and computers, but haven’t for a while, and I’ve only just got into Arduino. So if this is obvious or if I’ve done something stupid, please be gentle…

Anyway, here is what I’m using, hardware-wise:

  • Windows XP (32bit)

  • Arduino 0023 IDE, and also Arduino 1.0 IDE. I’m using the serial backpack, and the best library I could find is not compatible with 1.0, so I’ve been running in 0023.

  • Fio V3 (3.3V, 8MHz, no other options available), connected to 3.7V LiPO battery

The Driver:

I couldn’t find any good descriptions on how to set up the Fio V3, except that it was a bit weird and needed special care with the drivers. I also kind of missed the sentence on the product page that says “the Fio V3 is uses a similar bootloader to the ProMicro”. Armed with this knowledge, a quick google turned up this Sparkfun ProMicro tutorial on how to install the driver (and pretty much do everything else).

http://www.sparkfun.com/tutorials/338

By this point, I’d already muddled around and kind of installed the driver, although in the device manager, the yellow exclamation mark showed over the device when plugged in and the status was “This device cannot start. (Code 10)”. Actually, it still says that right now.

So the workaround I’ve discovered is this:

  1. Connect the LiPO battery to the board and switch the board on (so that it’s on when the USB is still unplugged)

  2. Plug the USB into PC - it will give the “device cannot start” message and the beeping that indicates your device is not connected properly

  3. Unplug the USB, leave it out a couple of seconds

  4. Plug it back in and hey presto, it should be connected properly

To do this without the battery… If you wiggle the USB out slowly, the data connection is lost before the power connection, so you can effectively do the same thing (ie. wiggle out until you get the “disconnected” noise but power stays on, then push in again).

That gets the device driver properly working. Not sure if this still needs to be done if you follow the ProMicro tutorial properly, but I’m just happy it works, at this point.

Working with the Arduino IDE

At this point, you’ve got make sure all the stuff is in the “hardware” folder (which you have to make) in your sketchbook directory (which is likely in /My Documents/Arduino, NOT the Arduino IDE directory which I keep in Program Files) - as per the tutorial. That makes the IDE aware that it has a new board for you to pick, and how to deal with that. Once that’s done, I think you can run IDE 1.0 and everything will be sweet for you to load the altered “blink” sketch from the tutorial. If you want to run with IDE 0023, there are a few more things…

Because (apparently) a whole lot of stuff changed between IDEs, you need to re-jigger a couple of files. If you try to compile and upload as-is, you will get the following error message (and a whole lot of others):

Blink.cpp:15:22: error: WProgram.h: No such file or directory

To fix this, go to /hardware/Fiov3/cores/arduino and copy arduino.h and paste it in the same folder, but call the copy “WProgram.h” - or vice versa (I can’t remember which is there when you start off). The different named files are for the different IDE versions. If you try to compile and upload now, you will get this error message:

…/WProgram.h:212:26: error: pins_arduino.h: No such file or directory

To fix this one, go to /hardware/Fiov3/variants/Fiov3 and copy the only file - pins_arduino.h.

Paste it into /hardware/Fiov3/cores/arduino - it’s needed by WProgram.h (or arduino.h)

You could also almost certainly alter the file path in the relevant .h files, but this was easier…

Now if you try to compile and upload, it will compile, but not upload, and you will get the following error messages:

avrdude: Can’t find programmer id “arduino”

Valid programmers are:

dasa3 = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [C:\Program Files\arduino-0023\hardware/tools/avr/etc/avrdude.conf:776]

dasa = serial port banging, reset=rts sck=dtr mosi=txd miso=cts [C:\Program Files\arduino-0023\hardware/tools/avr/etc/avrdude.conf:763]

siprog = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> [C:\Program Files\arduino-0023\hardware/tools/avr/etc/avrdude.conf:750]

(and the list goes on)

This is because the avr compiler that comes with IDE 0023 doesn’t have a programmer called “arduino” (at least, that’s my interpretation of the error message). The fix is easy - get IDE 1.0 and in the arduino-0023/hardware (actual install directory), replace the “tools” folder with the corresponding one from IDE 1.0. This updates all the relevant AVR compiler and whatnots.

And then… your special (from the tutorial) blink sketch will finally upload (and I just noticed a brief unplug then plug in sound from my PC)!

I can’t remember - but the first time I may have had to press the reset button at a strategic time. If you’ve got to here and it still doesn’t work, maybe try that. Anyway, that’s it. I can now migrate everything over from the Uno (equivalent) I’ve been writing code on :). And see if my grand plan to run an LCD via a 3.3->5V booster board off the same battery will work.

It is a nice board by the way - love the way you can just plug a battery and charge via USB (which is why I picked it). My project is a gas analyser - to determine the percentage of oxygen, helium, carbon monoxide and carbon dioxide in breathing gas mixes for deep technical SCUBA diving. So to be able to have a rechargeable battery that I can charge direct from my Samsung phone charger is super-cool!

Anyway, hope that helps someone, and it was sure good to get it off my chest.

Cheers,

Steve (from Australia)

has anyone had any luck getting this to work on a mac? Or how about uploading sketches via xbee or sending serial messages?

Any guidance would really be appreciated!

Hi Steve,

Can you tell me more about your analyzer? I am trying to make a similar analyzer for trimix and CO. So far I am having a difficult time tracking down sensors. Any help would be greatly appreciated.

Thanks,

Chris