From 2417088afe0d8d7eff0de5d33f58a3e9cb496122 Mon Sep 17 00:00:00 2001 From: Manfred Steiner Date: Fri, 20 Sep 2024 07:22:07 +0200 Subject: [PATCH] merge mit 1284-v1a --- kicad/dist/1284-v1a/README.md | 11 +- kicad/dist/644-v1a/README.md | 7 +- software/bootloader-arduino/release/.gitkeep | 0 .../bootloader-arduino/.gdb_history | 0 .../bootloader-arduino/.gdbinit | 0 .../bootloader-arduino/.gitignore | 0 .../.vscode/c_cpp_properties.json | 0 .../bootloader-arduino/.vscode/launch.json | 0 .../bootloader-arduino/.vscode/settings.json | 7 +- .../bootloader-arduino/.vscode/tasks.json | 0 .../bootloader-arduino/Makefile | 8 +- .../bootloader-arduino/README.md | 10 +- .../bootloader-arduino/protocol | 0 .../bootloader-arduino_nano-1284.elf | Bin 0 -> 9976 bytes .../bootloader-arduino_nano-1284.hex | 106 ++++++++++++++++++ .../bootloader-arduino/src/main.c | 54 ++++----- 16 files changed, 160 insertions(+), 43 deletions(-) delete mode 100644 software/bootloader-arduino/release/.gitkeep rename software/{ => nano-1284}/bootloader-arduino/.gdb_history (100%) rename software/{ => nano-1284}/bootloader-arduino/.gdbinit (100%) rename software/{ => nano-1284}/bootloader-arduino/.gitignore (100%) rename software/{ => nano-1284}/bootloader-arduino/.vscode/c_cpp_properties.json (100%) rename software/{ => nano-1284}/bootloader-arduino/.vscode/launch.json (100%) rename software/{ => nano-1284}/bootloader-arduino/.vscode/settings.json (76%) rename software/{ => nano-1284}/bootloader-arduino/.vscode/tasks.json (100%) rename software/{ => nano-1284}/bootloader-arduino/Makefile (92%) rename software/{ => nano-1284}/bootloader-arduino/README.md (91%) rename software/{ => nano-1284}/bootloader-arduino/protocol (100%) create mode 100755 software/nano-1284/bootloader-arduino/release/2024-09-05_120945/bootloader-arduino_nano-1284.elf create mode 100644 software/nano-1284/bootloader-arduino/release/2024-09-05_120945/bootloader-arduino_nano-1284.hex rename software/{ => nano-1284}/bootloader-arduino/src/main.c (92%) diff --git a/kicad/dist/1284-v1a/README.md b/kicad/dist/1284-v1a/README.md index 3bb999e..07fce5a 100644 --- a/kicad/dist/1284-v1a/README.md +++ b/kicad/dist/1284-v1a/README.md @@ -40,10 +40,15 @@ Vorne | Hinten 19.8.2024 | € -38,95 | Rückzahlung Bauteile (10 x Atmega1284P) 20.8.2024 | € 52,10 | Bauteile 22.8.2024 | € 242,87 | Fertigung (PCB+Bestückung), Bauteile - -- | € 353,39 | Gesamtkosten für 10 Stück - -- | **€ 35,339** | **Kosten pro Stück** + 20.9.2024 | € 82,97 | Zoll + -- | € 436,36 | Gesamtkosten für 10 Stück + -- | **€ 43,636** | **Kosten pro Stück** -Ausständig: Zoll, Steuer + +Stückpreis (gemittelt): +* Nano-644: € 48,190 +* Nano-1284: € 42,636 +* **Kaufpreis: € 45,413** ---------------------------------------------------------------- diff --git a/kicad/dist/644-v1a/README.md b/kicad/dist/644-v1a/README.md index f606265..cbbaffd 100644 --- a/kicad/dist/644-v1a/README.md +++ b/kicad/dist/644-v1a/README.md @@ -41,10 +41,9 @@ Datum | Kosten | Beschreibung 27.5.2024 | € 61,27 | Bauteile 27.5.2024 | € -3,69 | Rückzahlung Bauteile 17.6.2024 | € 203,43 | PCB, Bestückung, Transport --- | € 400,79 | Gesamtkosten für 10 Stück --- | **€ 40,079** | **Kosten pro Stück** - -Ausständig: Zoll, Steuer +15.7.2024 | € 81,11 | Zoll +-- | € 481,90 | Gesamtkosten für 10 Stück +-- | **€ 48,190** | **Kosten pro Stück** ## Sonstiges diff --git a/software/bootloader-arduino/release/.gitkeep b/software/bootloader-arduino/release/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/software/bootloader-arduino/.gdb_history b/software/nano-1284/bootloader-arduino/.gdb_history similarity index 100% rename from software/bootloader-arduino/.gdb_history rename to software/nano-1284/bootloader-arduino/.gdb_history diff --git a/software/bootloader-arduino/.gdbinit b/software/nano-1284/bootloader-arduino/.gdbinit similarity index 100% rename from software/bootloader-arduino/.gdbinit rename to software/nano-1284/bootloader-arduino/.gdbinit diff --git a/software/bootloader-arduino/.gitignore b/software/nano-1284/bootloader-arduino/.gitignore similarity index 100% rename from software/bootloader-arduino/.gitignore rename to software/nano-1284/bootloader-arduino/.gitignore diff --git a/software/bootloader-arduino/.vscode/c_cpp_properties.json b/software/nano-1284/bootloader-arduino/.vscode/c_cpp_properties.json similarity index 100% rename from software/bootloader-arduino/.vscode/c_cpp_properties.json rename to software/nano-1284/bootloader-arduino/.vscode/c_cpp_properties.json diff --git a/software/bootloader-arduino/.vscode/launch.json b/software/nano-1284/bootloader-arduino/.vscode/launch.json similarity index 100% rename from software/bootloader-arduino/.vscode/launch.json rename to software/nano-1284/bootloader-arduino/.vscode/launch.json diff --git a/software/bootloader-arduino/.vscode/settings.json b/software/nano-1284/bootloader-arduino/.vscode/settings.json similarity index 76% rename from software/bootloader-arduino/.vscode/settings.json rename to software/nano-1284/bootloader-arduino/.vscode/settings.json index 114a717..1d7e197 100644 --- a/software/bootloader-arduino/.vscode/settings.json +++ b/software/nano-1284/bootloader-arduino/.vscode/settings.json @@ -12,10 +12,5 @@ "cSpell.words": [], "cSpell.ignorePaths": [ "**/*.json", "**/*.c", "**/*.h", "**/Makefile" - ], - "files.associations": { - "delay.h": "c", - "boot.h": "c", - "stdio.h": "c" - } + ] } diff --git a/software/bootloader-arduino/.vscode/tasks.json b/software/nano-1284/bootloader-arduino/.vscode/tasks.json similarity index 100% rename from software/bootloader-arduino/.vscode/tasks.json rename to software/nano-1284/bootloader-arduino/.vscode/tasks.json diff --git a/software/bootloader-arduino/Makefile b/software/nano-1284/bootloader-arduino/Makefile similarity index 92% rename from software/bootloader-arduino/Makefile rename to software/nano-1284/bootloader-arduino/Makefile index 665918a..bd4e491 100644 --- a/software/bootloader-arduino/Makefile +++ b/software/nano-1284/bootloader-arduino/Makefile @@ -95,6 +95,12 @@ isp-1284p: isp-flash-1284p: dist/$(NAME).elf all avrdude -c usbasp -p m1284p -e -U flash:w:$< +isp-flash-1284p-latest-release: + avrdude -c usbasp -p m1284p -e -U flash:w:release/$(shell ls -A release | tail -n 1)/$(NAME).elf + +isp-read-flash-1284p: + avrdude -c usbasp -p m1284p -U flash:r:/tmp/flash-nano-1284__$(shell date +"%Y-%m-%d_%H%M%S") + flash-1284p: dist/$(NAME).elf all avrdude -c arduino -p m1284p -P /dev/ttyUSB0 -b 115200 -e -U flash:w:$< @@ -105,7 +111,7 @@ picocom: isp-erase-1284p: avrdude -c usbasp -p m1284p -e - + isp-fuse-1284p: # LFUSE=0xE7 -> startuptime 16K CLOCKS + 4.1ms -> 5.4ms avrdude -c usbasp -p m1284p -U lfuse:w:0xEF:m -U hfuse:w:0xD8:m -U efuse:w:0xFE:m -U lock:w:0xEF:m diff --git a/software/bootloader-arduino/README.md b/software/nano-1284/bootloader-arduino/README.md similarity index 91% rename from software/bootloader-arduino/README.md rename to software/nano-1284/bootloader-arduino/README.md index 81b4a47..64a8d3f 100644 --- a/software/bootloader-arduino/README.md +++ b/software/nano-1284/bootloader-arduino/README.md @@ -12,8 +12,8 @@ Diese Anpassung der Quelltext-Datei umfasst: * Quelltextkorrekturen, damit der Bootloader auch bei einer Page-Size von 256 Byte funktioniert Der Bootloader kann entweder selbst aus der Quelltextdatei erzeugt werden (siehe [Übersetzung](#%C3%BCbersetzung)), oder es wird eine der bereits fertigen Dateien im Ordner [release](release) verwendet: -* [release/bootloader-arduino_nano-1284.elf](release/bootloader-arduino_nano-1284.elf) -* [release/bootloader-arduino_nano-1284.hex](release/bootloader-arduino_nano-1284.hex) +* [release/2024-09-05_120945/bootloader-arduino_nano-1284.elf](release/2024-09-05_120945/bootloader-arduino_nano-1284.elf) +* [release/2024-09-05_120945/bootloader-arduino_nano-1284.hex](release/2024-09-05_120945/bootloader-arduino_nano-1284.hex) ## Übersetzung @@ -33,9 +33,11 @@ Die Übersetzung erfolgt dann mit dem Kommando `make`. Die korrekte Programmierung der Fuses sowie der Download des Bootloaders in den Bootloader-Bereich des µC-Flash kann mit Hilfe eines [USBasp-Programmiergeräts](https://www.fischl.de/usbasp/) mit folgenden Kommandos erfolgen: +... oder die aktuellste Version im UNterordner [release](release) ... + ```sh -make isp-fuse -make isp-flash +make isp-fuse-1284p +make isp-flash-1284p-latest-release: ``` Nach der Programmierung sollten die drei LEDs den Start des Bootloader anzeigen (rot -> rot+orange -> grün -> grün blinken). diff --git a/software/bootloader-arduino/protocol b/software/nano-1284/bootloader-arduino/protocol similarity index 100% rename from software/bootloader-arduino/protocol rename to software/nano-1284/bootloader-arduino/protocol diff --git a/software/nano-1284/bootloader-arduino/release/2024-09-05_120945/bootloader-arduino_nano-1284.elf b/software/nano-1284/bootloader-arduino/release/2024-09-05_120945/bootloader-arduino_nano-1284.elf new file mode 100755 index 0000000000000000000000000000000000000000..955f52f4ba54ca447d144a0e65a99cdbd830e6f9 GIT binary patch literal 9976 zcmd6teRR~-naA&M63DB0k#~@iKon4z%u5mo2+3sfLL@K4Od=Sn!z7u!NZw2a7HwB% z0^y~ybS4Qbrl(fhv&Yk8YsIw|w<-fiDY(kep0itfx-Ao}3fecgKnDECJ~4?Ze$n@_+8YERpr*F*cG97g4yd=Mk8X*jkGA~3_?a#1 zOvUR83Wdwtmy=VNV=-9}mh8MGZ$_?N`qLjzzju0R^x5dis1ja0{1em5N#mbojBc7p zA1(SceN@DPp|ChMbtB>*IVX~jMMh5K4;|C~{15-2Z_G41_N$MSaQMRunHi(r*pd85 zC>>>F`10_z;i=&>tA4#|x8g@12fvyV{_eH&3*S$@lKOdS;6KmL4Se$c%%`GPW=`mPDD|LOo8#90ahfx?D!#=kWt7Huc|=?im)`ruAAhl6aN*#h z!Mg?z2gU*~1YQpW<^;>0D?K^GKdD73J*>AV$Ddn#a`EAPWBXp%_xiq1BAG$$?{Y|= zN7-1$Xv&0L&F7zbcbP3#uGY&>5I^I%uFhD9`KOLtJ^0#S)ISmyN07fIvWDLlhsOOQ zXT$->XT^zVaO8sUkGv!HM>9sP6A97m=*jUfjp|&jDU(&#0i_xA=1fBb2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20!-k%RZuT$G< z=pEOC!P;nU`n8hu9?KJAFID16?}JKaF5be;$|b~^o@wa5h2~55cl6A|`x{*%#2@rv JpiS@Ze*sCR^H=}? literal 0 HcmV?d00001 diff --git a/software/nano-1284/bootloader-arduino/release/2024-09-05_120945/bootloader-arduino_nano-1284.hex b/software/nano-1284/bootloader-arduino/release/2024-09-05_120945/bootloader-arduino_nano-1284.hex new file mode 100644 index 0000000..4db935b --- /dev/null +++ b/software/nano-1284/bootloader-arduino/release/2024-09-05_120945/bootloader-arduino_nano-1284.hex @@ -0,0 +1,106 @@ +:020000021000EC +:10E000000C9451F00C9463F00C9463F00C9463F056 +:10E010000C9463F00C9463F00C9463F00C9463F034 +:10E020000C9463F00C9463F00C9463F00C9463F024 +:10E030000C9463F00C9463F00C9463F00C9463F014 +:10E040000C9463F00C9463F00C9463F00C9463F004 +:10E050000C9463F00C9463F00C9463F00C9463F0F4 +:10E060000C9463F00C9463F00C9463F00C9463F0E4 +:10E070000C9463F00C9463F00C9463F00C9463F0D4 +:10E080000C9463F00C9463F00C9463F031323A30EA +:10E09000393A34350053657020203520323032341F +:10E0A000000011241FBECFEFD0E4DEBFCDBF22E0C1 +:10E0B000A0E0B1E001C01D92AC30B207E1F70E94D0 +:10E0C00048F10C9436F30C9400F09091C00095FF49 +:10E0D000FCCF8093C6000895CF93982F85958595A2 +:10E0E00085958595805D9F709A3014F0C7E501C0D5 +:10E0F000C0E3C90F0E9465F08C2FCF910C9465F09E +:10E10000CF92DF92EF92FF92C12CD12C76018091B9 +:10E11000C00087FD15C08FEFC81AD80AE80AF80AB0 +:10E1200081EBC81681E7D8068BE0E806F10478F3A6 +:10E1300017B818B8E0910001F09101010995E7CFF7 +:10E140008091C600FF90EF90DF90CF900895CF931D +:10E150000E9480F0C82F0E9465F0C13614F089EA51 +:10E1600003C0C0331CF080ED8C0F01C08C2FCF9109 +:10E170000895CF930E94A7F0C82F0E94A7F090E1C6 +:10E18000C99F800D1124CF910895CF93C82FCC2320 +:10E1900021F00E9480F0C150FACFCF910895CF9323 +:10E1A000C82F0E9480F0803251F484E10E9465F013 +:10E1B0008C2F0E9465F080E1CF910C9465F08091E6 +:10E1C00002018F5F80930201853041F417B818B8BF +:10E1D000E0910001F0910101CF910994CF91089550 +:10E1E0000E9480F0803231F484E10E9465F080E189 +:10E1F0000C9465F0809102018F5F8093020185305D +:10E2000039F417B818B8E0910001F09101010994B0 +:10E210000895CF93DF9300D000D0CDB7DEB7198239 +:10E220001A821B821C8289819A81AB81BC818115F3 +:10E230009042A140B10580F48091C00087FD0CC0E0 +:10E2400089819A81AB81BC810196A11DB11D898311 +:10E250009A83AB83BC83E7CF0F900F900F900F9002 +:10E26000DF91CF910895CF93C82F429A0E9409F170 +:10E27000439A0E9409F118B8CC2341F0449A0E94B5 +:10E2800009F144980E9409F1C150F6CFCF91089549 +:10E29000000018B88CE987B982E08093C0008CE058 +:10E2A0008093C4001092C50088E18093C10086E08D +:10E2B0008093C20098E09093C9008093CA0084E0E4 +:10E2C0000E9433F103E011E0B1E1FB2E0E9480F0E7 +:10E2D000803309F447C0813319F50E9480F0803201 +:10E2E000B9F484E10E9465F081E40E9465F086E55E +:10E2F0000E9465F082E50E9465F080E20E9465F070 +:10E3000089E40E9465F083E50E9465F080E595C18F +:10E31000809102018F5F809302018530B9F69AC126 +:10E32000803439F40E9480F08638E0F00E9480F05A +:10E3300019C0813491F40E9480F0803811F481EF8B +:10E3400044C0813811F481E040C0823811F480E18A +:10E350003CC08839C9F583E038C0823431F484E1A7 +:10E360000E94C5F00E94F0F0B1CF853411F485E031 +:10E37000F7CF982F9D7F9035A9F3813599F3853597 +:10E3800049F40E9480F080930A020E9480F08093FA +:10E390000B02E8CF8635E1F40E9480F0803389F4E7 +:10E3A0000E9480F00E9480F0C82F0E9480F0C1116E +:10E3B00002C08EE10AC0C13011F487E906C085E0D1 +:10E3C00004C083E00E94C5F080E00E94CFF07ECFC1 +:10E3D000843609F0C5C00E9480F0809309020E9433 +:10E3E00080F080930802809107028E7F809307025D +:10E3F0000E9480F0853429F4809107028160809327 +:10E400000702C6E0D1E06E012091080230910902B6 +:10E41000C601865091408217930730F40E9480F025 +:10E42000F60181936F01F0CF0E9480F0803209F0F5 +:10E430000AC18091070280FF2DC080910A0290914D +:10E440000B02880F991F90930B0280930A02E6E05B +:10E45000F1E02091080230910902CF0186509140ED +:10E460008217930708F07AC0F999FECF80910A02CB +:10E4700090910B0292BD81BD819180BDFA9AF99A6B +:10E4800080910A0290910B02019690930B02809367 +:10E490000A02DFCF80910B0287FF02C01BBF01C0C1 +:10E4A0001BBE80910A0290910B02880F991F9093D6 +:10E4B0000B0280930A028091080280FF09C08091BC +:10E4C0000802909109020196909309028093080234 +:10E4D000F894A0910A02B0910B02F999FECF07B609 +:10E4E00000FCFDCF429A4D01A12CB12CF401A09269 +:10E4F0005B0000935700E89507B600FCFDCF4298FB +:10E5000020E030E0AD01420F531F60E070E08981F0 +:10E5100090E0982F8827E8818E0F911D0C01FA0159 +:10E5200060935B0010935700E89511242E5F3F4FD6 +:10E5300022962115F1E03F0729F73093050120933A +:10E54000040185E0F401A0925B0080935700E895F8 +:10E5500007B600FCFDCFF0925700E89584E16DC04E +:10E56000843709F05AC00E9480F0809309020E940B +:10E5700080F08093080280910A0290910B02880F2C +:10E58000991F90930B0280930A020E9480F0909151 +:10E590000702853411F4916001C09E7F90930702B9 +:10E5A0000E9480F0803209F04AC084E10E9465F048 +:10E5B000C0E0D0E08091080290910902C817D90705 +:10E5C00008F03DC08091070280FF0BC0F999FECF93 +:10E5D00080910A0290910B0292BD81BDF89A80B59C +:10E5E0000FC0E0910A02F0910B0281FD02C08491FC +:10E5F00007C0CF01A0E0B0E01196ABBFFC0187914E +:10E600000E9465F080910A0290910B02019690930E +:10E610000B0280930A022196CDCF853719F50E940F +:10E6200080F0803281F484E10E9465F08EE10E94E6 +:10E6300065F087E90E9465F085E00E9465F080E161 +:10E640000E9465F043CE809102018F5F80930201AA +:10E65000853009F417B818B8E0910001F091010174 +:10E66000099534CE863709F031CEAECEF894FFCF7F +:040000031000E00009 +:00000001FF diff --git a/software/bootloader-arduino/src/main.c b/software/nano-1284/bootloader-arduino/src/main.c similarity index 92% rename from software/bootloader-arduino/src/main.c rename to software/nano-1284/bootloader-arduino/src/main.c index 08cebfe..3162adc 100644 --- a/software/bootloader-arduino/src/main.c +++ b/software/nano-1284/bootloader-arduino/src/main.c @@ -38,13 +38,6 @@ #define SET_LED_GREEN (PORTC |= (1 << PC4)) #define CLR_LED_GREEN (PORTC &= ~(1 << PC4)) -// define various device id's -// manufacturer byte is always the same -#define SIG1 0x1E // Yep, Atmel is the only manufacturer of AVR micros. Single source :( -#define SIG2 0x97 -#define SIG3 0x05 -#define PAGE_SIZE 0x80U // 128 words - // function prototypes void putch(char); char getch(void); @@ -55,6 +48,9 @@ char gethex(void); void puthex(char); void flash_led(uint8_t); +volatile const char DATE [] PROGMEM = __DATE__; +volatile const char TIME [] PROGMEM = __TIME__; + #ifdef DEBUG_UART1 int uart_putchar(char c, FILE *stream) { if (c == '\n') { @@ -115,7 +111,7 @@ int main () { // LED ports output and off, ensure that Q1 (battery power) on (PC7) PORTC = 0; - DDRC = (1 << PC7) | (1 << PC4) | (1 << PC3) |(1 << PC2); + DDRC = (1 << PC7) | (1 << PC4) | (1 << PC3) |(1 << PC2); #ifdef DOUBLE_SPEED @@ -248,11 +244,11 @@ int main () { ch = getch(); getch(); if (ch == 0) { - byte_response(SIG1); + byte_response(SIGNATURE_0); } else if (ch == 1) { - byte_response(SIG2); + byte_response(SIGNATURE_1); } else { - byte_response(SIG3); + byte_response(SIGNATURE_2); } } else { getNch(3); @@ -287,12 +283,14 @@ int main () { } } else { // Write to FLASH one page at a time - if (address.byte[1] > 127) { - //Only possible with m128, m256 will need 3rd address byte. FIXME - RAMPZ = 0x01; - } else { - RAMPZ = 0x00; - } + #ifdef RAMPZ + if (address.byte[1] > 127) { + //Only possible with m128, m256 will need 3rd address byte. FIXME + RAMPZ = 0x01; + } else { + RAMPZ = 0x00; + } + #endif // address * 2 -> byte location address.word = address.word << 1; @@ -313,8 +311,10 @@ int main () { printf("done\n"); printf(" boot_page_erase(0x%04x)...", address.word); #endif + SET_LED_RED; boot_page_erase(addr); boot_spm_busy_wait (); + CLR_LED_RED; #ifdef DEBUG_UART1 printf("done\n"); printf(" boot_page_fill(0x%04x, ...): ", address.word); @@ -372,11 +372,15 @@ int main () { address.word++; } else { - if (!flags.rampz) { - putch(pgm_read_byte_near(address.word)); - } else { - putch(pgm_read_byte_far(address.word + 0x10000)); - } + #ifdef RAMPZ + if (!flags.rampz) { + putch(pgm_read_byte_near(address.word)); + } else { + putch(pgm_read_byte_far(address.word + 0x10000)); + } + #else + putch(pgm_read_byte_near(address.word)); + #endif address.word++; } } @@ -387,9 +391,9 @@ int main () { // Get device signature bytes if (getch() == ' ') { putch(0x14); - putch(SIG1); - putch(SIG2); - putch(SIG3); + putch(SIGNATURE_0); + putch(SIGNATURE_1); + putch(SIGNATURE_2); putch(0x10); } else { if (++error_count == MAX_ERROR_COUNT) -- 2.39.5