09-21-2007 09:41 AM
09-21-2007 10:06 AM
09-21-2007 10:20 AM
06-30-2008 12:53 PM
07-01-2008 04:37 PM
07-07-2008 01:41 AM
hi ,
you means batch file error code? I have used this .bat file for download.
based batch file:
@rem Drive a Atmel AVRISP connected to serial port specified in first command line parameter
@rem to load software into a R3048 Secondary Control board containing an ATmega32
@cls
@title Programming NPR Secondary Control Board
@rem Load S/W specified in second command line parameter
@echo Programming NPR Secondary Control Board ATmega32 uC with %2
@echo.
@rem stk500.exe -c%1 -ms -dATmega32 -if%2 -e -pf -vf -f0xC43F -l0xFF
@stk500.exe -c%1 -ms -dATmega32 -if%2 -e -pf -vf -f0xC41F -l0xFF
@rem -c Com Port
@rem -ms Mode Serial
@rem -d.. Device = ATMega32
@rem -if.. In Flash file
@rem -e Erase
@rem -pf Program Flash
@rem -vf Verify Flash
@rem
@rem -f Program Flag bits
@rem 0xCF1F = b 1 1 0 0 0 1 0 0 0 0 1 1 1 1 1 1
@rem |15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
@rem | | | | | | | | | | | | +--+--+--+-- CKSEL3-CKSEL0 (Clock Select)
@rem | | | | | | | | | | +--+-------------- SUT1 - SUT0
@rem | | | | | | | | | +-------------------- BODEN (Brown Out Dectection Enable [0 Enable, 1 Disable])
@rem | | | | | | | | +----------------------- BODLEVEL (Brown Out Dectection Level [0 = 4.0V, 1 = 2.7V])
@rem | | | | | | | +-------------------------- BOOTRST (Boot Loader Support [1 start at $0000, 0 start in bootloader])
@rem | | | | | +--+----------------------------- BOOTSZ1 & BOOTSZ0 (Boot loader size [00=2048words, 01=1024words, 10=512words, 11=256words])
@rem | | | | +----------------------------------- EESAVE (Preserve EEprom during erase cycle [0 Preserve, 1 Do not Presesve])
@rem | | | +-------------------------------------- CKOPT (0 Full rail-to-rail output swing)
@rem | | +----------------------------------------- SPIEN (SPI Programming interface Enable [0 Enable, 1 Disable])
@rem | +-------------------------------------------- JTAGEN (JTAG Enable [0 Enable, 1 disable])
@rem +----------------------------------------------- OCDEN (On Chip Debug Enable [0 Enable, 1 Disable])
@rem Flag bits specify use of external crystal oscillator at nominal 4 MHz with Brown-out detection enabled
@rem -l Program Lock bits
@rem |07|06|05|04|03|02|01|00|
@rem | | | | | | +--+-------------------------- LB2 & LB1 (Flash Lock Bits)
@rem | | | | +--+-------------------------------- BLB02 & BLB01 (Boot0 Lock Bits)
@rem | | +--+-------------------------------------- BLB12 & BLB11 (Boot1 Lock Bits)
@rem +--+-------------------------------------------- Unused Set to 1
@rem returns an errorlevel of 0 on success and 1 for an error
@echo.
@echo.
@echo.
@if ERRORLEVEL 1 goto failed
@echo.======================================================================
@echo.=====================PROGRAMMING SUCESSFUL============================
@echo.======================================================================
@rem Dummy stream operation to ensure ERRORLEVEL is set to 0
@ver > NUL
@goto end
:failed
@echo.**********************************************************************
@echo.*********************PROGRAMMING FAILED!!!!!**************************
@echo.**********************************************************************
@rem Dummy copy to ensure ERRORLEVEL is set to 1
@copy nonexistantFile.txt \\computer\share\file.txt > NUL
:end
@echo.
your app batch file:
@rem Replace x.xx with actual version number of file to use and if necessary qualify path
@call "APRApplicationLoad for ATmega32.bat" USB "........ .a90"
echo %errorlevel% > result.txt
07-07-2008 02:19 AM
07-07-2008 06:21 PM