Here some images and schemes for the correct wiring to programm an ATtiny85 microcontroller:

Image

Here one can see the pin description of the ATtiny85:

Image

And here a wiring scheme. The pin allocation of the 6-pin plug is seen from above the plug, which gets really confusing when you have to put the wires right.Furthermore its quite hard to get it clearly laid out:

Image

Here the pin allocation of the 6-pin plug, when you look into the holes of the plug:

The communication works on the ‘Serial Peripheral Interface Bus‘. In the next picture you can see the pin allocation a little better (top > down like in the picture):

  • ground (GND)
  • master output, slave input (MOSI)
  • power supply (VCC)
  • master input, slave output (MISO)
  • source clock (SCK)
  • reset (RST)

Image

In order to get a fast feedback, if the programming really worked, I took a little LED blink sample code:

/*
* blink.c
*
* Created on: 22.09.2012
* Author: Dario
*/
/*Filename: blink.c */
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
int main (void)
{
  //Set PORTB.3 to be output (physical pin #3 on the ATTINY85)
  DDRB = 0b00001000;
  while (1) {
// //Set PORTB.3 high
    PORTB = 0b00001000;
    _delay_ms(1000);
// //Set PORTB.3 low again
    PORTB = 0b00000000;
    _delay_ms(1000);
  }
  return 1;
}

Advertisements