1 | How do I download an application into an ATxmegaA1 Xplained board using the UART-to-USB gateway?
|
2 | Answer
|
3 |
|
4 | Prerequisites:
|
5 | You will need the following:
|
6 |
|
7 | 1. The Flip Utility (you can download from here):
|
8 | http://www.atmel.com/tools/FLIP.aspx?tab=overview
|
9 |
|
10 | 2. The AVR1927 Application note and software bundle.
|
11 | These can be downloaded from here:
|
12 | Appnote:
|
13 | http://www.atmel.com/Images/doc8372.pdf
|
14 | Software Bundle:
|
15 | http://www.atmel.com/Images/AVR1927_XMEGA-A1_Xplained_Example_Applications.zip
|
16 |
|
17 | Procedure:
|
18 |
|
19 | 1. Install Flip Utility
|
20 | 2. Unzip software bundle.
|
21 |
|
22 | 3. Copy a file from the software bundle to the Flip Software.
|
23 | (This will create an ATxmega128A1 device in the selection menu in Flip)
|
24 | Note: An ATxmega128A1U device already exists.
|
25 |
|
26 | Copy the software bundle file <AVR1927 install dir>\Bootloader\ATxmega128A1.xml
|
27 | to the following Flip Utility directory C:\Program Files\Atmel\Flip 3.4.5\bin\PartDescriptionFiles\
|
28 |
|
29 |
|
30 | 4. Power up the ATxmegaA1 Xplained board using a USB cable.
|
31 | (note: the Virtual com port should enumerate in the Devices manager of windows)
|
32 | (note: when the Virtual com port enumerates write down the com port used)
|
33 | (note: To enable the bootloader in the ATxmega128A1 you need to hold down switch 0 (SW0)
|
34 | while powering up the xplained board with the USB cable.)
|
35 |
|
36 | 5. Open the Flip Software
|
37 | a. Select the ATxmega128A1 device
|
38 | b. Select RS232 and the COMx port you wrote down above
|
39 | c. Select 115200 baud rate and press connect button.
|
40 |
|
41 | d. Select the following file to download (or your own hex file):
|
42 | <AVR1927 install dir>\Script\xmega-a1_xplained-demo.hex
|
43 | by selecting file> load hex file; in the Flip menu bar
|
44 | e. press run and the hex file should download.
|
45 |
|
46 | --------
|
47 |
|
48 |
|
49 | As an alternative you can use a command line batchISP utility to download the hex file.
|
50 |
|
51 |
|
52 | Procedure:
|
53 | 1. Goto the <AVR1927 install dir>\Script\ directory and edit the following two files, batchisp_cmd.bat
|
54 | and commands.txt as described below.
|
55 |
|
56 |
|
57 | To avoid setting environment variable in windows
|
58 | Edit batchisp_cmd.bat to match this printout:
|
59 |
|
60 |
|
61 | REM ----- Start
|
62 | C:\"Program Files\Atmel\Flip 3.4.5\bin\batchisp" -cmdfile commands.txt
|
63 | pause
|
64 | REM ----- End
|
65 |
|
66 | Edit commands.txt to match this printout:
|
67 |
|
68 | #---- Setup for ATxmega128A1
|
69 | -device ATXMEGA128A1
|
70 | -hardware RS232
|
71 | -baudrate 115200
|
72 | -port COM4
|
73 |
|
74 | #---- Load a HEX file
|
75 | -operation
|
76 | ONFAIL ABORT
|
77 | ASSERT PASS
|
78 |
|
79 | echo "Load HEX file:"
|
80 | ERASE F
|
81 | BLANKCHECK
|
82 | MEMORY FLASH
|
83 | LOADBUFFER xmega-a1_xplained-demo.hex
|
84 | PROGRAM
|
85 | VERIFY
|
86 | START
|
87 | RESET 0
|
88 | #-----------
|
89 |
|
90 | 3. Open a windows command shell change directories to <AVR1927 install dir>\Script\
|
91 | execute the command:
|
92 | batchisp_cmd.bat
|
93 |
|
94 | This should perform the same actions done with the Flip utility above.
|