This is an old revision of the document!
attinyX5 Family in all their gory details
pinouts
ATtinyx5
ATTiny pinout +-\/-+ Reset 1| |8 VCC (pin3) in 0 A3 PB3 2| |7 PB2 (pin2) out mixed / SCK (pin4) in 1 A2 PB4 3| |6 PB1 (pin1) out 1 / MISO GND 4| |5 PB0 (pin0) out 0 / MOSI ------
USBASP V2.0
CORE
spencerCOre
note his warning
When using a chip for the first time, or after changing the clock speed or BOD settings, you must do “burn bootloader” to set the fuses, even if you are not using the chip with a bootloader
System Clock Prescaler
goal:to control prescaler
in mindfuckHS code original author has this to say about his clock configuration
/*
Timer 1 is used in this case.
the prescaler is ck1 /2 and the ocr1 is 60
see // see http://www.atmel.com/Images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf
See table 13-5
CS13, CS12, CS11, CS10 = [ 0, 0, 1, 0] is prescaler/2
------
*/
and
// the setup function runs once when you press reset or power the board void setup() { DDRB = B00000111; //could use this // initialize timer1 noInterrupts(); // disable all interrupts TCCR1 = 0; //stop the timer TCNT1 = 0; //zero the timer OCR1A = 200; //50 //set the compare value OCR1C = 200; //50 //set the compare value ??? needed TIMSK = _BV(OCIE1A); //interrupt on Compare Match A TCCR1 = _BV(CTC1) | _BV(CS11); // Start timer, ctc mode, prescaler clk/2 interrupts(); // enable all interrupts }