Archives for category: Preliminaries

In order to use an ATtiny85 as an AVRFID, it is necessary to know the exact inner workings of these microcontrollers.


For I/O-operations the pins (2=PB3, 3=PB4, 5=PB0, 6=PB1, 7=PB2) can be used. The configuration of the ports is affected by the three 8-bit registers PORTB (data register), DDRB (data direction register) and PINB (port input pins):

Read the rest of this entry »


First of all I emphasize that unfortunately none the following attempts of reprogramming fused AVRs was successful in my case. Therefore this is more a personal documentation of what did not work, rather than a tutorial on how to get AVRs reprogrammed.

The general problem is, that once the fuse bits of an AVR are set to except an external clock source, the AVRs can in theory only be reprogrammed when they have that external clock source during the reprogramming process as well. In practice it is much more complicated.

Read the rest of this entry »

I have spent quite some time to get the serial communication between Processing and Arduino working. Unfortunately I haven’t succeeded yet. It’s either some vagabonding libraries or a 64bit incompatibility issue. The only information according this error was in the Processing wiki and in a messageboard thread. They recommend to manually replace some jars and dlls, but their troubleshootings didn’t work yet. I still have to try another specially 64bit compiled version of the RXTX library. I watched thru several serial communication tutorials (1,2,3,4,5), hoping to find some more informations according this error. I also stumbled over the CmdMessenger Library, which sounds like a interessting solution for the serial communication (CmdMessenger on GitHub). I also got the Eclipse plugin for Processing, but the same here. Right now I don’t know, if I should just put a fresh Windows version on my pc or if I should keep on trying to solve that error elsewise! So for the moment, I stepped back to the Arduino Code which already worked but hasn’t had the perfect formatting of the IDs in decimal.

I tried to get the formatting of the hex ID data right, but I was quickly confronted with the limitations of the arduino microcontroller chip. Having a good debugging with a lot of strings and implementing the ASCII table as an array, was to much for the 2 KB RAM of the Arduino Uno. Now I have installed Simple Digital Firmata and will do the debugging and formatting computation in processing. More to come…

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!