Vous êtes sur la page 1sur 6

www.domko.

ru

www.electronshik.ru

Arduino Fio Programming


The ATmega328P on the Arduino Fio comes preburned with a bootloader that allows you to upload new code to it without the use of an external hardware programmer. It communicates using the original T!"## protocol $reference% & header files'. There are two ways you can upload new s(etches to the Arduino Fio) you can use an FT*I + ,-to-serial cable% or + ,-to-serial adaptor board. or you can program it wirelessly% o/er a pair of 0,ee radios. If you1re new to the 0,ee radios% it1s helpful to (now a bit about them before attempting the wireless programming. This introduction may help. 2ou can also bypass the bootloader and program the ATmega328P with an external programmer. see these instructions for details. Wired Programming 3I(e all Arduino boards% the Arduino Fio can be programmed with the Arduino software $download'. If you1re new to Arduino% see the 4etting tarted 4uide % the reference and tutorials. The Fio does not ha/e a built-in + ,-to-serial adaptor% so if you1re going to program it o/er + ,% you1ll need an adapter. 5ither of these will wor( well)

FTDI 3.3V cable, available from Adafruit.com Sparkfun's FTDI Basic Breakout adaptor. T is as t e same pin confi!uration as t e FTDI cable To program the Fio using either FT*I cable or an adaptor with the same pin configuration% attach a row of male pin headers to the cable or adaptor li(e so)

Then connect the headers to the FT*I pins on the Fio)

"sin! t e adaptor to pro!ram a Fio "sin! t e FTDI cable to pro!ram a Fio

These are alternati/e ways to program a Fio with a 3-shaped plug and low-profile soc(ets)

"sin! a #$s aped plu! and soldered lo%$profile sockets to pro!ram a Fio

"sin! a #$s aped plu! %it out soldered lo%$profile sockets to pro!ram a Fio

If your headers don1t fit snugly in the holes $and most won1t'% you should hold the connector firmly so that the metal of the pins touches the metal of the holes while you1re programming. 6hen your cable is connected to the Fio% open the Arduino programming en/ironment% choose Fio from the Tools-->Board menu. Then choose your serial port from the serial port menu% and you1re ready to program If you1re using the FT*I adaptor% you1ll see the T0 and 70 lights flic(er. 2ou won1t see any /isible sign on the Fio% but you will see the following in the I*5 when you1/e successfully uploaded code)

NOTE: Please remo/e a 0,ee modem from a Fio board while uploading s(etches.

Wireless Programming T is tutorial borro%s from &bee Adapter $ %ireless Arduino pro!rammin! b' #imor Fried In order to upload s(etches wirelessly using 0,ee radios% you1ll need the following)

two XBee or XBee Pro 802.15.4 XBee modules. These are also (nown as eries 8 modules% for those who1/e wor(ed with 0,ees for awhile. 2ou can1t use the *igi9esh or :, series radios $a(a eries 2 or 2."'. Those modules do not allow for automatic I; 3ine Passing that is re<uired for toggling the reset pin when programming. a re e!t "ersio! o# t$e 802.15.4 #irmware %10&5 or later'. If you need to upgrade your firmware% you need to use 0-&T+ $6indows only% unfortunately'. If you confirmed these points% please follow the following steps. a ()B-to-serial ada*tor for one of the modules. 2ou can use par(fun1s 0,ee 5xplorer + , or Adafruit1s 0,ee Adapter (it or any other FT*I-to-0,ee adaptor.

Modifying the XBee-to-USB ada tor ;n your + ,-to-serial adaptor% solder in a tiny =umper between the 7T pin and *3 as shown here)

(odified &Bee )*plorer "SB

(odified Adafruit &Bee Adapter +it T e arro% s o%s t e added solder connection

Pre aring the XBee radios In order to program the Fio wirelessly% you need to configure two 0,ee 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. ;nce you1/e done that% you1ll program the Fio using the radio lin( =ust li(e a normal Arduino + ,-to-serial lin(. The settings for the two radios are as follows) Parameter Pro+rammi!+ ,adio ,* I* 92 > $Atmega8?8' or ? $Atmega328' user1s preference $#### to FFFF' +ser1s preference% e.g. #### Fio ,adio > $Atmega8?8' or ? $Atmega328' user1s preference $#### to FFFF' user1s preference% e.g. ###8

*3 *3 I& 77 I+
IA RO

FFFF or Fio1s 92 /alue 3 8 3 not set not set 8#

programmer1s 92 /alue " not set not set # FFFF 8#

Note: If you set the programmer1s destination address $*3' to FFFF% it will re-program all Fios in its PA@ I*. To program one Fio at a time wirelessly while others are on% set the programmer1s *3 to that Fio1s 92 address. Modifying the serial ort settings !Windows only" If you1re running 6indows% you ha/e to ma(e a slight change to the dri/er preferences. In the *e/ice 9anager% select the ()B -O. *ort. Then right clic( and select Pro*erties. &lic( on the Port )etti!+s tab% and clic( on &d"a! ed...% then ma(e )et ,T) O! -lose is selected and clic( O/ to apply settings. #ow to configure XBee modems 2ou can configure your radios using a terminal application% or using 0-&T+ on 6indows% or you can use the Fio 0,ee &onfig Tool. This is a modified /ersion of higeru !obayashi1s 0,ee&onfigTool. Using Arduino Fio X$ee%onfig&ool 8. &hoose a proper serial port 2. &hoose a proper mode $Programmer or Fio' 3. &hoose a proper baud rate $"A?##bps' >. et a proper PA@ I* $e.g. 823>% should be same on both' ". et a proper 92 I* $e.g. 8% for end de/ices% # for programmer' 6. Press the &onfigure button to configure the 0,ee modem

%onfiguring the radios using a serial terminal a

lication

If you prefer to set your settings manually% you can set them using any erial terminal application% such as &oolTerm. &onnect the adapter to your computer% and open its serial port at B?## bps using your fa/orite serial terminal application. et your terminal application1s termination string to be a carriage return $A &I #x#*' only. Then open the port% and type)
+++

The 0,ee will respond)


OK

For the programmer radio% type)


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

The 0,ee 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 0,ee will respond)


OK

OK OK OK OK OK OK OK OK OK

That1s itC @ow connect the Fio radio to your Fio% lea/e the programming radio in the 0,ee adapter% and you1re ready to upload s(etches to your Fio.

U loading sketches from an Arduino '() to a Fio $oard +ploading s(etches to the Fio is similar to other Arduino boards.

1. &hoose Tools0Board0&rdui!o Fio or Tools0Board0&rdui!o Pro or Pro .i!i %8.12' 2. &hoose a proper serial port in Tools0)erial Port
3. 6rite a s(etch and press the +pload button As you upload% you should see the green 7 I light on the Fio light up. If you1re using an 0,ee 5xplorer% you1ll also see the T0 and 70 lights on it flic(er as the s(etch uploads. If the Fio does not respond% here are the most common causes of error) 8. ma(e sure the Fio is powered. 2ou can use + , power if you don1t ha/e a battery. 2. ma(e sure the slider switch on the Fio is turned ;@ 3. &hec( your radio configurations. *id you miss a settingD This is particularly common if you confgured them using a serial terminal application. 6hen in doubt% chec( the Fio by programming it o/er a wired connection as described abo/e.

Vous aimerez peut-être aussi