Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
attiny [2019/12/06 15:47] – yair | attiny [2019/12/14 17:43] – [CORE] yair | ||
---|---|---|---|
Line 1: | Line 1: | ||
attinyX5 Family in all their gory details | attinyX5 Family in all their gory details | ||
+ | |||
+ | ====pinouts==== | ||
+ | ===ATtinyx5=== | ||
<code c> | <code c> | ||
| | ||
| | ||
Reset 1| |8 VCC | Reset 1| |8 VCC | ||
- | (pin3) in 0 A3 PB3 2| |7 PB2 (pin2) out mixed | + | (pin3) in 0 A3 PB3 2| |7 PB2 (pin2) out mixed / SCK |
- | (pin4) in 1 A2 PB4 3| |6 PB1 (pin1) out 1 | + | (pin4) in 1 A2 PB4 3| |6 PB1 (pin1) out 1 / MISO |
- | GND 4| |5 PB0 (pin0) out 0 | + | GND 4| |5 PB0 (pin0) out 0 / MOSI |
| | ||
</ | </ | ||
{{: | {{: | ||
+ | ===USBASP V2.0=== | ||
+ | {{: | ||
+ | found [[https:// | ||
+ | |||
+ | drivers, linux "just works":, | ||
+ | |||
+ | ====CORE==== | ||
+ | [[https:// | ||
+ | note his warning\\ | ||
+ | < | ||
+ | |||
+ | ====Fuses==== | ||
+ | cd / | ||
+ | avrdude -C../ | ||
+ | |||
+ | <hidden successful fuse burn> | ||
+ | < | ||
+ | / | ||
+ | |||
+ | avrdude: Version 6.3-20171130 | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | User configuration file is "/ | ||
+ | |||
+ | Using Port : usb | ||
+ | Using Programmer | ||
+ | avrdude: usbasp_open(" | ||
+ | avrdude: seen device from vendor -> | ||
+ | avrdude: seen product -> | ||
+ | AVR Part : ATtiny45 | ||
+ | Chip Erase delay : 4500 us | ||
+ | | ||
+ | | ||
+ | RESET disposition | ||
+ | RETRY pulse : SCK | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | Block Poll | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | avrdude: usbasp_initialize() | ||
+ | avrdude: usbasp_transmit(" | ||
+ | avrdude: usbasp_spi_set_sck_period(0) | ||
+ | avrdude: auto set sck period (because given equals null) | ||
+ | avrdude: usbasp_transmit(" | ||
+ | avrdude: warning: cannot set sck period. please check for usbasp firmware update. | ||
+ | avrdude: usbasp_transmit(" | ||
+ | avrdude: usbasp_program_enable() | ||
+ | avrdude: usbasp_transmit(" | ||
+ | <= [00] | ||
+ | avrdude: AVR device initialized and ready to accept instructions | ||
+ | |||
+ | Reading | avrdude: usbasp_spi_cmd(0x30, | ||
+ | avrdude: usbasp_transmit(" | ||
+ | <= [00] [30] [00] [1e] | ||
+ | avrdude: usbasp_spi_cmd() => 0x00, 0x30, 0x00, 0x1e | ||
+ | avrdude: usbasp_spi_cmd(0x30, | ||
+ | avrdude: usbasp_transmit(" | ||
+ | <= [00] [30] [00] [92] | ||
+ | avrdude: usbasp_spi_cmd() => 0x00, 0x30, 0x00, 0x92 | ||
+ | ################ | ||
+ | avrdude: usbasp_transmit(" | ||
+ | <= [00] [30] [00] [06] | ||
+ | avrdude: usbasp_spi_cmd() => 0x00, 0x30, 0x00, 0x06 | ||
+ | ################################## | ||
+ | |||
+ | avrdude: Device signature = 0x1e9206 (probably t45) | ||
+ | avrdude: usbasp_close() | ||
+ | avrdude: usbasp_transmit(" | ||
+ | |||
+ | avrdude done. Thank you. | ||
+ | </ | ||
+ | </ | ||
====System Clock Prescaler==== | ====System Clock Prescaler==== | ||
goal:to control prescaler | goal:to control prescaler | ||
Line 27: | Line 147: | ||
------ | ------ | ||
*/ | */ | ||
+ | </ | ||
+ | and | ||
+ | <code c> | ||
+ | // the setup function runs once when you press reset or power the board | ||
+ | void setup() { | ||
+ | |||
+ | DDRB = B00000111; | ||
+ | |||
+ | // initialize timer1 | ||
+ | noInterrupts(); | ||
+ | |||
+ | TCCR1 = 0; //stop the timer | ||
+ | TCNT1 = 0; //zero the timer | ||
+ | |||
+ | OCR1A = 200; // | ||
+ | OCR1C = 200; // | ||
+ | |||
+ | TIMSK = _BV(OCIE1A); | ||
+ | |||
+ | TCCR1 = _BV(CTC1) | _BV(CS11); // Start timer, ctc mode, prescaler clk/2 | ||
+ | |||
+ | interrupts(); | ||
+ | } | ||
+ | |||
</ | </ | ||
{{: | {{: |