Wiki

Clone wiki

Panels / Quick_Start

Home | User Guide | Quick Start | Troubleshooting | Performance | Old Panels Info | Panels Hardware

AVR Studio 4 Directions.

To get up and running quickly you will need to download the following:

  1. 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.
  2. download WinAVR and install it.
  3. 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, you can download FTDI driver here.
  4. install bootloader on the controller
    1. download the bootloader for the controller.
    2. connect AVRISP to the controller board
    3. open AVR studio, press the avr button
    4. in the main tab, choose ATXmega128A1
    5. in the fuses tab, choose boot loader reset for the BOOTRST and press program button
    6. in the program tab, choose the boot loader hex file in the flash frame and then press program button
  5. program the controller using AVRDude
    1. check out the panel controller souce code from the repository
      or you can just download the panelcontroller.hex and flash1152.bat and save them in the same folder
    2. 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 doubleclick the flash1152.bat icon, this should open up a command window and the hex file will be downloaded
  6. 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');
  7. open matlab, setup PControl, run test (blink LED, stream a function, etc).
  8. program some panels(including bootloader)
    1. Check out the panel bootloader and application source codes from svn repositories.
      or you can also only download the boot loader, panel.hex, and panel.eep.
    2. Once the panel is in place, connect the programming device to the 6 pin header, labelled Panel ISP.
    3. Open AVR Studio and start the AVR programming tool STK500/AVRISP from the tools menu.
    4. 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.
    5. Press Erase Device to make sure no code in the flash memory
    6. 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
    7. Program the bootloader. Go to the program tab, and choose panel_bl.hex for flash. Program it.
    8. 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
    9. 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.
    10. Once a panel is programmed it needs to be addressed, this is done using the PControl software.

Note: 1. 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 as panel_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

2. 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:

  1. 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.
  2. 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.
  3. 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)
  4. If successfully read, move on, otherwise check the connections, restart, etc.
  5. In the Interface settings pane, drag ISP Clock to 250 kHz, click "Set".
  6. In the Memories pane, Click "Erase Device" to make sure there's no code in the flash memory.
  7. 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".
  8. 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.
  9. 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.
  10. 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.
  11. 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.

Programming New (V3.0) Controllers

  1. Download and install avrdude and WinAVR.
  2. Download the latest panelcontroller.hex from downloads and flash1152.bat to the same directory.
  3. Connect the controller to power and its usb to the computer.
  4. 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.
  5. Be sure the COM port listed in the bat file downloaded matches the com port seen in the device manager. If not, change it.
  6. Using the command prompt, change directory (cd) to where the hex and bat files were downloaded.
  7. 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. note: a flash card may be needed to program the controller.

Updated