AVR (ATtiny85) Installation & Programming Guide (this worked for me!):

  • Using Win7 64bit get this Driver for the ‘Sparkfun AVR Pocket Programmer’. Make sure you have the ‘Sparkfun AVR Pocket Programmer’ connected via USB to your PC and remember the usb port, as you should always connect the ‘Sparkfun AVR Pocket Programmer’ to the same port. That probably was the reason why I had to install it several times until my PC recognized the ‘Sparkfun AVR Pocket Programmer’. If you got the “rc=-1 error“, there is something wrong with the driver or in finding the right USB port. It might as well be a wrong wiring of the ATtiny!
  • Further install AVRDude/WinAVR. Here an overview about drivers and software.
  • Besides WinAVR you can directly programm AVRs out of the Eclipse IDE with the following plugin.
  • REALLY TRIPLE CHECK THE WIRING of the ATtiny85 according to the data sheet, tutorials (1, 2, 3, 4, 5, 6) and this fritzing scheme. More details in the next post.
  • Setting up an AVR project: In the Eclipse Project Explorer do ‘New > Project > C-Project > AVR Cross Target Application > Empty Project (notice the AVR-GCC Toolchain) > Select ATtiny85 as AVR Target Hardware Properties.’
  • Make a new C-File and copy some ‘Blink’ test code or write some code on your own. A look into the AVR Library Reference ain’t wrong, too! As well as knowing how the bit manipulation operators in c-code work.
  • Compile your C-Files. In Eclipse just go to ‘Project > Build All’. With the consol use following commands. Make sure to be in the right directory of the C-File, which you want to compile etc.
  • Uploading/Flashing the HEX-File onto the ATtiny85 worked with the AVR Eclipse Plugin and adjusting following project preferences: Select your C-Project and then go on ‘File > Properties > AVR > AVRDude > Programmer > Programmer configurations > new > Select USBtiny simple USB programmer’ as the Programmer Hardware and select your new Programmer in the programmer configuration drop down menu. Right next to the ‘Programmer’ tab go on the ‘Flash/ EEPROM’ Tab and select ‘from flash memory image file’ for the ‘Upload Flash Memory Image’. Now browse and select the according HEX-File. Make sure the right project is still selected and go on ‘AVR > Upload Project to Target Device’. Should work, good luck!
Advertisements