diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/Makefile | 2 | ||||
-rw-r--r-- | firmware/main.c | 18 | ||||
-rw-r--r-- | firmware/releases/micronucleus-1.06.hex | 137 | ||||
-rw-r--r-- | firmware/releases/release notes.txt | 7 |
4 files changed, 154 insertions, 10 deletions
diff --git a/firmware/Makefile b/firmware/Makefile index 72c034b..8dfba5d 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -24,7 +24,7 @@ LOCKOPT = -U lock:w:0x2f:m # - for the size of your device (8kb = 1024 * 8 = 8192) subtract above value 2124... = 6068 # - How many pages in is that? 6068 / 64 (tiny85 page size in bytes) = 94.8125 # - round that down to 94 - our new bootloader address is 94 * 64 = 6016, in hex = 1780 -BOOTLOADER_ADDRESS = 17c0 +BOOTLOADER_ADDRESS = 1780 PROGRAMMER = -c USBasp # PROGRAMMER contains AVRDUDE options to address your programmer diff --git a/firmware/main.c b/firmware/main.c index 708f474..0db320c 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -10,7 +10,7 @@ */ #define MICRONUCLEUS_VERSION_MAJOR 1 -#define MICRONUCLEUS_VERSION_MINOR 5 +#define MICRONUCLEUS_VERSION_MINOR 6 // how many milliseconds should host wait till it sends another erase or write? // needs to be above 4.5 (and a whole integer) as avr freezes for 4.5ms #define MICRONUCLEUS_WRITE_SLEEP 8 @@ -368,6 +368,17 @@ static inline void leaveBootloader(void) { // clear magic word from bottom of stack before jumping to the app *(uint8_t*)(RAMEND) = 0x00; *(uint8_t*)(RAMEND-1) = 0x00; + + // adjust clock to previous calibration value, so user program always starts with same calibration + // as when it was uploaded originally + // TODO: Test this and find out, do we need the +1 offset? + unsigned char stored_osc_calibration = pgm_read_byte(BOOTLOADER_ADDRESS - TINYVECTOR_OSCCAL_OFFSET); + if (stored_osc_calibration != 0xFF && stored_osc_calibration != 0x00) { + //OSCCAL = stored_osc_calibration; // this should really be a gradual change, but maybe it's alright anyway? + // do the gradual change - failed to score extra free bytes anyway in 1.06 + while (OSCCAL > stored_osc_calibration) OSCCAL--; + while (OSCCAL < stored_osc_calibration) OSCCAL++; + } // jump to application reset vector at end of flash asm volatile ("rjmp __vectors - 4"); @@ -382,11 +393,6 @@ int main(void) { uint8_t prescaler_default = CLKPR; #endif - unsigned char stored_osc_calibration = pgm_read_byte(BOOTLOADER_ADDRESS - TINYVECTOR_OSCCAL_OFFSET + 1); - if (stored_osc_calibration != 0xFF) { - OSCCAL = stored_osc_calibration; - } - wdt_disable(); /* main app may have enabled watchdog */ tiny85FlashInit(); bootLoaderInit(); diff --git a/firmware/releases/micronucleus-1.06.hex b/firmware/releases/micronucleus-1.06.hex new file mode 100644 index 0000000..301751f --- /dev/null +++ b/firmware/releases/micronucleus-1.06.hex @@ -0,0 +1,137 @@ +:1017800022C040C06CC03EC03DC03CC03BC03AC05F
+:1017900039C038C037C036C035C034C033C0040388
+:1017A000090412011001FF000008D01653070601BA
+:1017B000000000010902120001010080320904004A
+:1017C00000000000000011241FBECFE5D2E0DEBF04
+:1017D000CDBF00EB0F9307E00F9310E0A0E6B0E061
+:1017E000ECEDFFE102C005900D92A636B107D9F7E6
+:1017F00010E0A6E6B0E001C01D92AC39B107E1F7F8
+:10180000E7D1EAC3BDCFA82FB92F80E090E041E037
+:1018100050EA609530E009C02D9182279795879511
+:1018200010F084279527305EC8F36F5FA8F3089502
+:10183000EADF8D939D930895A6E088279927AA95BE
+:1018400069F00197E1F3B399FCCFB39BFECF81E040
+:101850009927A6B3019611F0A871D9F70895CF93EF
+:10186000CFB7CF93C0915F02C03B21F4C0915E021D
+:10187000C73021F0CF91CFBFCF9181CFCC27C39577
+:10188000B39BE9F7B39B0BC0B39B09C0B39B07C0E5
+:10189000B39B05C0B39B03C0B39B01C0D3C00F92E1
+:1018A000DF93C0917F00DD27CA57DF4F012EB39B26
+:1018B00003C0DF910F90E6CF2F930F931F934F93A9
+:1018C0002FEF4F6F06B303FB20F95F933F9350E078
+:1018D0003BE065C016B30126502953FDC89556B3A9
+:1018E000012703FB25F92F7306B3B1F0502710270A
+:1018F00013FB26F906B22230F0F000C016B3012720
+:1019000003FB27F90126502906B22430E8F54F776A
+:10191000206816B30000F6CF50274F7D206206B234
+:10192000102F000000C006B300265029102713FB1B
+:1019300026F906B2E2CF4F7B06B3206400C0DACFAF
+:1019400001265029187106B269F14E7F2160012FDE
+:1019500016B328C0002650294D7F06B22260102FF2
+:1019600029C0012650294B7F06B22460012F2DC0CB
+:1019700016B301265029477F2860000006B22EC00A
+:101980004F7E06B3206130C0422706B3499300263C
+:101990005029102706B24FEF13FB20F9297F16B309
+:1019A00079F2187159F10126502906B2012703FB7B
+:1019B00021F9237F06B371F2002650293150D0F06F
+:1019C00006B2102713FB22F9277E16B351F2012627
+:1019D0005029012703FB06B223F92F7C49F20000AE
+:1019E00006B3102713FB24F90026502906B22F79DD
+:1019F00039F270CF10E21ABF002717C03B50319563
+:101A0000C31BD04010E21ABF0881033CF9F00B342D
+:101A1000E9F020917D001981110F1213EDCF0936E5
+:101A200051F10D3211F0013E39F7009384003F91DE
+:101A30005F914F911F910F912F91DF910F90CAB736
+:101A4000C5FD1DCFCF91CFBFCF91189520918400B8
+:101A5000222369F310918200112321F5343022F101
+:101A60003093820020937E0010917F003BE0311B79
+:101A700030937F0019C00091820001309CF40AE588
+:101A80003091600034FD11C000936000C2E7D0E0E7
+:101A900010C0052710E000C021C0052710E0C89540
+:101AA00008BB14C03AE501C032ED032EC0E0D0E01F
+:101AB00032E017B31861C39A08B317BB58E120E8A6
+:101AC0004FEF20FF052708BB279517951C3F28F7E8
+:101AD00000004552B0F720FF0527279508BB179552
+:101AE0001C3FB8F629913A9561F7077E1091830063
+:101AF000110F08BBC250D04011F010937D0010E2CE
+:101B00001ABF086017B3177E402F477E54E05A95DE
+:101B1000F1F708BB17BB48BB8ACF81E0809369000F
+:101B2000F894E0917000F0917100329785E0809315
+:101B30005700E89507B600FCFDCF789408959C0106
+:101B4000E0917000F0917100309789F1E430F10577
+:101B5000F1F087E1EC37F80739F420916C0030910F
+:101B60006D002E5B3B4F15C087E1EE37F80739F467
+:101B700020916E0030916F002D5B3B4F0AC087E1D2
+:101B8000EA37F80731F481B7282F30E002C02FEB95
+:101B90003BECF89481E0090180935700E89511240B
+:101BA00078943296F0937100E0937000089581E18B
+:101BB00080935700E895EBCF8FEF9FEFC0DF8091C8
+:101BC0007000909171008F739070892BA9F7A5CF49
+:101BD0001F93CF93DF9388E10FB6F89481BD11BCBA
+:101BE0000FBEE0E0F0E0859194918F5B9B4C39F45F
+:101BF000E4E0F0E0859194918F5B9B4C09F0DCDF91
+:101C00001092710010927000AC9A8BB780628BBFFB
+:101C1000BB9A88E893E1ECE9F1E03197F1F701979D
+:101C2000D1F7BB98789410918200135017FDD4C05F
+:101C300080917F00CCE0D0E0C81BD109CA57DF4FAC
+:101C400080917E008D3209F091C0183009F0C2C039
+:101C500083EC809372008AE58093600010926B00A1
+:101C60002881822F80769981882329F1109267003C
+:101C700010926600992341F482E690E090938100EF
+:101C80008093800024E068C0913051F48C819D8164
+:101C9000909371008093700027FD59C09FEF58C04A
+:101CA00080916800923011F4816001C0846080935B
+:101CB000680020E051C08A8110927B00992331F4A2
+:101CC00010927C008BE790E022E03CC0953019F444
+:101CD0008093830034C0963011F58B81813019F4E4
+:101CE00082EA97E104C0823041F484EB97E190935B
+:101CF00081008093800022E10EC0833059F48A81F4
+:101D0000882341F48EE997E19093810080938000CD
+:101D100024E001C020E080E480936B001DC0983077
+:101D200019F485E890E009C0993019F48093850092
+:101D300006C09A3021F48BE790E021E003C08BE7E6
+:101D400090E020E0909381008093800005C09E8108
+:101D500080E880936B0007C08F81882319F49E81EF
+:101D6000921708F0922F9093610034C080916B001D
+:101D700087FF30C08091700090917100009739F416
+:101D80008881998190936D0080936C000DC08430A0
+:101D9000910539F48881998190936F0080936E004A
+:101DA00003C08058974138F488819981C8DE125069
+:101DB00011F02296DFCF80917000909171008F73A7
+:101DC0009070892B39F4809168008260809368005C
+:101DD00010926100109282008091600084FF3CC0EC
+:101DE000809161008F3FC1F1182F893008F018E011
+:101DF000811B809361008091720098E8892780930D
+:101E000072001123E1F0E0918000F0918100809157
+:101E10006B0086FF09C0912FA3E7B0E084918D93FA
+:101E200031969150D9F707C0912FA3E7B0E0819187
+:101E30008D939150E1F7F0938100E093800083E768
+:101E400090E0612FF5DC612F6C5F6C3019F08FEF43
+:101E5000809361006093600094E186B3887131F4EF
+:101E60009150D9F71092830010927D0010E09923D1
+:101E700009F411E080916A00811739F0112319F4F7
+:101E8000F8946BD0789410936A008CE991E00197F4
+:101E9000F1F780916600909167000196909367003A
+:101EA0008093660080916800182F80FF14C0F8941A
+:101EB000E0E8F7E1E054F04083E080935700E895D4
+:101EC00007B600FCFDCF3097A9F710927100109271
+:101ED000700072DE789411FF0FC08AE390E20197E0
+:101EE000F1F780917000909171008F739070892B41
+:101EF00011F062DE01C011DE12FD0AC0109268000E
+:101F000080916600909167008055934C08F48BCEC9
+:101F100082E291EA0197F1F7F8941BBE15BA10928C
+:101F20005F0210925E02EAE7F7E19491892F8150F7
+:101F30008E3F20F00DC081B7815081BF81B79817C7
+:101F4000D0F303C081B78F5F81BF81B78917D0F30A
+:101F500015CCDF91CF911F910895FF920F931F939E
+:101F6000CF93DF9380E8F82E00E0C0E0D0E0102FA0
+:101F70001F0D11BF61DC29E0843392070CF0102F94
+:101F8000F6942196C830D10511F0012FF0CF1150F1
+:101F900011BF1F5F012FEC0110C04EDC845399402C
+:101FA00097FF03C0909581959F4F8C179D0714F460
+:101FB00001B7EC0181B78F5F81BF21B730E0812F7E
+:101FC00090E001968217930744F701BFDF91CF910C
+:0C1FD0001F910F91FF900895F894FFCF2F
+:061FDC005AFF177C4008CB
+:040000030000178062
+:00000001FF
diff --git a/firmware/releases/release notes.txt b/firmware/releases/release notes.txt index 3378066..c513de6 100644 --- a/firmware/releases/release notes.txt +++ b/firmware/releases/release notes.txt @@ -1,10 +1,11 @@ -== 1.06 - unreleased == +== 1.06 - 2013-3-4 == firmware: o Store 16.5mhz oscillator calibration value in tiny vector table - o At startup, restore oscillator calibration value before initialising USB + o At user program startup, restore oscillator calibration value stored together with program -> User programs always start on the calibration value from the last time they were uploaded - -> Bootloader is ready to talk over USB sooner, because it is closer to already being calibrated at startup + o Slightly too big to have 6076 programmable bytes, reverted to having 6012 bytes free for user program + -> Hopefully a future version can slim down again and get another page free! == 1.05 - 2013-2-8 == |