1) The only thing that needs to be installed for this to work is WinAVR, as I understand it. This installs to the default location and is added to the execution path so it will work properly. (Note that I have not tested without AVR Studio installed.)
2) The two batch files and the program file xxx.c should be in the same directory.
3) The USB driver for the AVRISPmkII needs to be the one provided in WinAVR, as discussed above.
That's it.
It seems like the 3 files would need to be in a specific directory of the WinAVR install so it knows where to find the needed files...but just for the heck of it, I reinstalled WinAVR (again) on this PC, put all 3 files into a new folder C:\Alan and ran the compile.bat without having made any changes to the c file you sent. Got this in the DOS window:
Code:
C:\Alan>avr-gcc.exe -mmcu=attiny45 -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT HotwireRegulator.o -c HotwireRegulator.c
HotwireRegulator.c:192:3: warning: #warning INFO - SN108 Osram 64623, 5 A123 cells, full features, slow start, no max
HotwireRegulator.c:826:3: warning: #warning INFO - Bulb Type Osram 64623 12V 100W (16.0V)
HotwireRegulator.c:897:2: warning: #warning INFO - Lithium Ion Iron Phosphate chemistry selected
HotwireRegulator.c:926:3: warning: #warning INFO - Low Battery Protection Override using Specified Voltage
HotwireRegulator.c:986:6: warning: #warning INFO - REV2E board
HotwireRegulator.c:997:3: warning: #warning INFO - CPU is ATTiny45
HotwireRegulator.c:1070:6: warning: #warning INFO - 26V 6S range selected (J1 REMOVED)
HotwireRegulator.c:1088:6: warning: #warning INFO - RMS AC+DC Meter Calibration value used
HotwireRegulator.c:1368:3: warning: #warning INFO - Lockout stored in EEPROM Enabled
HotwireRegulator.c:1429:3: warning: #warning INFO - Lockout Mode Feature Enabled
HotwireRegulator.c:1443:4: warning: #warning INFO - Lockout Mode Basic Flashlight Enabled
HotwireRegulator.c:1469:3: warning: #warning INFO - QuadClick to Change Interface Modes (when ON, goes OFF)
HotwireRegulator.c:1497:3: warning: #warning INFO - DoubleClick to Max Voltage Feature Enabled
HotwireRegulator.c:1510:3: warning: #warning INFO - TripleClick to Middle Voltage Feature Enabled
HotwireRegulator.c:1553:3: warning: #warning INFO - Level Memory Feature Enabled at turn-on
HotwireRegulator.c:1569:3: warning: #warning INFO - MultiLevel Stepping Feature Enabled
HotwireRegulator.c:1607:3: warning: #warning INFO - Varilevel Ramping Feature Enabled
HotwireRegulator.c:1667:3: warning: #warning INFO - Mean-Squared Voltage Regulation Feature Enabled
HotwireRegulator.c:1763:3: warning: #warning INFO - Low Battery Protection Feature Enabled
HotwireRegulator.c:1778:3: warning: #warning INFO - OverTemperature Shutdown Feature Enabled
HotwireRegulator.c:1879:3: warning: #warning INFO - Low Standby Current Feature Enabled
C:\Alan>avr-gcc.exe -mmcu=attiny45 -Wl,-Map=HotwireRegulator.map HotwireRegulator.o -lm -o HotwireRegulator.elf
C:\Alan>avr-objcopy -O ihex -R .eeprom HotwireRegulator.elf HotwireRegulator.hex
C:\Alan>avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex HotwireRegulator.elf HotwireRegulator.eep || exit 0
Press any key to continue . . .
Alan, I uninstalled both AVR Studio and WinAVR. Not sure if that uninstall removed USB drivers. Step One: Re-installed WinAVR and ran file:
Now I will install AVR Studio and do it againCode:C:\WinAVR-20090313\bin>avrdude -c avrisp2 -p t45 -P usb:xx -v avrdude: Version 5.6, compiled on Mar 5 2009 at 09:59:30 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ System wide configuration file is "C:\WinAVR-20090313\bin\avrdude.conf" Using Port : usb:xx Using Programmer : avrisp2 avrdude: usbdev_open(): did not find any (matching) USB device "usb:xx" C:\WinAVR-20090313\bin>@pause
Edit: Done, and same result. Also running that on computer that AVR Studio runs on gives same result.
In true noob style, I should note that in running my earlier post above looking for the USB driver, I did not plug my AVRISP2 device into my PC (? via a powered flashlight) when I ran that batch file because...well....you didn't say to, and I thought you were just looking to see if it found some driver feedback.
Code:
batch file:
avrdude -c avrisp2 -p t45 -P usb:xx -v
@pause
Just now, on this same problematic PC, I plugged in device, and cancelled Windows auto-driver install. Went to Device Manager; right clicked on Yellow USB flagged device, and updated driver navigating as your later quote said:
Code:
C:\WinAVR-20090313\utils\libusb\bin\
Then I re-ran the batch file with unpowered USB AVRISP2 device plugged in (green USB LED blinks on insertion, but no continuous LED glows on unpowered device) and got this:
Code:
C:\WinAVR-20090313\bin>avrdude -c avrisp2 -p t45 -P usb:xx -v
avrdude: Version 5.6, compiled on Mar 5 2009 at 09:59:30
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is "C:\WinAVR-20090313\bin\avrdude.conf"
Using Port : usb:xx
Using Programmer : avrisp2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000B0042093
avrdude: usbdev_open(): did not find any (matching) USB device "usb:xx"
C:\WinAVR-20090313\bin>@pause
Last edited:
