AVR Studio 4 Directions
To get up and running quickly you will need to download the following:
- download and install AVR Studio (you need to register before you can download the latest version from Atmel website). You can also download the AVR studio 4.18 from AVR studio without registration.
- download WinAVR and install it.
- connect the panel controller box to the pc via USB cable (this will trigger the download of the USB serial driver if not already loaded). If your PC fail to find the driver, use our copy of the FTDI driver.
- install bootloader on the controller
- download the bootloader for the controller.
- connect AVRISP to the controller board
- open AVR studio, press the avr button
- in the main tab, choose ATXmega128A1
- in the fuses tab, choose boot loader reset for the BOOTRST and press program button
- in the program tab, choose the boot loader hex file in the flash frame and then press program button
- program the controller using AVRDude
- check out the panel controller source code from the repository or you can just download the
panelcontroller.hex
and flash1152.bat and save them in the same folder - flash the hex file to the panel controller
- goto the Device Manager on the PC and identify the COM port used by the USB serial driver
- edit the
flash1152.bat
file and change the avrdude port argument to the correct port (default is-P COM5
) - turn on the panel controller hardware, the rightmost LED will turn on. Within 3 seconds double-click the
flash1152.bat
icon, this should open up a command window and the hex file will be downloaded
- check out the panel controller source code from the repository or you can just download the
- format SD card (supposing the SD disk drive is E) use dos command:
format E: /Q/FS:FAT32/A:32K
or use matlab:dos('format E: /Q/FS:FAT32/A:32K');
- open matlab, setup PControl, run test (blink LED, stream a function, etc).
- program some panels (including bootloader)
- Check out the panel bootloader and application source codes from the repositories. Alternatively you can only download the boot loader,
panel.hex
, andpanel.eep
. - Once the panel is in place, connect the programming device to the 6 pin header, labelled Panel ISP.
- Open AVR Studio and start the AVR programming tool STK500/AVRISP from the tools menu.
- Test the connection by selecting the Atmega168 device from the drop-down menu, and then try to read signature. If these match, move on, otherwise check the connections, restart, etc.
- Press Erase Device to make sure no code in the flash memory
- Program the fuses - this is done from the Fuses tab - these options should be set:
- BOOTSZ choose Boot Flash size = 1024 words start address = $1C00
- BOOTRST
- EESAVE[
- BODLEVEL choose Brown-out detection at VCC = 4.3V
- SUT_CKSEL Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 16K CK/14 CK+65MS
- Program the bootloader. Go to the program tab, and choose
panel_bl.hex
for flash. Program it. - Program the panel codes.
- make sure uncheck “Erase device before flash programming” because it will erase the bootlader if checked.
- select the
panel.hex
as input Hex File for Flash and program it - select the
panel.eep
as input Hex file for EEPROM and program it
- If this is all done correctly the LED should display 127 and the display should be bright with no flicker. If it appears dull or flickery - the clock was probably not set correctly. It is always a good idea to verify both the program and the fuses to make sure these are set correctly.
- Once a panel is programmed it needs to be addressed, this is done using the PControl software.
- Check out the panel bootloader and application source codes from the repositories. Alternatively you can only download the boot loader,
AVR Studio 4 Note
- A combined version, which include both the bootloader and panel code, can be download here. You can also build the combined hex file with the following steps.
- open
panel.hex
with Notepad++ and save it aspanel_combined.hex
- delete the last line:
00000001FF
- open
panel_bl.hex
with Notepad++ - select all contents in the
panel_bl.hex
and then copy - paste the binary code to the end of the
panel_combined.hex
- save the file and the
panel_combined.hex
is ready
- open
- It is easier to use the auto feature in order to program multiple panels
AVR Studio 5 Directions
For AVR studio 5, the directions differ slightly. The software is all still free except for matlab, with registration, and can be found on each company’s website.
First download and install the following:
- AVR Studio 5
- FTDI Driver - For USB to Serial COM Port.
- Make sure the panel controller is recognized as COM3 in Device Manager and PControl (MATLAB). Disconnect the cable between I2C on the the panel controller and the arena.
- Connect the programming device to the 6 pin header, labelled Panel ISP, in the left corner of the panel controller front panel. Connect a LED panel to the ISP port just below Panel ISP with a ribbon.
- Open AVR Studio 5 and select Tools → AVR Programming. In the dialog box, select Tool → AVRRSP mkII (or other ISP device), Device → ATmega168A (or ATmega168), Interface → ISP. Click Apply, then Read, Read for Device ID and Target Voltage. (Target voltage should be 5.0 V)
- If successfully read, move on, otherwise check the connections, restart, etc.
- In the Interface settings pane, drag ISP Clock to 250 kHz, click Set.
- In the Memories pane, Click Erase Device to make sure there’s no code in the flash memory.
- Program the fuses - this is done from the Fuses pane - these options should be set:
- BOOTSZ choose 1024W_1C00
- BOOTRST
- SPIEN
- EESAVE
- BODLEVEL choose 4V3
- SUT_CKSEL choose EXTFSXTAL_16KCK_14CK 65MS
- Click Program. The info pane should say “Verify fuses…OK”.
- Program the panel codes.
- Go to the Memories pane.
- make sure to uncheck Erase device before programming.
- select the
panel_combined.hex
as input Hex File for Flash and program it - select the
panel.eep
as input Hex file for EEPROM and program it - The info pane should say OK.
- If this is all done correctly the LED panel should display 127 and the display should be bright with no flicker. If it appears dull or flickery - the clock was probably not set correctly. It is always a good idea to verify both the program and the fuses to make sure these are set correctly. Sometimes the Fuses settings change randomly after a panel is programed and need to be re-entered.
- Once a panel is programmed it needs to be addressed, this is done using PControl in MATLAB. If PControl can’t change the panel address, exit PControl, turn the panel controller off and on, then restart PControl.
- One needs to keep in mind the two different batches of panels from 2007 and 2011 have different maximum brightness and it would be best not to mix them in the same arena.
Atmel Studio 7 Directions
- install bootloader and firmware on the controller
- download the bootloader for the controller.
- connect AVRISP to the controller board (see image).
- open Atmel studio 7, click Tools → Device programming to open the Device programming window.
- Choose AVRISP MKII in Tool, choose ATxmega128A1 in Device. Interface PDI, click Apply button
- Click Read button, you can get the Device signature and Target Voltage
- In the fuses tab, choose boot loader reset for the BOOTRST and press program button
- In the memories tab, choose the boot loader hex file in the flash frame and then press program button, refer to the image.
- Choose the
panelcontroller.hex
Rev1.3 in the flash frame and uncheck the erase flash before programming. Press program button.
Programming New (V3.0) Controllers
- Download and install avrdude and WinAVR
- Download the latest
panelcontroller.hex
and flash1152.bat to the same directory. - Connect the controller to power and its usb to the computer.
- Using the windows device manager, determine the COM port the controller is listed under. If the controller is not listed under any com ports, right click on the device and point the prompt to the FTDI Driver.
- Be sure the COM port listed in the bat file downloaded matches the com port seen in the device manager. If not, change it.
- Using the command prompt, change directory (cd) to where the hex and bat files were downloaded.
- In quick succession: turn the controller off, then on, and run the bat file, this should program the controller. If this fails, try changing the time between switching the controller on and running the bat file.
Atmel Studio 7 Note
a flash card may be needed to program the controller.