Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
attiny [2019/12/14 14:20] – yair | attiny [2019/12/14 17:56] – [System Clock Prescaler] yair | ||
---|---|---|---|
Line 1: | Line 1: | ||
attinyX5 Family in all their gory details | attinyX5 Family in all their gory details | ||
+ | |||
====pinouts==== | ====pinouts==== | ||
Line 18: | Line 19: | ||
found [[https:// | 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 59: | Line 173: | ||
</ | </ | ||
{{: | {{: | ||
+ | |||
+ | <hidden conf for atiny45/ | ||
+ | < | ||
+ | # | ||
+ | # ATtiny45 | ||
+ | # | ||
+ | |||
+ | part | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, | ||
+ | 0x99, 0xE1, 0xBB, 0xAC; | ||
+ | | ||
+ | ## avr910_devcode | ||
+ | ## Try the AT90S2313 devcode: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | "x x x x x x x x x x x x x x x x"; | ||
+ | |||
+ | | ||
+ | "x x x x x x x x x x x x x x x x"; | ||
+ | |||
+ | timeout = 200; | ||
+ | stabdelay = 100; | ||
+ | cmdexedelay = 25; | ||
+ | synchloops = 32; | ||
+ | bytedelay = 0; | ||
+ | pollindex = 3; | ||
+ | pollvalue = 0x53; | ||
+ | predelay = 1; | ||
+ | postdelay = 1; | ||
+ | pollmethod = 1; | ||
+ | |||
+ | hvsp_controlstack | ||
+ | 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, | ||
+ | 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, | ||
+ | 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, | ||
+ | 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; | ||
+ | hventerstabdelay | ||
+ | progmodedelay | ||
+ | hvspcmdexedelay | ||
+ | synchcycles | ||
+ | latchcycles | ||
+ | togglevtg | ||
+ | poweroffdelay | ||
+ | resetdelayms | ||
+ | resetdelayus | ||
+ | hvleavestabdelay | ||
+ | resetdelay | ||
+ | chiperasepolltimeout = 40; | ||
+ | chiperasetime | ||
+ | programfusepolltimeout = 25; | ||
+ | programlockpolltimeout = 25; | ||
+ | |||
+ | ocdrev | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | |||
+ | loadpage_lo = " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | writepage = " | ||
+ | " | ||
+ | " a7 a6 a5 a4 | ||
+ | " | ||
+ | |||
+ | mode = 0x41; | ||
+ | delay = 6; | ||
+ | blocksize = 4; | ||
+ | readsize = 256; | ||
+ | ; | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | mode = 0x41; | ||
+ | delay = 6; | ||
+ | blocksize = 32; | ||
+ | readsize = 256; | ||
+ | ; | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | ; | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | # | ||
+ | # ATtiny85 | ||
+ | # | ||
+ | |||
+ | part | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, | ||
+ | 0x99, 0xE1, 0xBB, 0xAC; | ||
+ | ## no STK500 devcode in XML file, use the ATtiny45 one | ||
+ | | ||
+ | ## avr910_devcode | ||
+ | ## Try the AT90S2313 devcode: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | "x x x x x x x x x x x x x x x x"; | ||
+ | |||
+ | | ||
+ | "x x x x x x x x x x x x x x x x"; | ||
+ | |||
+ | timeout = 200; | ||
+ | stabdelay = 100; | ||
+ | cmdexedelay = 25; | ||
+ | synchloops = 32; | ||
+ | bytedelay = 0; | ||
+ | pollindex = 3; | ||
+ | pollvalue = 0x53; | ||
+ | predelay = 1; | ||
+ | postdelay = 1; | ||
+ | pollmethod = 1; | ||
+ | |||
+ | hvsp_controlstack | ||
+ | 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, | ||
+ | 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, | ||
+ | 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, | ||
+ | 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; | ||
+ | hventerstabdelay | ||
+ | hvspcmdexedelay | ||
+ | synchcycles | ||
+ | latchcycles | ||
+ | togglevtg | ||
+ | poweroffdelay | ||
+ | resetdelayms | ||
+ | resetdelayus | ||
+ | hvleavestabdelay | ||
+ | resetdelay | ||
+ | chiperasepolltimeout = 40; | ||
+ | chiperasetime | ||
+ | programfusepolltimeout = 25; | ||
+ | programlockpolltimeout = 25; | ||
+ | |||
+ | ocdrev | ||
+ | |||
+ | | ||
+ | | ||
+ | paged = no; | ||
+ | page_size | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | |||
+ | loadpage_lo = " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | writepage = " | ||
+ | " | ||
+ | " a7 a6 a5 a4 | ||
+ | " | ||
+ | |||
+ | mode = 0x41; | ||
+ | delay = 12; | ||
+ | blocksize = 4; | ||
+ | readsize = 256; | ||
+ | ; | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | mode = 0x41; | ||
+ | delay = 6; | ||
+ | blocksize = 32; | ||
+ | readsize = 256; | ||
+ | ; | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | ; | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | min_write_delay = 9000; | ||
+ | max_write_delay = 9000; | ||
+ | ; | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | </ | ||
+ | </ |