Main.ArduinoBoardFioProgramming History

Hide minor edits - Show changes to output

November 21, 2010, at 05:32 PM by David A. Mellis -
Deleted lines 2-6:
!!!Hardware Definition for Arduino 0018
Download and unzip the following file as '''YOUR_SKETCH_FOLDER/hardware'''. After re-launch your IDE, you can find '''Arduino Fio''' in the '''Board''' menu. You can also choose '''Arduino Pro or Pro Mini (8MHz)''' instead, as the settings are the same for both.

[[Attach:hardware_folder_for_fio.zip | hardware_folder_for_fio.zip]]
April 02, 2010, at 04:01 PM by Shigeru Kobayashi -
Added lines 73-75:
'''NOTE:''' Please remove a XBee modem from a Fio board while uploading sketches.

April 02, 2010, at 10:39 AM by Shigeru Kobayashi -
Changed line 58 from:
%width=150%Attach:fio_wired_programming_with_sockets.jpg
to:
%width=240%Attach:fio_wired_programming_with_sockets.jpg
Changed line 61 from:
%width=150%Attach:fio_wired_programming_without_sockets.jpg
to:
%width=240%Attach:fio_wired_programming_without_sockets.jpg
April 02, 2010, at 10:37 AM by Shigeru Kobayashi -
Added lines 54-66:
These are alternative ways to program a Fio with a L-shaped plug and low-profile sockets:

(:table width=100% border=0:)
(:cellnr:)
%width=150%Attach:fio_wired_programming_with_sockets.jpg
''Using a L-shaped plug and soldered low-profile sockets to program a Fio''
(:cell:)
%width=150%Attach:fio_wired_programming_without_sockets.jpg
''Using a L-shaped plug without soldered low-profile sockets to program a Fio''
(:tableend:)
[[<<]]

