
License
=======

SMchange.exe is Copyright (c) 2012 SlicMicro LLC, all rights reserved.

This program may not be distributed or sold in any way.  You cannot distribute
this program on media or on a web site without the permission of SlicMicro LLC.
Links to the SlicMicro.com A2P2 product page may be provided to allow others 
to access this program.


What does SMchange.exe do?
==========================

This program allows you to change the firmware running on the A2P2 programmer.

The A2P2 has a bootloader that allows you to overwrite the firmware on the
device.  This bootloader is entered by pressing and holding the button on
A2P2 while it is being plugged into the USB port.  This program sends
the firmware file to the bootloader, which then programs the firmware into
the microcontroller on the A2P2 programmer.

For example, you can change the A2P2 programmer from emulating a PICkit2
to emulating a AVRispMark2 and vice versa.

Microchip provides the complete source for the PICkit2 programmer (A2P2 is
hardware compatible with the PICkit2) so you may wish to develop your
own firmware "personalities" to reconfigure the hardware for different uses.
You can then use SMchange.exe to change the A2P2 to use your firmware.


Operation
=========

SMchange.exe is a stand alone application that will not write to your
registry or alter your PC in any way.  It has been tested with Windows XP
and Windows 7 (should also work with Windows Vista). 

1) ensure that the *.hex file you wish to load onto A2P2 is in the same
   directory as the SMchange.exe program
2) while holding the A2P2 button pressed plug the A2P2 into the USB
   port of your computer
3) launch SMchange.exe
4) click the Quick Change button corresponding to the .hex file you
   wish to load onto A2P2. SMchange.exe will then do:
     - erase device (excluding bootloader)
     - program device with hex file just clicked
     - verify device against hex file
5) when completed (status window turns green), first disconnect the
   A2P2 from the USB port, then exit the SMchange.exe application
   by clicking the "X" in the top right corner of the window.
6) wait 5 seconds to allow Windows time to discover that the USB device
   has been unplugged, then plug the A2P2 back into the USB port
   and use it as the personality that you just programmed into it.


Notes
=====

  - A2P2 comes pre-programmed with the AVRispMk2 emulation firmware
    loaded but the version distributed along with SMchange on the
    A2P2 product page may be a newer release.  Update to the
    latest release of a2p2_AVRispMk2.hex if you have issues.
  - the SMchange program will also work with the Microchip PICkit2 
    programmer in addition to the SlicMicro A2P2
  - hex files developed for A2P2 will work on the PICkit2
    since the hardware is compatible, however the PICkit2
    doesn't have the XLED indicator so this visual indicator
    will not be available if used in the .hex firmware file
  - you can rename the .hex files to change the order they appear
    in the Quick Change buttons.  They appear alphabetically so
    preceding the hex file name with 0_  and 1_ etc. is one way
    to control the order that they appear.
  - you can use the two step method to load a hex file if the
    5 button slots are exceeded.  This method doesn't require
    that the .hex files be in the same directory as SMchange.exe
  - you can create a shortcut to SMchange.exe on your desktop for
    easy access and store the folder containing SMchange and the
    firmware .hex files elsewhere on your hard drive
  - the PICKit2 .hex file distributed with this program was
    compiled by SlicMicro.  Firmware available at
    microchip.com/pickit2 will also work.
  - rapidly unplugging and plugging devices into a USB port can
    cause the USB port to either hang, making the device not appear to the
    operating system, or, cause blue screens.  
  - Not related to SMchange but noted here for completeness:
    When using a "real" AVRispMk2 programmer or A2P2 emulating the AVRispMk2,
    the combination of the Atmel Jungo USB driver and the open
    source libusb driver (used by the Arduino environment and the
    open source AVRdude) has been known to cause issues.  We 
    recommend only installing one or the other to avoid odd 
    behaviour.  If you must have both, you can install the filter driver
    version of libusb but we have had mixed success with that solution (but
    it continues to improve over time).  
    See  http://libusb.org/wiki/libusb-win32 for more details.


