@ECHO OFF

REM Version History
REM 1.030 8/30/2011 Intitial Release 
REM 1.033 1/11/2012 Various Updates

SET FL_HEX="ICHEM_v1.060.a90"

COLOR 17

ECHO ************************************************************************
ECHO **  PENTAIR                                                           **
ECHO **  INTELLICHEM CHEMICAL CONTROLLER FIRMWARE UPDATE v1.060            **
ECHO ************************************************************************
ECHO **IMPORTANT NOTES!                                                    **
ECHO **  1. Please install the USB programmer driver before updating       **
ECHO **     the IntelliChem chemical controller firmware                   **
ECHO **  2. WinXP users be sure you are running at least service pack 3    **
ECHO **     or the programmer will not function properly                   **
ECHO ************************************************************************

CD C:\Pentair\IntelliChem

Pause

REM ***********************************************************
REM ** Use this if it does not recognise the USB device name **
REM ** and then replace \\.\USBSER000 with COM%PORT%         **
REM ***********************************************************
REM ECHO What com port is your USB programmer connected to?
REM ECHO Please enter a number 1-75
REM SET /p PORT= COM:

avrdude -p m128 -P \\.\USBSER000 -c avrisp2 -B 3 -e -U flash:w:%FL_HEX% -U efuse:w:0xFF:m -U hfuse:w:0xD7:m -U lfuse:w:0x1F:m -U lock:w:0x00:m

pause