April 02, 2010, at 10:21 AM by Shigeru Kobayashi -
Changed lines 19-20 from:
The FIo does not have a built-in USB-to-serial adaptor, so if you're going to program it over USB, you'll need an adapter. Either of these will work well:
to:
The Fio does not have a built-in USB-to-serial adaptor, so if you're going to program it over USB, you'll need an adapter. Either of these will work well:
March 30, 2010, at 06:05 AM by Tom Igoe -
Changed lines 19-20 from:
The FIo does not have a built-in USB-to-serial adaptor, so if you're going to program it over USB, you'll need an adapter.
to:
The FIo does not have a built-in USB-to-serial adaptor, so if you're going to program it over USB, you'll need an adapter. Either of these will work well:
Changed line 23 from:
%width=150px%Attach:FTDI_cable.jpg |''FTDI 3.3V cable''
to:
%width=150px%[[http://www.adafruit.com/index.php?main_page=product_info&cPath=33&products_id=70&zenid=820efea6fe32ea04a0a7879262db3e54|Attach:FTDI_cable.jpg]] |''FTDI 3.3V cable, available from [[http://www.adafruit.com|Adafruit.com]]''
Changed line 25 from:
%width=150px%Attach:FTDI_adaptor.jpg |''Sparkfun's FTDI Basic Breakout adaptor.\\
to:
%width=150px%[[http://www.sparkfun.com/commerce/product_info.php?products_id=8772|Attach:FTDI_adaptor.jpg]] |''Sparkfun's FTDI Basic Breakout adaptor.\\
March 30, 2010, at 05:56 AM by Tom Igoe -
Changed lines 4-5 from:
Download and unzip the following file as '''YOUR_SKETCH_FOLDER/hardware'''. After re-launch your IDE, you can find '''Arduino Fio''' in the '''Board''' menu. Otherwise, choose '''Arduino Pro or Pro Mini (8MHz)''' instead.
to:
Download and unzip the following file as '''YOUR_SKETCH_FOLDER/hardware'''. After re-launch your IDE, you can find '''Arduino Fio''' in the '''Board''' menu. You can also choose '''Arduino Pro or Pro Mini (8MHz)''' instead, as the settings are the same for both.
Deleted lines 7-9:
!!!Wired Programming
The Arduino Fio can be programmed with the Arduino software ([[Main/Software | download]]). For details, see the [[Reference/HomePage | reference]] and [[Tutorial/HomePage | tutorials]].
Added lines 10-12:

There are two ways you can upload new sketches to the Arduino Fio: you can use an FTDI USB-to-serial cable, or USB-to-serial adaptor board; or you can program it wirelessly, over a pair of XBee radios. If you're new to the XBee radios, it's helpful to know a bit about them before attempting the wireless programming. This [[http://itp.nyu.edu/physcomp/Tutorials/XbeeBasics|introduction]] may help.
Added lines 15-64:

!!!Wired Programming
LIke all Arduino boards, the Arduino Fio can be programmed with the Arduino software ([[Main/Software | download]]). If you're new to Arduino, see the [[Guide/HomePage| Getting Started Guide]] , the [[Reference/HomePage | reference]] and [[Tutorial/HomePage | tutorials]].

The FIo does not have a built-in USB-to-serial adaptor, so if you're going to program it over USB, you'll need an adapter.

(:table width=100% border=0:)
(:cellnr:)
%width=150px%Attach:FTDI_cable.jpg |''FTDI 3.3V cable''
(:cell:)
%width=150px%Attach:FTDI_adaptor.jpg |''Sparkfun's FTDI Basic Breakout adaptor.\\
This has the same pin configuration as the FTDI cable''
(:tableend:)
[[<<]]
To program the Fio using either FTDI cable or an adaptor with the same pin configuration, attach a row of male pin headers to the cable or adaptor like so:

(:table width=100% border=0:)
(:cellnr:)
%width=150%Attach:fio_pin_headers.jpg
(:cell:)
%width=150%Attach:FTDI_pin_headers.jpg

(:tableend:)
[[<<]]


Then connect the headers to the FTDI pins on the Fio:

(:table width=100% border=0:)
(:cellnr:)
%width=150%Attach:fio_wired_programming.jpg
''Using the adaptor to program a Fio''
(:cell:)
%width=150%Attach:FTDI_wired_programming.jpg
''Using the FTDI cable to program a Fio''
(:tableend:)
[[<<]]


If your headers don't fit snugly in the holes (and most won't), you should hold the connector firmly so that the metal of the pins touches the metal of the holes while you're programming.

When your cable is connected to the Fio, open the Arduino programming environment, choose '''Fio''' from the '''Tools-->Board''' menu. Then choose your serial port from the serial port menu, and you're ready to program If you're using the FTDI adaptor, you'll see the TX and RX lights flicker. You won't see any visible sign on the Fio, but you will see the following in the IDE when you've successfully uploaded code:

Attach:upload_complete.png

[[<<]]
----
[[<<]]

Changed lines 67-70 from:
'''Reference:''' [[http://www.ladyada.net/make/xbee/arduino.html|Xbee Adapter - wireless Arduino programming by Ladyada]]

You can upload sketches wirelessly. Make sure you are using a Series 1 (not 2 or 2.5) XBee module if you want to do wireless programming. Series 2 modules do not allow for automatic IO Line Passing (this is required for toggling the reset pin when programming). Also make sure that you have a recent version of the firmware (10A5 or later). If you need to upgrade your firmware, use X-CTU (Windows only, unfortunately). If you confirmed these points, please follow the following steps.
to:
''This tutorial borrows from [[http://www.ladyada.net/make/xbee/arduino.html|Xbee Adapter - wireless Arduino programming]] by Limor Fried''

In order to upload sketches wirelessly using XBee radios, you'll need the following:
* '''two [[http://www.digi.com/products/wireless/point-multipoint/xbee-series1-module.jsp#overview|XBee or XBee Pro 802.15.4]] XBee modules.''' These are also known as Series 1 modules, for those who've worked with XBees for awhile. You can't use the DigiMesh or ZB series radios (aka Series 2 or 2.5). Those modules do not allow for automatic IO Line Passing that is required for toggling the reset pin when programming.
* '''a recent version of the 802.15.4 firmware (10A5 or later).''' If you need to upgrade your firmware, you need to use [[http://ftp1.digi.com/support/utilities/40002637_c.exe|X-CTU]] (Windows only, unfortunately). If you confirmed these points, please follow the following steps.
* '''a USB-to-serial adaptor''' for one of the modules. You can use Sparkfun's [[http://www.sparkfun.com/commerce/product_info.php?products_id=8687|XBee Explorer USB]] or Adafruit's [[http://www.adafruit.com/index.php?main_page=product_info&cPath=29&products_id=126&zenid=820efea6fe32ea04a0a7879262db3e54|XBee Adapter kit]] or any other FTDI-to-XBee adaptor.
Changed lines 75-76 from:
If you are using a XBee Explorer USB (SparkFun Electronics) or XBee starter kit (Adafruit Industries), solder in a tiny jumper between the RTS pin and D3 as following picture:
to:
On your USB-to-serial adaptor, solder in a tiny jumper between the RTS pin and D3 as shown here:

(:table width=100% border=0:)
(:cellnr:)
Changed lines 80-162 from:
to:
''Modified XBee Explorer USB''
(:cell:)
%width=200px%Attach:AdafruitXBeeUSBForFio.jpg
''Modified Adafruit XBee Adapter Kit\\
The arrow shows the added solder connection''
(:tableend:)

!!! Preparing the XBee radios
In order to program the Fio wirelessly, you need to configure two XBee radios, one for the Fio and one to connect to the programming computer serially. The latter will connect to your computer using the adapters mentioned in the last step. Once you've done that, you'll program the Fio using the radio link just like a normal Arduino USB-to-serial link.

The settings for the two radios are as follows:

(:table width=70% align=center border=1 cellpadding = 3 cellspacing=0 :)
(:cellnr:)
'''Parameter'''
(:cell:)
'''Programming Radio'''
(:cell:)
'''Fio Radio'''
(:cellnr:)
BD
(:cell:)
4 (Atmega168) or 6 (Atmega328)
(:cell:)
4 (Atmega168) or 6 (Atmega328)
(:cellnr:)
ID
(:cell:)
user's preference (0000 to FFFF)
(:cell:)
user's preference (0000 to FFFF)
(:cellnr:)
MY
(:cell:)
User's preference, e.g. 0000
(:cell:)
user's preference, e.g. 0001
(:cellnr:)
DL
(:cell:)
FFFF or Fio's MY value
(:cell:)
programmer's MY value
(:cellnr:)
D3
(:cell:)
3
(:cell:)
5
(:cellnr:)
IC
(:cell:)
8
(:cell:)
not set
(:cellnr:)
RR
(:cell:)
3
(:cell:)
not set
(:cellnr:)
IU
(:cell:)
not set
(:cell:)
0
(:cellnr:)
IA
(:cell:)
not set
(:cell:)
FFFF
(:cellnr:)
RO
(:cell:)
10
(:cell:)
10
(:tableend:)
'''Note:''' If you set the programmer's destination address (DL) to FFFF, it will re-program all Fios in its PAN ID. To program one Fio at a time wirelessly while others are on, set the programmer's DL to that Fio's MY address.

Changed lines 164-168 from:
You have to make a slight change to the driver preferences. In the Device Manager, select the '''USB COM port'''. Then right click and select '''Properties'''. Click on the '''Port Settings''' tab, and click on '''Advanced...''', then make '''Set RTS On Close''' is selected and click '''OK''' to apply settings.

!!!!How to configure XBee modems
On Windows and Mac OS X, you can configure XBee modems with [[http://funnel.googlecode.com/files/XBeeConfigTool.zip | XBeeConfigTool]].
to:
If you're running Windows, you have to make a slight change to the driver preferences. In the Device Manager, select the '''USB COM port'''. Then right click and select '''Properties'''. Click on the '''Port Settings''' tab, and click on '''Advanced...''', then make '''Set RTS On Close''' is selected and click '''OK''' to apply settings.

!!!How to configure XBee modems
You can configure your radios using a terminal application, or using X-CTU on Windows, or you can use the [[Attach:XBeeConfigTool.zip| Fio XBee Config Tool]]. This is a modified version of Shigeru Kobayashi's [[http://funnel.googlecode.com/files/XBeeConfigTool.zip | XBeeConfigTool]].

!!!!Using Arduino Fio XbeeConfigTool
Changed line 172 from:
# Choose a proper mode (Coordinator or End Devices)
to:
# Choose a proper mode (Programmer or Fio)
Changed line 175 from:
# Set a proper MY ID (e.g. 1, for end devices only)
to:
# Set a proper MY ID (e.g. 1, for end devices, 0 for programmer)
Changed lines 178-182 from:
%width=400px%Attach:XBeeConfigToolCoordinatorExample.jpg

%width=400px%Attach:XBeeConfigToolEndDevicesExample.jpg

!!!! Uploading sketches from an Arduino IDE to a Fio board
to:
%width=400px%Attach:FioXBeeConfigToolCoordinatorExample.jpg

%width=400px%Attach:FioXBeeConfigToolEndDevicesExample.jpg

!!!!Configuring the radios using a serial terminal application

If you prefer to set your settings manually, you can set them using any Serial terminal application, such as [[http://freeware.the-meiers.org/|CoolTerm]]. Connect the adapter to your computer, and open its serial port at 9600 bps using your favorite serial terminal application.

Set your terminal application's termination string to be a carriage return (ASCI 0x0D) only. Then open the port, and type:

@@+++@@

The XBee will respond:

@@OK@@

For the programmer radio, type:

@@ATRE,BD6,ID1234,MY0,DLFFFF,D33,IC8, RR3,RO10,WR@@

The XBee will respond:

[@
OK
OK
OK
OK
OK
OK
OK
OK
OK
@]

For the Fio radio, type:

@@ATRE,BD6,ID1234,MY1,DL0,D35,IU0,IAFFFF,RO10,WR@@

The XBee will respond:
[@
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
@]

That's it! Now connect the Fio radio to your Fio, leave the programming radio in the XBee adapter, and you're ready to upload sketches to your Fio.

[[<<]]
----
[[<<]]

!!! Uploading sketches from an Arduino IDE to a Fio board

Uploading sketches to the Fio is similar to other Arduino boards.
Changed lines 244-247 from:
!!!Automatic (Software) Reset
Rather then requiring a physical press of the reset button before an upload, the Arduino Fio is designed in a way that allows it to be reset by software running on a connected computer. One of the pins on the six-pin header is connected to the reset line of the ATmega328P via a 100 nanofarad capacitor. This pin connects to one of the hardware flow control lines of the USB-to-serial convertor connected to the header: RTS when using an FTDI cable, DTR when using the Sparkfun breakout board. When this line is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino software uses this capability to allow you to upload code by simply pressing the upload button in the Arduino environment. This means that the bootloader can have a shorter timeout, as the lowering of the reset line can be well-coordinated with the start of the upload.

This setup has other implications. When the Fio is connected to either a computer running Mac OS X or Linux, it resets each time a connection is made to it from software (via USB). For the following half-second or so, the bootloader is running on the Pro. While it is programmed to ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few bytes of data sent to the board after a connection is opened. If a sketch running on the board receives one-time configuration or other data when it first starts, make sure that the software with which it communicates waits a second after opening the connection and before sending this data.
to:
As you upload, you should see the green RSSI light on the Fio light up. If you're using an XBee Explorer, you'll also see the TX and RX lights on it flicker as the sketch uploads.

If the Fio does not respond, here are the most common causes of error:
# make sure the Fio is powered. You can use USB power if you don't have a battery.
# make sure the slider switch on the Fio is turned ON
# Check your radio configurations. Did you miss a setting? This is particularly common if you confgured them using a serial terminal application.

When in doubt, check the Fio by programming it over a wired connection as described above.

[[<<]]

-----

When your'e ready to start writing sketches for the Arduino Fio, here are some [[ArduinoBoardFioTips|programming tips]] that will make your life easier.
March 19, 2010, at 09:31 PM by Shigeru Kobayashi -
Changed lines 6-7 from:
Attach:hardware_folder_for_fio.zip
to:
[[Attach:hardware_folder_for_fio.zip | hardware_folder_for_fio.zip]]
March 19, 2010, at 09:30 PM by Shigeru Kobayashi -
March 19, 2010, at 09:29 PM by Shigeru Kobayashi -
Added lines 3-7:
!!!Hardware Definition for Arduino 0018
Download and unzip the following file as '''YOUR_SKETCH_FOLDER/hardware'''. After re-launch your IDE, you can find '''Arduino Fio''' in the '''Board''' menu. Otherwise, choose '''Arduino Pro or Pro Mini (8MHz)''' instead.

Attach:hardware_folder_for_fio.zip
Changed lines 43-44 from:
!!!! Uploading sketches from an Arduino IDE to a FIO board
# Choose '''Tools/Board/Arduino Pro or Pro Mini (8MHz)'''
to:
!!!! Uploading sketches from an Arduino IDE to a Fio board
# Choose '''Tools/Board/Arduino Fio''' or '''Tools/Board/Arduino Pro or Pro Mini (8MHz)'''
March 18, 2010, at 04:59 AM by Shigeru Kobayashi -
Added lines 11-13:

'''Reference:''' [[http://www.ladyada.net/make/xbee/arduino.html|Xbee Adapter - wireless Arduino programming by Ladyada]]
Changed lines 19-20 from:
Attach:XBeeExplorerUSBForFio.jpg
to:
%width=200px%Attach:XBeeExplorerUSBForFio.jpg
Added line 35:
March 18, 2010, at 04:55 AM by Shigeru Kobayashi -
Added lines 1-42:
!!Arduino Fio Programming

!!!Wired Programming
The Arduino Fio can be programmed with the Arduino software ([[Main/Software | download]]). For details, see the [[Reference/HomePage | reference]] and [[Tutorial/HomePage | tutorials]].

The ATmega328P on the Arduino Fio comes preburned with a [[Tutorial/Bootloader | bootloader]] that allows you to upload new code to it without the use of an external hardware programmer. It communicates using the original STK500 protocol ([[http://www.atmel.com/dyn/resources/prod_documents/doc2525.pdf | reference]], [[http://www.atmel.com/dyn/resources/prod_documents/avr061.zip | C header files]]).

You can also bypass the bootloader and program the ATmega328P with an external programmer; see [[Hacking/MiniBootloader | these instructions]] for details.

!!!Wireless Programming
You can upload sketches wirelessly. Make sure you are using a Series 1 (not 2 or 2.5) XBee module if you want to do wireless programming. Series 2 modules do not allow for automatic IO Line Passing (this is required for toggling the reset pin when programming). Also make sure that you have a recent version of the firmware (10A5 or later). If you need to upgrade your firmware, use X-CTU (Windows only, unfortunately). If you confirmed these points, please follow the following steps.

!!!!Modifying the XBee-to-USB adaptor
If you are using a XBee Explorer USB (SparkFun Electronics) or XBee starter kit (Adafruit Industries), solder in a tiny jumper between the RTS pin and D3 as following picture:

Attach:XBeeExplorerUSBForFio.jpg

!!!!Modifying the serial port settings (Windows only)
You have to make a slight change to the driver preferences. In the Device Manager, select the '''USB COM port'''. Then right click and select '''Properties'''. Click on the '''Port Settings''' tab, and click on '''Advanced...''', then make '''Set RTS On Close''' is selected and click '''OK''' to apply settings.

!!!!How to configure XBee modems
On Windows and Mac OS X, you can configure XBee modems with [[http://funnel.googlecode.com/files/XBeeConfigTool.zip | XBeeConfigTool]].

# Choose a proper serial port
# Choose a proper mode (Coordinator or End Devices)
# Choose a proper baud rate (57600bps)
# Set a proper PAN ID (e.g. 1234, should be same on both)
# Set a proper MY ID (e.g. 1, for end devices only)
# Press the Configure button to configure the XBee modem

%width=400px%Attach:XBeeConfigToolCoordinatorExample.jpg
%width=400px%Attach:XBeeConfigToolEndDevicesExample.jpg

!!!! Uploading sketches from an Arduino IDE to a FIO board
# Choose '''Tools/Board/Arduino Pro or Pro Mini (8MHz)'''
# Choose a proper serial port in '''Tools/Serial Port'''
# Write a sketch and press the Upload button

!!!Automatic (Software) Reset
Rather then requiring a physical press of the reset button before an upload, the Arduino Fio is designed in a way that allows it to be reset by software running on a connected computer. One of the pins on the six-pin header is connected to the reset line of the ATmega328P via a 100 nanofarad capacitor. This pin connects to one of the hardware flow control lines of the USB-to-serial convertor connected to the header: RTS when using an FTDI cable, DTR when using the Sparkfun breakout board. When this line is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino software uses this capability to allow you to upload code by simply pressing the upload button in the Arduino environment. This means that the bootloader can have a shorter timeout, as the lowering of the reset line can be well-coordinated with the start of the upload.

This setup has other implications. When the Fio is connected to either a computer running Mac OS X or Linux, it resets each time a connection is made to it from software (via USB). For the following half-second or so, the bootloader is running on the Pro. While it is programmed to ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few bytes of data sent to the board after a connection is opened. If a sketch running on the board receives one-time configuration or other data when it first starts, make sure that the software with which it communicates waits a second after opening the connection and before sending this data.

Share