From: Manfred Steiner Date: Fri, 12 Jul 2024 07:49:03 +0000 (+0200) Subject: Korrektur R1,R3 (merge mit w-v1a-2024-06-17@9ca8a5d) X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=3c3a641;p=nano-x.git Korrektur R1,R3 (merge mit w-v1a-2024-06-17@9ca8a5d) --- diff --git a/bootloader/.vscode/c_cpp_properties.json b/bootloader/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..72a37cf --- /dev/null +++ b/bootloader/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux AVR", + "includePath": [ + "/usr/lib/avr/include/**", + "/usr/lib/gcc/avr/**" + ], + "defines": [], + "compilerPath": "/usr/bin/avr-gcc", + "compilerArgs": [ "-mmcu=atmega644p", "-DF_CPU=12000000", "-Os", "-DMAX_TIME_COUNT=F_CPU>>4", "-DNUM_LED_FLASHES=1", "-DBAUD_RATE=115200", "-DDOUBLE_SPEED" ], + "cStandard": "c11", + "cppStandard": "gnu++11", + "intelliSenseMode": "linux-gcc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/bootloader/.vscode/launch.json b/bootloader/.vscode/launch.json new file mode 100644 index 0000000..3d98d07 --- /dev/null +++ b/bootloader/.vscode/launch.json @@ -0,0 +1,38 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Build", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "build" + },{ + "name": "Flash", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "flash" + },{ + "name": "Clean", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "clean" + },{ + + // es muss mit simuc --board arduino dist/programm.elf der Simulator + // gestartet werden. Dessen gdb-stub öffnet auf localhost:1234 einen Port + "name": "Start Gdb", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/dist/atmega328p.elf", + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "/usr/bin/avr-gdb", + "miDebuggerServerAddress": ":1234", + "preLaunchTask": "build" + } + ] +} \ No newline at end of file diff --git a/bootloader/.vscode/settings.json b/bootloader/.vscode/settings.json new file mode 100644 index 0000000..0af80d1 --- /dev/null +++ b/bootloader/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cSpell.words": [], + "cSpell.ignorePaths": [ + "**/*.json", "**/*.c", "**/*.h", "**/Makefile" + ] +} diff --git a/bootloader/.vscode/tasks.json b/bootloader/.vscode/tasks.json new file mode 100644 index 0000000..74fb1c7 --- /dev/null +++ b/bootloader/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [{ + "label": "build", + "type": "shell", + "command": "make", + "problemMatcher":[ + "$gcc" + ] + },{ + "label": "clean", + "type": "shell", + "command": "make", + "args": [ "clean" ], + },{ + "label": "flash", + "type": "shell", + "command": "make", + "args": [ "flash" ], + }] +} \ No newline at end of file diff --git a/bootloader/ATmegaBOOT_168.c b/bootloader/ATmegaBOOT_168.c new file mode 100644 index 0000000..f598702 --- /dev/null +++ b/bootloader/ATmegaBOOT_168.c @@ -0,0 +1,1077 @@ +/**********************************************************/ +/* Serial Bootloader for Atmel megaAVR Controllers */ +/* */ +/* tested with ATmega8, ATmega128 and ATmega168 */ +/* should work with other mega's, see code for details */ +/* */ +/* ATmegaBOOT.c */ +/* */ +/* */ +/* 20090308: integrated Mega changes into main bootloader */ +/* source by D. Mellis */ +/* 20080930: hacked for Arduino Mega (with the 1280 */ +/* processor, backwards compatible) */ +/* by D. Cuartielles */ +/* 20070626: hacked for Arduino Diecimila (which auto- */ +/* resets when a USB connection is made to it) */ +/* by D. Mellis */ +/* 20060802: hacked for Arduino by D. Cuartielles */ +/* based on a previous hack by D. Mellis */ +/* and D. Cuartielles */ +/* */ +/* Monitor and debug functions were added to the original */ +/* code by Dr. Erik Lins, chip45.com. (See below) */ +/* */ +/* Thanks to Karl Pitrich for fixing a bootloader pin */ +/* problem and more informative LED blinking! */ +/* */ +/* For the latest version see: */ +/* http://www.chip45.com/ */ +/* */ +/* ------------------------------------------------------ */ +/* */ +/* based on stk500boot.c */ +/* Copyright (c) 2003, Jason P. Kyle */ +/* All rights reserved. */ +/* see avr1.org for original file and information */ +/* */ +/* This program is free software; you can redistribute it */ +/* and/or modify it under the terms of the GNU General */ +/* Public License as published by the Free Software */ +/* Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will */ +/* be useful, but WITHOUT ANY WARRANTY; without even the */ +/* implied warranty of MERCHANTABILITY or FITNESS FOR A */ +/* PARTICULAR PURPOSE. See the GNU General Public */ +/* License for more details. */ +/* */ +/* You should have received a copy of the GNU General */ +/* Public License along with this program; if not, write */ +/* to the Free Software Foundation, Inc., */ +/* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* */ +/* Licence can be viewed at */ +/* http://www.fsf.org/licenses/gpl.txt */ +/* */ +/* Target = Atmel AVR m128,m64,m32,m16,m8,m162,m163,m169, */ +/* m8515,m8535. ATmega161 has a very small boot block so */ +/* isn't supported. */ +/* */ +/* Tested with m168 */ +/**********************************************************/ + + +/* some includes */ +#include +#include +#include +#include +#include +#include + +/* the current avr-libc eeprom functions do not support the ATmega168 */ +/* own eeprom write/read functions are used instead */ +#if !defined(__AVR_ATmega168__) || !defined(__AVR_ATmega328P__) || !defined(__AVR_ATmega328__) || defined(__AVR_ATmega644P__) +#include +#endif + +/* Use the F_CPU defined in Makefile */ + +/* 20060803: hacked by DojoCorp */ +/* 20070626: hacked by David A. Mellis to decrease waiting time for auto-reset */ +/* set the waiting time for the bootloader */ +/* get this from the Makefile instead */ +/* #define MAX_TIME_COUNT (F_CPU>>4) */ + +/* 20070707: hacked by David A. Mellis - after this many errors give up and launch application */ +#define MAX_ERROR_COUNT 5 + +/* set the UART baud rate */ +/* 20060803: hacked by DojoCorp */ +//#define BAUD_RATE 115200 +#ifndef BAUD_RATE +#define BAUD_RATE 19200 +#endif + + +/* SW_MAJOR and MINOR needs to be updated from time to time to avoid warning message from AVR Studio */ +/* never allow AVR Studio to do an update !!!! */ +#define HW_VER 0x02 +#define SW_MAJOR 0x01 +#define SW_MINOR 0x10 + + +/* Adjust to suit whatever pin your hardware uses to enter the bootloader */ +/* ATmega128 has two UARTS so two pins are used to enter bootloader and select UART */ +/* ATmega1280 has four UARTS, but for Arduino Mega, we will only use RXD0 to get code */ +/* BL0... means UART0, BL1... means UART1 */ +#ifdef __AVR_ATmega128__ +#define BL_DDR DDRF +#define BL_PORT PORTF +#define BL_PIN PINF +#define BL0 PINF7 +#define BL1 PINF6 +#elif defined __AVR_ATmega1280__ +/* we just don't do anything for the MEGA and enter bootloader on reset anyway*/ +#else +/* other ATmegas have only one UART, so only one pin is defined to enter bootloader */ +#define BL_DDR DDRD +#define BL_PORT PORTD +#define BL_PIN PIND +#define BL PIND6 +#endif + + +/* onboard LED is used to indicate, that the bootloader was entered (3x flashing) */ +/* if monitor functions are included, LED goes on after monitor was entered */ +#if defined __AVR_ATmega128__ || defined __AVR_ATmega1280__ +/* Onboard LED is connected to pin PB7 (e.g. Crumb128, PROBOmega128, Savvy128, Arduino Mega) */ +#define LED_DDR DDRB +#define LED_PORT PORTB +#define LED_PIN PINB +#define LED PINB7 +#elif __AVR_ATmega644P__ +#define LED_DDR DDRC +#define LED_PORT PORTC +#define LED_PIN PINC +#define LED PINC4 + +#else +/* Onboard LED is connected to pin PB5 in Arduino NG, Diecimila, and Duomilanuove */ +/* other boards like e.g. Crumb8, Crumb168 are using PB2 */ +#define LED_DDR DDRB +#define LED_PORT PORTB +#define LED_PIN PINB +#define LED PINB5 +#endif + + +/* monitor functions will only be compiled when using ATmega128, due to bootblock size constraints */ +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) +#define MONITOR 1 +#endif + + +/* 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 :( + +#if defined __AVR_ATmega1280__ +#define SIG2 0x97 +#define SIG3 0x03 +#define PAGE_SIZE 0x80U //128 words + +#elif defined __AVR_ATmega1281__ +#define SIG2 0x97 +#define SIG3 0x04 +#define PAGE_SIZE 0x80U //128 words + +#elif defined __AVR_ATmega128__ +#define SIG2 0x97 +#define SIG3 0x02 +#define PAGE_SIZE 0x80U //128 words + +#elif defined __AVR_ATmega64__ +#define SIG2 0x96 +#define SIG3 0x02 +#define PAGE_SIZE 0x80U //128 words + +#elif defined __AVR_ATmega32__ +#define SIG2 0x95 +#define SIG3 0x02 +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega16__ +#define SIG2 0x94 +#define SIG3 0x03 +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega8__ +#define SIG2 0x93 +#define SIG3 0x07 +#define PAGE_SIZE 0x20U //32 words + +#elif defined __AVR_ATmega88__ +#define SIG2 0x93 +#define SIG3 0x0a +#define PAGE_SIZE 0x20U //32 words + +#elif defined __AVR_ATmega168__ +#define SIG2 0x94 +#define SIG3 0x06 +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega328P__ +#define SIG2 0x95 +#define SIG3 0x0F +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega328__ +#define SIG2 0x95 +#define SIG3 0x14 +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega644P__ +#define SIG2 0x96 +#define SIG3 0x0A +#define PAGE_SIZE 0x80U //128 words + +#elif defined __AVR_ATmega162__ +#define SIG2 0x94 +#define SIG3 0x04 +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega163__ +#define SIG2 0x94 +#define SIG3 0x02 +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega169__ +#define SIG2 0x94 +#define SIG3 0x05 +#define PAGE_SIZE 0x40U //64 words + +#elif defined __AVR_ATmega8515__ +#define SIG2 0x93 +#define SIG3 0x06 +#define PAGE_SIZE 0x20U //32 words + +#elif defined __AVR_ATmega8535__ +#define SIG2 0x93 +#define SIG3 0x08 +#define PAGE_SIZE 0x20U //32 words +#endif + + +/* function prototypes */ +void putch(char); +char getch(void); +void getNch(uint8_t); +void byte_response(uint8_t); +void nothing_response(void); +char gethex(void); +void puthex(char); +void flash_led(uint8_t); + +/* some variables */ +union address_union { + uint16_t word; + uint8_t byte[2]; +} address; + +union length_union { + uint16_t word; + uint8_t byte[2]; +} length; + +struct flags_struct { + unsigned eeprom : 1; + unsigned rampz : 1; +} flags; + +uint8_t buff[256]; +uint8_t address_high; + +uint8_t pagesz=0x80; + +uint8_t i; +uint8_t bootuart = 0; + +uint8_t error_count = 0; + +void (*app_start)(void) = 0x0000; + + +/* main program starts here */ +int main(void) +{ + uint8_t ch,ch2; + uint16_t w; + + +#ifdef __AVR_ATmega644P__ + DDRC = 0x1C; + PORTC = 0; +#endif + +#ifdef WATCHDOG_MODS + ch = MCUSR; + MCUSR = 0; + + WDTCSR |= _BV(WDCE) | _BV(WDE); + WDTCSR = 0; + + // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot. + if (! (ch & _BV(EXTRF))) // if its a not an external reset... + app_start(); // skip bootloader +#else + asm volatile("nop\n\t"); +#endif + + /* set pin direction for bootloader pin and enable pullup */ + /* for ATmega128, two pins need to be initialized */ +#ifdef __AVR_ATmega128__ + BL_DDR &= ~_BV(BL0); + BL_DDR &= ~_BV(BL1); + BL_PORT |= _BV(BL0); + BL_PORT |= _BV(BL1); +#else + /* We run the bootloader regardless of the state of this pin. Thus, don't + put it in a different state than the other pins. --DAM, 070709 + This also applies to Arduino Mega -- DC, 080930 + BL_DDR &= ~_BV(BL); + BL_PORT |= _BV(BL); + */ +#endif + + +#ifdef __AVR_ATmega128__ + /* check which UART should be used for booting */ + if(bit_is_clear(BL_PIN, BL0)) { + bootuart = 1; + } + else if(bit_is_clear(BL_PIN, BL1)) { + bootuart = 2; + } +#endif + +#if defined __AVR_ATmega1280__ + /* the mega1280 chip has four serial ports ... we could eventually use any of them, or not? */ + /* however, we don't wanna confuse people, to avoid making a mess, we will stick to RXD0, TXD0 */ + bootuart = 1; +#endif + + /* check if flash is programmed already, if not start bootloader anyway */ + if(pgm_read_byte_near(0x0000) != 0xFF) { + +#ifdef __AVR_ATmega128__ + /* no UART was selected, start application */ + if(!bootuart) { + app_start(); + } +#else + /* check if bootloader pin is set low */ + /* we don't start this part neither for the m8, nor m168 */ + //if(bit_is_set(BL_PIN, BL)) { + // app_start(); + // } +#endif + } + +#ifdef __AVR_ATmega128__ + /* no bootuart was selected, default to uart 0 */ + if(!bootuart) { + bootuart = 1; + } +#endif + + + /* initialize UART(s) depending on CPU defined */ +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) + if(bootuart == 1) { + UBRR0L = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1); + UBRR0H = (F_CPU/(BAUD_RATE*16L)-1) >> 8; + UCSR0A = 0x00; + UCSR0C = 0x06; + UCSR0B = _BV(TXEN0)|_BV(RXEN0); + } + if(bootuart == 2) { + UBRR1L = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1); + UBRR1H = (F_CPU/(BAUD_RATE*16L)-1) >> 8; + UCSR1A = 0x00; + UCSR1C = 0x06; + UCSR1B = _BV(TXEN1)|_BV(RXEN1); + } +#elif defined __AVR_ATmega163__ + UBRR = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1); + UBRRHI = (F_CPU/(BAUD_RATE*16L)-1) >> 8; + UCSRA = 0x00; + UCSRB = _BV(TXEN)|_BV(RXEN); +#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__) || defined __AVR_ATmega644P__ + +#ifdef DOUBLE_SPEED + UCSR0A = (1<> 8; +#else + UBRR0L = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1); + UBRR0H = (F_CPU/(BAUD_RATE*16L)-1) >> 8; +#endif + + UCSR0B = (1<>8; // set baud rate + UBRRL = (((F_CPU/BAUD_RATE)/16)-1); + UCSRB = (1<> 8; + UCSRA = 0x00; + UCSRC = 0x06; + UCSRB = _BV(TXEN)|_BV(RXEN); +#endif + +#if defined __AVR_ATmega1280__ + /* Enable internal pull-up resistor on pin D0 (RX), in order + to suppress line noise that prevents the bootloader from + timing out (DAM: 20070509) */ + /* feature added to the Arduino Mega --DC: 080930 */ + DDRE &= ~_BV(PINE0); + PORTE |= _BV(PINE0); +#endif + + + /* set LED pin as output */ + LED_DDR |= _BV(LED); + + + /* flash onboard LED to signal entering of bootloader */ +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) + // 4x for UART0, 5x for UART1 + flash_led(NUM_LED_FLASHES + bootuart); +#else + flash_led(NUM_LED_FLASHES); +#endif + + /* 20050803: by DojoCorp, this is one of the parts provoking the + system to stop listening, cancelled from the original */ + //putch('\0'); + + /* forever loop */ + for (;;) { + + /* get character from UART */ + ch = getch(); + + /* A bunch of if...else if... gives smaller code than switch...case ! */ + + /* Hello is anyone home ? */ + if(ch=='0') { + nothing_response(); + } + + + /* Request programmer ID */ + /* Not using PROGMEM string due to boot block in m128 being beyond 64kB boundary */ + /* Would need to selectively manipulate RAMPZ, and it's only 9 characters anyway so who cares. */ + else if(ch=='1') { + if (getch() == ' ') { + putch(0x14); + putch('A'); + putch('V'); + putch('R'); + putch(' '); + putch('I'); + putch('S'); + putch('P'); + putch(0x10); + } else { + if (++error_count == MAX_ERROR_COUNT) + app_start(); + } + } + + + /* AVR ISP/STK500 board commands DON'T CARE so default nothing_response */ + else if(ch=='@') { + ch2 = getch(); + if (ch2>0x85) getch(); + nothing_response(); + } + + + /* AVR ISP/STK500 board requests */ + else if(ch=='A') { + ch2 = getch(); + if(ch2==0x80) byte_response(HW_VER); // Hardware version + else if(ch2==0x81) byte_response(SW_MAJOR); // Software major version + else if(ch2==0x82) byte_response(SW_MINOR); // Software minor version + else if(ch2==0x98) byte_response(0x03); // Unknown but seems to be required by avr studio 3.56 + else byte_response(0x00); // Covers various unnecessary responses we don't care about + } + + + /* Device Parameters DON'T CARE, DEVICE IS FIXED */ + else if(ch=='B') { + getNch(20); + nothing_response(); + } + + + /* Parallel programming stuff DON'T CARE */ + else if(ch=='E') { + getNch(5); + nothing_response(); + } + + + /* P: Enter programming mode */ + /* R: Erase device, don't care as we will erase one page at a time anyway. */ + else if(ch=='P' || ch=='R') { + nothing_response(); + } + + + /* Leave programming mode */ + else if(ch=='Q') { + nothing_response(); +#ifdef WATCHDOG_MODS + // autoreset via watchdog (sneaky!) + WDTCSR = _BV(WDE); + while (1); // 16 ms +#endif + } + + + /* Set address, little endian. EEPROM in bytes, FLASH in words */ + /* Perhaps extra address bytes may be added in future to support > 128kB FLASH. */ + /* This might explain why little endian was used here, big endian used everywhere else. */ + else if(ch=='U') { + address.byte[0] = getch(); + address.byte[1] = getch(); + nothing_response(); + } + + + /* Universal SPI programming command, disabled. Would be used for fuses and lock bits. */ + else if(ch=='V') { + if (getch() == 0x30) { + getch(); + ch = getch(); + getch(); + if (ch == 0) { + byte_response(SIG1); + } else if (ch == 1) { + byte_response(SIG2); + } else { + byte_response(SIG3); + } + } else { + getNch(3); + byte_response(0x00); + } + } + + + /* Write memory, length is big endian and is in bytes */ + else if(ch=='d') { + length.byte[1] = getch(); + length.byte[0] = getch(); + flags.eeprom = 0; + if (getch() == 'E') flags.eeprom = 1; + for (w=0;w127) address_high = 0x01; //Only possible with m128, m256 will need 3rd address byte. FIXME + else address_high = 0x00; +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) + RAMPZ = address_high; +#endif + address.word = address.word << 1; //address * 2 -> byte location + /* if ((length.byte[0] & 0x01) == 0x01) length.word++; //Even up an odd number of bytes */ + if ((length.byte[0] & 0x01)) length.word++; //Even up an odd number of bytes + cli(); //Disable interrupts, just to be sure +#if defined(EEPE) + while(bit_is_set(EECR,EEPE)); //Wait for previous EEPROM writes to complete +#else + while(bit_is_set(EECR,EEWE)); //Wait for previous EEPROM writes to complete +#endif + asm volatile( + "clr r17 \n\t" //page_word_count + "lds r30,address \n\t" //Address of FLASH location (in bytes) + "lds r31,address+1 \n\t" + "ldi r28,lo8(buff) \n\t" //Start of buffer array in RAM + "ldi r29,hi8(buff) \n\t" + "lds r24,length \n\t" //Length of data to be written (in bytes) + "lds r25,length+1 \n\t" + "length_loop: \n\t" //Main loop, repeat for number of words in block + "cpi r17,0x00 \n\t" //If page_word_count=0 then erase page + "brne no_page_erase \n\t" + "wait_spm1: \n\t" + "lds r16,%0 \n\t" //Wait for previous spm to complete + "andi r16,1 \n\t" + "cpi r16,1 \n\t" + "breq wait_spm1 \n\t" + "ldi r16,0x03 \n\t" //Erase page pointed to by Z + "sts %0,r16 \n\t" + "spm \n\t" +#ifdef __AVR_ATmega163__ + ".word 0xFFFF \n\t" + "nop \n\t" +#endif + "wait_spm2: \n\t" + "lds r16,%0 \n\t" //Wait for previous spm to complete + "andi r16,1 \n\t" + "cpi r16,1 \n\t" + "breq wait_spm2 \n\t" + + "ldi r16,0x11 \n\t" //Re-enable RWW section + "sts %0,r16 \n\t" + "spm \n\t" +#ifdef __AVR_ATmega163__ + ".word 0xFFFF \n\t" + "nop \n\t" +#endif + "no_page_erase: \n\t" + "ld r0,Y+ \n\t" //Write 2 bytes into page buffer + "ld r1,Y+ \n\t" + + "wait_spm3: \n\t" + "lds r16,%0 \n\t" //Wait for previous spm to complete + "andi r16,1 \n\t" + "cpi r16,1 \n\t" + "breq wait_spm3 \n\t" + "ldi r16,0x01 \n\t" //Load r0,r1 into FLASH page buffer + "sts %0,r16 \n\t" + "spm \n\t" + + "inc r17 \n\t" //page_word_count++ + "cpi r17,%1 \n\t" + "brlo same_page \n\t" //Still same page in FLASH + "write_page: \n\t" + "clr r17 \n\t" //New page, write current one first + "wait_spm4: \n\t" + "lds r16,%0 \n\t" //Wait for previous spm to complete + "andi r16,1 \n\t" + "cpi r16,1 \n\t" + "breq wait_spm4 \n\t" +#ifdef __AVR_ATmega163__ + "andi r30,0x80 \n\t" // m163 requires Z6:Z1 to be zero during page write +#endif + "ldi r16,0x05 \n\t" //Write page pointed to by Z + "sts %0,r16 \n\t" + "spm \n\t" +#ifdef __AVR_ATmega163__ + ".word 0xFFFF \n\t" + "nop \n\t" + "ori r30,0x7E \n\t" // recover Z6:Z1 state after page write (had to be zero during write) +#endif + "wait_spm5: \n\t" + "lds r16,%0 \n\t" //Wait for previous spm to complete + "andi r16,1 \n\t" + "cpi r16,1 \n\t" + "breq wait_spm5 \n\t" + "ldi r16,0x11 \n\t" //Re-enable RWW section + "sts %0,r16 \n\t" + "spm \n\t" +#ifdef __AVR_ATmega163__ + ".word 0xFFFF \n\t" + "nop \n\t" +#endif + "same_page: \n\t" + "adiw r30,2 \n\t" //Next word in FLASH + "sbiw r24,2 \n\t" //length-2 + "breq final_write \n\t" //Finished + "rjmp length_loop \n\t" + "final_write: \n\t" + "cpi r17,0 \n\t" + "breq block_done \n\t" + "adiw r24,2 \n\t" //length+2, fool above check on length after short page write + "rjmp write_page \n\t" + "block_done: \n\t" + "clr __zero_reg__ \n\t" //restore zero register +#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega644P__) + : "=m" (SPMCSR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31" + +#else + : "=m" (SPMCR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31" +#endif + ); + /* Should really add a wait for RWW section to be enabled, don't actually need it since we never */ + /* exit the bootloader without a power cycle anyhow */ + } + putch(0x14); + putch(0x10); + } else { + if (++error_count == MAX_ERROR_COUNT) + app_start(); + } + } + + + /* Read memory block mode, length is big endian. */ + else if(ch=='t') { + length.byte[1] = getch(); + length.byte[0] = getch(); +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) + if (address.word>0x7FFF) flags.rampz = 1; // No go with m256, FIXME + else flags.rampz = 0; +#endif + address.word = address.word << 1; // address * 2 -> byte location + if (getch() == 'E') flags.eeprom = 1; + else flags.eeprom = 0; + if (getch() == ' ') { // Command terminator + putch(0x14); + for (w=0;w < length.word;w++) { // Can handle odd and even lengths okay + if (flags.eeprom) { // Byte access EEPROM read +#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega644P__) + while(EECR & (1<= 'a') { + return (a - 'a' + 0x0a); + } else if(a >= '0') { + return(a - '0'); + } + return a; +} + + +char gethex(void) { + return (gethexnib() << 4) + gethexnib(); +} + + +void puthex(char ch) { + char ah; + + ah = ch >> 4; + if(ah >= 0x0a) { + ah = ah - 0x0a + 'a'; + } else { + ah += '0'; + } + + ch &= 0x0f; + if(ch >= 0x0a) { + ch = ch - 0x0a + 'a'; + } else { + ch += '0'; + } + + putch(ah); + putch(ch); +} + + +void putch(char ch) +{ +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) + if(bootuart == 1) { + while (!(UCSR0A & _BV(UDRE0))); + UDR0 = ch; + } + else if (bootuart == 2) { + while (!(UCSR1A & _BV(UDRE1))); + UDR1 = ch; + } +#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__) || defined(__AVR_ATmega644P__) + while (!(UCSR0A & _BV(UDRE0))); + UDR0 = ch; +#else + /* m8,16,32,169,8515,8535,163 */ + while (!(UCSRA & _BV(UDRE))); + UDR = ch; +#endif +} + + +char getch(void) +{ +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) + uint32_t count = 0; + if(bootuart == 1) { + while(!(UCSR0A & _BV(RXC0))) { + /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/ + /* HACKME:: here is a good place to count times*/ + count++; + if (count > MAX_TIME_COUNT) + app_start(); + } + + return UDR0; + } + else if(bootuart == 2) { + while(!(UCSR1A & _BV(RXC1))) { + /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/ + /* HACKME:: here is a good place to count times*/ + count++; + if (count > MAX_TIME_COUNT) + app_start(); + } + + return UDR1; + } + return 0; +#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega644P__) + uint32_t count = 0; + while(!(UCSR0A & _BV(RXC0))){ + /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/ + /* HACKME:: here is a good place to count times*/ + count++; + if (count > MAX_TIME_COUNT) { + app_start(); + } + } + return UDR0; + +#else + /* m8,16,32,169,8515,8535,163 */ + uint32_t count = 0; + while(!(UCSRA & _BV(RXC))){ + /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/ + /* HACKME:: here is a good place to count times*/ + count++; + if (count > MAX_TIME_COUNT) + app_start(); + } + return UDR; +#endif +} + + +void getNch(uint8_t count) +{ + while(count--) { +#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) + if(bootuart == 1) { + while(!(UCSR0A & _BV(RXC0))); + UDR0; + } + else if(bootuart == 2) { + while(!(UCSR1A & _BV(RXC1))); + UDR1; + } +#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__) || defined(__AVR_ATmega644P__) + getch(); +#else + /* m8,16,32,169,8515,8535,163 */ + /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/ + //while(!(UCSRA & _BV(RXC))); + //UDR; + getch(); // need to handle time out +#endif + } +} + + +void byte_response(uint8_t val) +{ + if (getch() == ' ') { + putch(0x14); + putch(val); + putch(0x10); + } else { + if (++error_count == MAX_ERROR_COUNT) + app_start(); + } +} + + +void nothing_response(void) +{ + if (getch() == ' ') { + putch(0x14); + putch(0x10); + } else { + if (++error_count == MAX_ERROR_COUNT) + app_start(); + } +} + +void flash_led(uint8_t count) +{ + while (count--) { + LED_PORT |= _BV(LED); + _delay_ms(100); + LED_PORT &= ~_BV(LED); + _delay_ms(100); + } +} + + +/* end of file ATmegaBOOT.c */ diff --git a/bootloader/ATmegaBOOT_168_atmega644p.hex b/bootloader/ATmegaBOOT_168_atmega644p.hex new file mode 100644 index 0000000..9dbe6b5 --- /dev/null +++ b/bootloader/ATmegaBOOT_168_atmega644p.hex @@ -0,0 +1,98 @@ +:107000000C943E380C945B380C945B380C945B38D1 +:107010000C945B380C945B380C945B380C945B38A4 +:107020000C945B380C945B380C945B380C945B3894 +:107030000C945B380C945B380C945B380C945B3884 +:107040000C945B380C945B380C945B380C945B3874 +:107050000C945B380C945B380C945B380C945B3864 +:107060000C945B380C945B380C945B380C945B3854 +:107070000C945B380C945B380C945B3811241FBE65 +:10708000CFEFD0E1DEBFCDBF11E0A0E0B1E0E6EE92 +:10709000F5E702C005900D92A230B107D9F722E0C2 +:1070A000A2E0B1E001C01D92AD30B207E1F70E944D +:1070B00014390C94F13A0C9400389091C00095FF6B +:1070C000FCCF8093C6000895CF93982F8595859522 +:1070D00085958595805D9F709A3014F0C7E501C055 +:1070E000C0E3C90F0E945D388C2FCF910C945D389E +:1070F000CF92DF92EF92FF92C12CD12C760180913A +:10710000C00087FD13C08FEFC81AD80AE80AF80A32 +:1071100081EBC81681E7D8068BE0E806F10478F326 +:10712000E0910201F09103010995E9CF8091C60039 +:10713000FF90EF90DF90CF900895CF930E94783822 +:10714000C82F0E945D38C13614F089EA03C0C033ED +:107150001CF080ED8C0F01C08C2FCF910895CF9340 +:107160000E949D38C82F0E949D3890E1C99F800DD4 +:107170001124CF910895CF93C82FCC2321F00E94E2 +:107180007838C150FACFCF910895CF93C82F0E947D +:107190007838803251F484E10E945D388C2F0E944F +:1071A0005D3880E1CF910C945D38809104018F5F50 +:1071B00080930401853031F4E0910201F0910301E4 +:1071C000CF910994CF9108950E947838803231F49C +:1071D00084E10E945D3880E10C945D388091040167 +:1071E0008F5F80930401853029F4E0910201F091D2 +:1071F0000301099408958823B1F0449A2FE739EAEE +:1072000093E0215030409040E1F700C000004498E6 +:107210002FE739EA93E0215030409040E1F700C079 +:1072200000008150E8CF08958CE187B918B80000BC +:10723000E0E0F0E0E49182E08093C0008CE0809395 +:10724000C4001092C50088E18093C10086E080935D +:10725000C2005098589A3C9A81E00E94FB38FF2463 +:10726000F3940E947838803309F442C08133E1F40A +:107270000E947838803209F0A6C184E10E945D380E +:1072800081E40E945D3886E50E945D3882E50E94B7 +:107290005D3880E20E945D3889E40E945D3883E5B4 +:1072A0000E945D3880E586C1803439F40E947838C8 +:1072B0008638F0F00E9478381BC08134A1F40E9417 +:1072C0007838803811F482E003C0813821F481E0FD +:1072D0000E94C538C6CF823811F480E1F9CF8839D1 +:1072E000C9F583E0F5CF823431F484E10E94BB38E4 +:1072F0000E94E438B6CF853411F485E0F7CF982F9B +:107300009D7F9035A9F3813599F3853549F40E9425 +:107310007838809306010E94783880930701E8CF7F +:107320008635D1F40E947838803389F40E94783809 +:107330000E947838182F0E947838111102C08EE10F +:10734000C7CF113011F486E9C3CF8AE0C1CF83E003 +:107350000E94BB3880E0BCCF843609F0C6C00E94D2 +:107360007838809309020E947838809308028091CF +:107370000C028E7F80930C020E947838853429F4A9 +:1073800080910C02816080930C0208E011E0209152 +:10739000080230910902C801885091408217930772 +:1073A00030F40E947838F80181938F01F0CF0E9469 +:1073B0007838803209F007C180910C0220910601D3 +:1073C0003091070180FF29C0220F331F309307013E +:1073D00020930601E8E0F1E02091080230910902D3 +:1073E000CF01885091408217930708F07CC0F9992B +:1073F000FECF809106019091070192BD81BD8191E0 +:1074000080BDFA9AF99A8091060190910701019640 +:107410009093070180930601DFCF80910701880FC9 +:10742000880B8F2180930B02220F331F30930701AB +:10743000209306018091080280FF09C08091080214 +:107440009091090201969093090280930802F894A2 +:10745000F999FECF1127E0910601F0910701C8E0EC +:10746000D1E08091080290910902103091F40091CE +:10747000570001700130D9F303E000935700E895FD +:107480000091570001700130D9F301E100935700DA +:10749000E895099019900091570001700130D9F3D7 +:1074A00001E000935700E8951395103898F01127E4 +:1074B0000091570001700130D9F305E000935700A7 +:1074C000E8950091570001700130D9F301E1009374 +:1074D0005700E8953296029709F0C7CF103011F0A7 +:1074E0000296E5CF112484E165C0843709F052C0CB +:1074F0000E947838809309020E94783880930802AD +:107500008091060190910701880F991F90930701C0 +:10751000809306010E94783890910C02853411F412 +:10752000916001C09E7F90930C020E947838803257 +:1075300009F097CE84E10E945D3800E010E0809170 +:1075400008029091090208171907B0F580910C0202 +:1075500080FF0BC0F999FECF809106019091070141 +:1075600092BD81BDF89A80B507C081FD07C0E0914A +:107570000601F091070184910E945D388091060117 +:1075800090910701019690930701809306010F5F88 +:107590001F4FD5CF8537A1F40E947838803299F4F7 +:1075A00084E10E945D388EE10E945D3886E90E9488 +:1075B0005D388AE00E945D3880E10E945D3851CEDE +:1075C000863709F4C7CE809104018F5F8093040150 +:1075D000853009F046CEE0910201F0910301099552 +:0675E00040CEF894FFCF3D +:0275E600800023 +:040000030000700089 +:00000001FF diff --git a/bootloader/Makefile b/bootloader/Makefile new file mode 100755 index 0000000..3d96959 --- /dev/null +++ b/bootloader/Makefile @@ -0,0 +1,253 @@ +# Makefile for ATmegaBOOT +# E.Lins, 18.7.2005 +# +# Instructions +# +# To make bootloader .hex file: +# make diecimila +# make lilypad +# make ng +# etc... +# +# To burn bootloader .hex file: +# make diecimila_isp +# make lilypad_isp +# make ng_isp +# etc... + +# program name should not be changed... +PROGRAM = ATmegaBOOT_168 + +# enter the parameters for the avrdude isp tool +ISPTOOL = stk500v2 +ISPPORT = usb +ISPSPEED = -b 115200 + +MCU_TARGET = atmega168 +LDSECTION = --section-start=.text=0x3800 + +# the efuse should really be 0xf8; since, however, only the lower +# three bits of that byte are used on the atmega168, avrdude gets +# confused if you specify 1's for the higher bits, see: +# http://tinker.it/now/2007/02/24/the-tale-of-avrdude-atmega168-and-extended-bits-fuses/ +# +# similarly, the lock bits should be 0xff instead of 0x3f (to +# unlock the bootloader section) and 0xcf instead of 0x0f (to +# lock it), but since the high two bits of the lock byte are +# unused, avrdude would get confused. + +ISPFUSES = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \ +-e -u -U lock:w:0x3f:m -U efuse:w:0x$(EFUSE):m -U hfuse:w:0x$(HFUSE):m -U lfuse:w:0x$(LFUSE):m +ISPFLASH = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \ +-U flash:w:$(PROGRAM)_$(TARGET).hex -U lock:w:0x0f:m + +STK500 = "C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe" +STK500-1 = $(STK500) -e -d$(MCU_TARGET) -pf -vf -if$(PROGRAM)_$(TARGET).hex \ +-lFF -LFF -f$(HFUSE)$(LFUSE) -EF8 -ms -q -cUSB -I200kHz -s -wt +STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt + + +OBJ = $(PROGRAM).o +OPTIMIZE = -Os + +DEFS = +LIBS = + +CC = avr-gcc + +# Override is only needed by avr-lib build system. + +override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(AVR_FREQ) $(DEFS) +override LDFLAGS = -Wl,$(LDSECTION) +#override LDFLAGS = -Wl,-Map,$(PROGRAM).map,$(LDSECTION) + +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump + +all: + +lilypad: TARGET = lilypad +lilypad: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>1' '-DNUM_LED_FLASHES=3' +lilypad: AVR_FREQ = 8000000L +lilypad: $(PROGRAM)_lilypad.hex + +lilypad_isp: lilypad +lilypad_isp: TARGET = lilypad +lilypad_isp: HFUSE = DD +lilypad_isp: LFUSE = E2 +lilypad_isp: EFUSE = 00 +lilypad_isp: isp + +lilypad_resonator: TARGET = lilypad_resonator +lilypad_resonator: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=3' +lilypad_resonator: AVR_FREQ = 8000000L +lilypad_resonator: $(PROGRAM)_lilypad_resonator.hex + +lilypad_resonator_isp: lilypad_resonator +lilypad_resonator_isp: TARGET = lilypad_resonator +lilypad_resonator_isp: HFUSE = DD +lilypad_resonator_isp: LFUSE = C6 +lilypad_resonator_isp: EFUSE = 00 +lilypad_resonator_isp: isp + +pro8: TARGET = pro_8MHz +pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' +pro8: AVR_FREQ = 8000000L +pro8: $(PROGRAM)_pro_8MHz.hex + +pro8_isp: pro8 +pro8_isp: TARGET = pro_8MHz +pro8_isp: HFUSE = DD +pro8_isp: LFUSE = C6 +pro8_isp: EFUSE = 00 +pro8_isp: isp + +pro16: TARGET = pro_16MHz +pro16: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' +pro16: AVR_FREQ = 16000000L +pro16: $(PROGRAM)_pro_16MHz.hex + +pro16_isp: pro16 +pro16_isp: TARGET = pro_16MHz +pro16_isp: HFUSE = DD +pro16_isp: LFUSE = C6 +pro16_isp: EFUSE = 00 +pro16_isp: isp + +pro20: TARGET = pro_20mhz +pro20: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' +pro20: AVR_FREQ = 20000000L +pro20: $(PROGRAM)_pro_20mhz.hex + +pro20_isp: pro20 +pro20_isp: TARGET = pro_20mhz +pro20_isp: HFUSE = DD +pro20_isp: LFUSE = C6 +pro20_isp: EFUSE = 00 +pro20_isp: isp + +diecimila: TARGET = diecimila +diecimila: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' +diecimila: AVR_FREQ = 16000000L +diecimila: $(PROGRAM)_diecimila.hex + +diecimila_isp: diecimila +diecimila_isp: TARGET = diecimila +diecimila_isp: HFUSE = DD +diecimila_isp: LFUSE = FF +diecimila_isp: EFUSE = 00 +diecimila_isp: isp + +ng: TARGET = ng +ng: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>1' '-DNUM_LED_FLASHES=3' +ng: AVR_FREQ = 16000000L +ng: $(PROGRAM)_ng.hex + +ng_isp: ng +ng_isp: TARGET = ng +ng_isp: HFUSE = DD +ng_isp: LFUSE = FF +ng_isp: EFUSE = 00 +ng_isp: isp + +atmega644: TARGET = atmega644 +atmega644: MCU_TARGET = atmega644p +atmega644: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DDOUBLE_SPEED -DBAUD_RATE=115200 +atmega644: AVR_FREQ = 12000000L +atmega644: LDSECTION = --section-start=.text=0x7000 +atmega644: $(PROGRAM)_atmega644p.hex + +atmega644_isp: atmega644 +atmega644_isp: TARGET = atmega644 +atmega644_isp: MCU_TARGET = atmega644p +atmega644_isp: HFUSE = D8 +atmega644_isp: LFUSE = FF +atmega644_isp: EFUSE = FF +atmega644_isp: isp + +atmega328: TARGET = atmega328 +atmega328: MCU_TARGET = atmega328p +atmega328: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 +atmega328: AVR_FREQ = 16000000L +atmega328: LDSECTION = --section-start=.text=0x7800 +atmega328: $(PROGRAM)_atmega328.hex + +atmega328_isp: atmega328 +atmega328_isp: TARGET = atmega328 +atmega328_isp: MCU_TARGET = atmega328p +atmega328_isp: HFUSE = DA +atmega328_isp: LFUSE = FF +atmega328_isp: EFUSE = 05 +atmega328_isp: isp + +atmega328_notp: TARGET = atmega328_notp +atmega328_notp: MCU_TARGET = atmega328 +atmega328_notp: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 +atmega328_notp: AVR_FREQ = 16000000L +atmega328_notp: LDSECTION = --section-start=.text=0x7800 +atmega328_notp: $(PROGRAM)_atmega328_notp.hex + +atmega328_notp_isp: atmega328_notp +atmega328_notp_isp: TARGET = atmega328 +atmega328_notp_isp: MCU_TARGET = atmega328 +atmega328_notp_isp: HFUSE = DA +atmega328_notp_isp: LFUSE = FF +atmega328_notp_isp: EFUSE = 05 +atmega328_notp_isp: isp + +atmega328_pro8: TARGET = atmega328_pro_8MHz +atmega328_pro8: MCU_TARGET = atmega328p +atmega328_pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 -DDOUBLE_SPEED +atmega328_pro8: AVR_FREQ = 8000000L +atmega328_pro8: LDSECTION = --section-start=.text=0x7800 +atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.hex + +atmega328_pro8_isp: atmega328_pro8 +atmega328_pro8_isp: TARGET = atmega328_pro_8MHz +atmega328_pro8_isp: MCU_TARGET = atmega328p +atmega328_pro8_isp: HFUSE = DA +atmega328_pro8_isp: LFUSE = FF +atmega328_pro8_isp: EFUSE = 05 +atmega328_pro8_isp: isp + +mega: TARGET = atmega1280 +mega: MCU_TARGET = atmega1280 +mega: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=0' -DBAUD_RATE=57600 +mega: AVR_FREQ = 16000000L +mega: LDSECTION = --section-start=.text=0x1F000 +mega: $(PROGRAM)_atmega1280.hex + +mega_isp: mega +mega_isp: TARGET = atmega1280 +mega_isp: MCU_TARGET = atmega1280 +mega_isp: HFUSE = DA +mega_isp: LFUSE = FF +mega_isp: EFUSE = F5 +mega_isp: isp + +isp: $(TARGET) + $(ISPFUSES) + $(ISPFLASH) + +isp-stk500: $(PROGRAM)_$(TARGET).hex + $(STK500-1) + $(STK500-2) + +%.elf: $(OBJ) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) + +clean: + rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex + +%.lst: %.elf + $(OBJDUMP) -h -S $< > $@ + +%.hex: %.elf + $(OBJCOPY) -j .text -j .data -O ihex $< $@ + +%.srec: %.elf + $(OBJCOPY) -j .text -j .data -O srec $< $@ + +%.bin: %.elf + $(OBJCOPY) -j .text -j .data -O binary $< $@ + diff --git a/kicad/bom.ods b/kicad/bom.ods index f5a85ef..df6c274 100644 Binary files a/kicad/bom.ods and b/kicad/bom.ods differ diff --git a/kicad/dist/v1a/README.md b/kicad/dist/v1a/README.md index 5a8fabb..26e7952 100644 --- a/kicad/dist/v1a/README.md +++ b/kicad/dist/v1a/README.md @@ -60,24 +60,31 @@ Q1 bewusst nahe am Rand platziert, damit keine Kollision mit Lötstelle J1-15 au ## Fehler / Verbesserungen + Datum | Reference | Beschreibung | +--------- | -------------- | ---------------------------------------------------------- | +16.6.2024 | J3, U3, U1 | JLCPCB plugin, Rotation um 90° | + + ### Konzept Keine ### Schaltung -Keine + Datum | Reference | Beschreibung | +--------- | ------------------ | ---------------------------------------------------------- | +12.7.2024 | R1 | Änderung 560R -> 1K (JLCPCB C4410) | +12.7.2024 | R3 | Änderung 560R -> 4K7 (JLCPCB C17936) | +12.7.2024 | Netz LED-GREEN/PC2 | Umbenennung auf Netz LED-RED/PC2 | +12.7.2024 | Netz LED-RED/PC4 | Umbenennung auf Netz LED-GRENN/PC4 | -| Reference | Beschreibung | -| -------------- | ---------------------------------------------------------- | ### Bestückung -Keine - -| Reference | Beschreibung | -| -------------- | ---------------------------------------------------------- | -| J3, U3, U1 | JLCPCB plugin, Rotation um 90° | + Datum | Reference | Beschreibung | +--------- | -------------- | ---------------------------------------------------------- | +12.7.2024 | R1 | Änderung 560R -> 1K (JLCPCB C4410) | +12.7.2024 | R3 | Änderung 560R -> 4K7 (JLCPCB C17936) | ### Funktion / Software @@ -87,4 +94,23 @@ Keine ## Inbetriebnahme / Test -Noch nicht erfolgt. +### Erstinbetriebnahme (2.7.2024/SX) + +Folgende Einheiten getestet: + +* µC: OK +* USB-C: OK +* UART0: OK +* UART1: OK +* ISP: OK +* LEDs: Deaktivierung JTAG-Interface via Fuses erforderlich, Grün und Rot zu hell -> Anpassung der Vorwiderstände erforderlich +* Reset-Taster: OK +* Taster SW2: OK + +Noch nicht getestet: + +* 868MHz-Modem (U3, E07-900MM10S) +* RTC (U5, BM8563EMA) + + +C16 des CH349K ist sehr nahe an einem der LED-Vorwiderständen die zu tauschen sind. Daher besondere Vorsicht beim Austausch von R1! diff --git a/kicad/dist/v1a/nano-644_v1a_schematic-bw.pdf b/kicad/dist/v1a/nano-644_v1a_schematic-bw.pdf index 06fae9b..e21e3ab 100644 Binary files a/kicad/dist/v1a/nano-644_v1a_schematic-bw.pdf and b/kicad/dist/v1a/nano-644_v1a_schematic-bw.pdf differ diff --git a/kicad/dist/v1a/nano-644_v1a_schematic.pdf b/kicad/dist/v1a/nano-644_v1a_schematic.pdf index 682194c..75e2247 100644 Binary files a/kicad/dist/v1a/nano-644_v1a_schematic.pdf and b/kicad/dist/v1a/nano-644_v1a_schematic.pdf differ diff --git a/kicad/dist/v1a/nano-664_v1a_bom.pdf b/kicad/dist/v1a/nano-664_v1a_bom.pdf index 345830f..037884b 100644 Binary files a/kicad/dist/v1a/nano-664_v1a_bom.pdf and b/kicad/dist/v1a/nano-664_v1a_bom.pdf differ diff --git a/kicad/dist/v1a/order_W202406171605422_2024-06-17/kosten.txt b/kicad/dist/v1a/order_W202406171605422_2024-06-17/kosten.txt new file mode 100644 index 0000000..4b7f883 --- /dev/null +++ b/kicad/dist/v1a/order_W202406171605422_2024-06-17/kosten.txt @@ -0,0 +1,639 @@ +no-image + +RS-05K10R0FT + +FH (Guangdong Fenghua Advanced Tech) RS-05K10R0FT + +JLCPCB Part #:C136598 + +20 X €0.0014 + + +€0.03 + +● Complete + +Reorder +no-image + +RC0402FR-07470KL + +YAGEO RC0402FR-07470KL + +JLCPCB Part #:C137976 + +20 X €0.0006 + + +€0.02 + +● Complete + +no-image + +CL05B104KO5NNNC + +Samsung Electro-Mechanics CL05B104KO5NNNC + +JLCPCB Part #:C1525 + +90 X €0.0010 + + +€0.09 + +● Complete + +no-image + +CL05A106MQ5NUNC + +Samsung Electro-Mechanics CL05A106MQ5NUNC + +JLCPCB Part #:C15525 + +20 X €0.0040 + + +€0.08 + +● Complete + +no-image + +FNR5020S101MT + +cjiang (Changjiang Microelectronics Tech) FNR5020S101MT + +JLCPCB Part #:C167947 + +14 X €0.0456 + + +€0.64 + +● Complete + +no-image + +CM315D32768DZFT + +CITIZEN CM315D32768DZFT + +JLCPCB Part #:C182057 + +10 X €0.1999 + + +€2.02 + +● Complete + +no-image + +CH340K + +WCH(Jiangsu Qin Heng) CH340K + +JLCPCB Part #:C18208922 + +10 X €0.4196 + + +€4.24 + +● Complete + +no-image + +2.54-2*3P + +BOOMELE(Boom Precision Elec) 2.54-2*3P + +JLCPCB Part #:C192301 + +15 X €0.0270 + + +€0.41 + +● Complete + +no-image + +0402WGF1000TCE + +UNI-ROYAL(Uniroyal Elec) 0402WGF1000TCE + +JLCPCB Part #:C25076 + +30 X €0.0005 + + +€0.02 + +● Complete + +no-image + +0402WGF1003TCE + +UNI-ROYAL(Uniroyal Elec) 0402WGF1003TCE + +JLCPCB Part #:C25741 + +30 X €0.0005 + + +€0.02 + +● Complete + +no-image + +0402WGF1502TCE + +UNI-ROYAL(Uniroyal Elec) 0402WGF1502TCE + +JLCPCB Part #:C25756 + +20 X €0.0005 + + +€0.01 + +● Complete + +no-image + +BM8563EMA + +GATEMODE BM8563EMA + +JLCPCB Part #:C269878 + +10 X €0.2381 + + +€2.42 + +● Complete + +no-image + +RB161QS-40T18R + +ROHM Semicon RB161QS-40T18R + +JLCPCB Part #:C2837790 + +12 X €0.0796 + + +€0.97 + +● Complete + +no-image + +0805W8F5600T5E + +UNI-ROYAL(Uniroyal Elec) 0805W8F5600T5E + +JLCPCB Part #:C28636 + +40 X €0.0015 + + +€0.07 + +● Complete + +no-image + +USB-TYPE-C-019 + +DEALON USB-TYPE-C-019 + +JLCPCB Part #:C2927039 + +10 X €0.0452 + + +€0.46 + +● Complete + +no-image + +B5819W + +GOODWORK B5819W + +JLCPCB Part #:C2943878 + +30 X €0.0076 + + +€0.23 + +● Complete + +no-image + +1206B475K160NT + +FH (Guangdong Fenghua Advanced Tech) 1206B475K160NT + +JLCPCB Part #:C313095 + +20 X €0.0223 + + +€0.45 + +● Complete + +no-image + +SC0402F1002F2ANRH + +Sunway SC0402F1002F2ANRH + +JLCPCB Part #:C3152059 + +50 X €0.0004 + + +€0.02 + +● Complete + +no-image + +SC0805F0000I4ANRH + +Sunway SC0805F0000I4ANRH + +JLCPCB Part #:C3152172 + +20 X €0.0013 + + +€0.03 + +● Complete + +no-image + +0402WGF6802TCE + +UNI-ROYAL(Uniroyal Elec) 0402WGF6802TCE + +JLCPCB Part #:C36871 + +20 X €0.0005 + + +€0.01 + +● Complete + +no-image + +TCC0805X7R105K500DT + +CCTC TCC0805X7R105K500DT + +JLCPCB Part #:C376926 + +20 X €0.0075 + + +€0.15 + +● Complete + +no-image + +TCC0402X7R223K500AT + +CCTC TCC0402X7R223K500AT + +JLCPCB Part #:C380305 + +20 X €0.0007 + + +€0.02 + +● Complete + +no-image + +S3212000101080 + +JGHC S3212000101080 + +JLCPCB Part #:C390763 + +14 X €0.0477 + + +€0.67 + +● Complete + +no-image + +H9108 + +Shanghai Siproin Microelectronics H9108 + +JLCPCB Part #:C411008 + +12 X €0.1035 + + +€1.26 + +● Complete + +no-image + +SZYY0805R + +Yongyu Photoelectric SZYY0805R + +JLCPCB Part #:C434431 + +20 X €0.0085 + + +€0.18 + +● Complete + +no-image + +SZYY0805G + +Yongyu Photoelectric SZYY0805G + +JLCPCB Part #:C434432 + +20 X €0.0114 + + +€0.23 + +● Complete + +no-image + +SZYY0805Y + +Yongyu Photoelectric SZYY0805Y + +JLCPCB Part #:C434436 + +20 X €0.0123 + + +€0.25 + +● Complete + +no-image + +C0805B104K500NT + +TORCH C0805B104K500NT + +JLCPCB Part #:C476766 + +20 X €0.0029 + + +€0.07 + +● Complete + +no-image + +MTP125-1115S1 + +MINTRON MTP125-1115S1 + +JLCPCB Part #:C5142341 + +10 X €0.0682 + + +€0.69 + +● Complete + +no-image + +CS3216X5R226M160NRI + +Samwha Capacitor CS3216X5R226M160NRI + +JLCPCB Part #:C5177178 + +20 X €0.0226 + + +€0.46 + +● Complete + +no-image + +MCL1608S100MT + +Sunlord MCL1608S100MT + +JLCPCB Part #:C51942 + +20 X €0.0167 + + +€0.34 + +● Complete + +no-image + +E07-900MM10S + +Chengdu Ebyte Elec Tech E07-900MM10S + +JLCPCB Part #:C5844212 + +10 X €2.1093 + + +€21.34 + +● Complete + +no-image + +TCC0402X7R103M500AT + +CCTC TCC0402X7R103M500AT + +JLCPCB Part #:C696856 + +20 X €0.0005 + + +€0.01 + +● Complete + +no-image + +TCC0402X7R102M500AT + +CCTC TCC0402X7R102M500AT + +JLCPCB Part #:C696907 + +20 X €0.0006 + + +€0.02 + +● Complete + +no-image + +TCC0402COG100K500AT + +CCTC TCC0402COG100K500AT + +JLCPCB Part #:C713505 + +30 X €0.0005 + + +€0.02 + +● Complete + +no-image + +JK-NSMD025-24V + +Jinrui Electronic Materials Co. JK-NSMD025-24V + +JLCPCB Part #:C720074 + +20 X €0.0223 + + +€0.45 + +● Complete + +no-image + +2301D + +HL 2301D + +JLCPCB Part #:C7499855 + +14 X €0.0140 + + +€0.20 + +● Complete + +no-image + +SMBJ3V3-E3/52 + +Vishay Intertech SMBJ3V3-E3/52 + +JLCPCB Part #:C82082 + +12 X €0.1096 + + +€1.43 + +● Complete + +2024-05-25 16:31:00 +POB0202405252230141 + + +Order total: €143.96 + + Invoice +Pre-order Items +no-image + +ATMEGA644PA-MN + +Microchip Tech ATMEGA644PA-MN + +JLCPCB Part #:C1340386 + +10 X €5.7712 + + +€81.24 + +● Complete + +Estimated lead time:2024-06-20 + +Reorder +no-image + +TL3305AF160QG + +E-Switch TL3305AF160QG + +JLCPCB Part #:C2886899 + +100 X €0.1234 + + +€29.03 + +● Complete + +Estimated lead time:2024-06-20 + +no-image + +DS1021-1x3SF11-B + +CONNFLY Elec DS1021-1x3SF11-B + +JLCPCB Part #:C7430359 + +878 X €0.0091 + + +€4.63 +Refund: $3.69 + +● Complete + +Estimated lead time:2024-06-05 + +no-image + +TL3305AF260QG + +E-Switch TL3305AF260QG + +JLCPCB Part #:C2886902 diff --git a/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-charge-details.png b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-charge-details.png new file mode 100644 index 0000000..e9e7b8e Binary files /dev/null and b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-charge-details.png differ diff --git a/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-component-placement-bottom.png b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-component-placement-bottom.png new file mode 100644 index 0000000..8dad413 Binary files /dev/null and b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-component-placement-bottom.png differ diff --git a/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-component-placement-top.png b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-component-placement-top.png new file mode 100644 index 0000000..69e755b Binary files /dev/null and b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-component-placement-top.png differ diff --git a/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-payment.png b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-payment.png new file mode 100644 index 0000000..9e2cc75 Binary files /dev/null and b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-payment.png differ diff --git a/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-shopping-cart.png b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-shopping-cart.png new file mode 100644 index 0000000..ad4fd10 Binary files /dev/null and b/kicad/dist/v1a/order_W202406171605422_2024-06-17/order-shopping-cart.png differ diff --git a/kicad/dist/v1a/production_files/order-charge-details.png b/kicad/dist/v1a/production_files/order-charge-details.png deleted file mode 100644 index e9e7b8e..0000000 Binary files a/kicad/dist/v1a/production_files/order-charge-details.png and /dev/null differ diff --git a/kicad/dist/v1a/production_files/order-component-placement-bottom.png b/kicad/dist/v1a/production_files/order-component-placement-bottom.png deleted file mode 100644 index 8dad413..0000000 Binary files a/kicad/dist/v1a/production_files/order-component-placement-bottom.png and /dev/null differ diff --git a/kicad/dist/v1a/production_files/order-component-placement-top.png b/kicad/dist/v1a/production_files/order-component-placement-top.png deleted file mode 100644 index 69e755b..0000000 Binary files a/kicad/dist/v1a/production_files/order-component-placement-top.png and /dev/null differ diff --git a/kicad/dist/v1a/production_files/order-payment.png b/kicad/dist/v1a/production_files/order-payment.png deleted file mode 100644 index 9e2cc75..0000000 Binary files a/kicad/dist/v1a/production_files/order-payment.png and /dev/null differ diff --git a/kicad/dist/v1a/production_files/order-shopping-cart.png b/kicad/dist/v1a/production_files/order-shopping-cart.png deleted file mode 100644 index ad4fd10..0000000 Binary files a/kicad/dist/v1a/production_files/order-shopping-cart.png and /dev/null differ diff --git a/kicad/dist/v1a/sha256 b/kicad/dist/v1a/sha256 index 9facdef..f32600e 100644 --- a/kicad/dist/v1a/sha256 +++ b/kicad/dist/v1a/sha256 @@ -2,16 +2,13 @@ cd0939076bea3bbfc7f43482d4ef51a0b6bae810384ebbc7c871fe304cc4f547 ./nano-644_v1a f14de00b6f5b7f684754fa891f65af34f711059627ce607c53b75f4e89968869 ./nano-644_v1a_image-front.png a123293f3764f899ee23a7de2b31aeaa9b7ca42deabd8db167462433b47dd948 ./nano-644_v1a_image-front_no-comp.png ab7ec2575437005e1491c88af3d4f0f7c0fe911f17f33eeaa7bcb1eacb91cbce ./nano-644_v1a_image-back.png -dba98903ea60230eab725333e6eea293a5cc35b750c8d9d672eb39d419361a59 ./README.md -3d87c10a757ca599e0a60a7b6273b5a1b80743dbb2374e25774e201a639a6459 ./sha256 -bf94b5cfb3b45d6e431913b6246689d5e89661f3b483224a4e1525fdfc8cdb26 ./production_files/order-payment.png +5a1a5d8673bbec138cb4a27bc73b78aa5edab0039229bfa00c1adc0a89dc9861 ./README.md +a8a0472884e79a33d3e1aabc50968060d8ad8c7482b511c623ef5a6e21a7bdf6 ./sha256 706a4baf6b2be008b120eb2e3a66aad21ca4fb303f16679610f3ececa631ede2 ./production_files/BOM-nano-644.csv 0a1deec3331a56b3f79fc29161304db9a0cdbd36578cf15c90c457ac87eb8781 ./production_files/CPL-nano-644.csv 4d4996d5c766df92c4dfdc5b2a7846a8937f97ff9548fc433535af31683d4a5f ./production_files/GERBER-nano-644.zip -6d6e6669787b557e5a0e7187bf30a312328f59a38a69d1269d2f61847f375841 ./production_files/order-charge-details.png -43dbce940940895c1540fce7ebfd9687fede70303b44716a92990842d46783c3 ./production_files/order-shopping-cart.png 5341d2c20fa5cde483bd389e72d3a912cd24d135e67f0ef4f89731be5436a37a ./nano-644_v1a_bestueckung.pdf -f843f4667b73bb27b426dbd0a1020d16d642ca8a1cead38cb2feff84fa81b1ec ./nano-644_v1a_schematic-bw.pdf +2ae8120e387e8147029823e9ea83679394b99680c4a769497e52d0aee24c7944 ./nano-644_v1a_schematic-bw.pdf 50092cfeb720d5cab0f7f7ad7681966ec23d7cf31de4a28fd1629eedfc35ca30 ./lagen/svg/nano-644-F_Fab.svg 586489aa67a5b2ccd42f2e3ca79a6d2cf8618fabc5117c03e785a2452905bf91 ./lagen/svg/nano-644-B_Cu.svg 7cd35fb0456ef780ffa164c2a3652bd81fb4662e659e34e7b0a823126fd62f07 ./lagen/svg/nano-644-In2_Cu.svg @@ -30,9 +27,15 @@ ffff0edc99972b868b0a96c4d54d1f9a142ca2403bc08c92db7f2222fb4b0954 ./lagen/pdf/na 1dde2e6086d5ec98ed5e21c4661365047cf76ca7d4148f1dcc939bbb1aa54752 ./lagen/pdf/nano-644-In2_Cu.pdf 4b5ae3868fc2c23ea32eb4b1c5f0679df665677780d99cf96df789cd19eecde8 ./lagen/pdf/nano-644-B_Fab.pdf b0b1a6b98c42bc9b5b4c1e59dd2e82cc50b395c3273e8d46009b616604c0c46c ./lagen/pdf/nano-644-F_Cu.pdf +bf94b5cfb3b45d6e431913b6246689d5e89661f3b483224a4e1525fdfc8cdb26 ./order_W202406171605422_2024-06-17/order-payment.png +6d6e6669787b557e5a0e7187bf30a312328f59a38a69d1269d2f61847f375841 ./order_W202406171605422_2024-06-17/order-charge-details.png +031c7d0d8838e1f44c623936677c8f775c4dbc7ba387c4aacfa366c9e2414197 ./order_W202406171605422_2024-06-17/kosten.txt +43dbce940940895c1540fce7ebfd9687fede70303b44716a92990842d46783c3 ./order_W202406171605422_2024-06-17/order-shopping-cart.png +ceacfb2a41c2566b0bbf98ca68332d7c1379e992ae05b120677d21718d5b0471 ./order_W202406171605422_2024-06-17/order-component-placement-bottom.png +b7cb972a265345c6c5ef5c1ebeef6e3f1249057ad1c7793685911d2ecab58e3e ./order_W202406171605422_2024-06-17/order-component-placement-top.png 994422e4d7801264bd761460b161c05a10e9350f9a6f926d000278aee9ea4b9c ./reports/bom.csv b6ac49554fc039148501dc0169f29b84a95cb05256b7fdf0b2495889ddce7a4b ./reports/jlcpcb-plugin af8cc9e2b0974fbcac6f4cf778fe883c7dc2febd20057a4ab4582ba9807c9b86 ./reports/DRC.rpt 966604422d68b4c5160aabc76740a8c3828e0c08af5518301ca567e0ce8f2095 ./reports/ERC.rpt -90858ba1bb775852a2cbd4a44d1d4e2add168777d809f20c5f8e86801053a900 ./nano-664_v1a_bom.pdf -b5d461bab8a0fdca25619c6bc3aa9368220269f25e4d9a3383d74dbfe868a2ce ./nano-644_v1a_schematic.pdf +8d02de3a493212395b26aff005a25d883c70f69fb1aef750b2361ea38b0be859 ./nano-664_v1a_bom.pdf +ad99c4c53aa6990d0fc43ebc610ccf1efd04a7e9948b6d9ccaf49acccd73c39b ./nano-644_v1a_schematic.pdf diff --git a/kicad/nano-644.kicad_pcb b/kicad/nano-644.kicad_pcb index 072ba8d..7605b1f 100644 --- a/kicad/nano-644.kicad_pcb +++ b/kicad/nano-644.kicad_pcb @@ -9,7 +9,7 @@ (paper "A4") (title_block (title "Nano-644") - (date "2024-06-11") + (date "2024-07-12") (rev "V1a") (company "HTBLA Kaindorf ") (comment 1 "SX/LI") @@ -216,9 +216,9 @@ (net 63 "/MISO{slash}PB6") (net 64 "/PA0{slash}ADC0") (net 65 "/PB2{slash}INT2{slash}AIN0") - (net 66 "/LED-GREEN{slash}PC2") + (net 66 "/LED-RED{slash}PC2") (net 67 "/LED-YELLOW{slash}PC3") - (net 68 "/LED-RED{slash}PC4") + (net 68 "/LED-GREEN{slash}PC4") (net 69 "/~{CS}") (net 70 "Net-(U4-TXD)") (net 71 "/~{SW2}{slash}PC5") @@ -5446,7 +5446,7 @@ ) ) ) - (property "Value" "560R" + (property "Value" "4K7" (at 0 1.65 90) (layer "F.Fab") (hide yes) @@ -5523,7 +5523,7 @@ ) ) ) - (property "LCSC" "C28636" + (property "LCSC" "C17936" (at 0 0 -90) (unlocked yes) (layer "F.Fab") @@ -5549,6 +5549,175 @@ ) ) ) + (property "LCSC-Link" "https://jlcpcb.com/partdetail/18624-1206W4F4701T5E/C17936" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "700c1bec-681f-4478-a697-3b74a39b001e") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "DIGIKEY" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "2391f343-b0f8-4e78-b1b2-b143d7dd2ba1") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "DIGIKEY-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "fc95e59e-3bc6-45f7-a7d9-c106ac862be0") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "REICHELT" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "f0846d15-e267-4eff-a6cf-bf3a801809cc") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "REICHELT-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "6548e139-eee8-4b2b-8f53-644795107120") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "RS" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "a1c9a9ee-188b-497c-ab7a-0ca796023da9") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "RS-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "c41de729-db7f-4e1a-9ef0-0bde49383426") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "CONRAD" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "ddd8602b-5998-4193-833b-1e02149842b5") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "CONRAD-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "88908c18-2a91-4431-8029-ff9049a2143b") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "EBAY" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "11f4df6e-fb7e-4127-aa7f-8086c5717fea") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "EBAY-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "7153aaba-7171-48f8-a33b-d1eb6f1c01cc") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "MOUSER" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "70a88fac-cf5c-4975-84e1-bcd9282c43cb") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "MOUSER-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "b0dad899-e157-4181-b83b-cccc604947da") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) (property ki_fp_filters "R_*") (path "/e094a73d-603e-4098-a5e9-6bacedeed6ba") (sheetname "Stammblatt") @@ -5670,7 +5839,7 @@ (size 1.2 1.4) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.208333) - (net 68 "/LED-RED{slash}PC4") + (net 68 "/LED-GREEN{slash}PC4") (pintype "passive") (uuid "102c52a8-7043-48e3-b294-9c0fb6612bfc") ) @@ -6006,7 +6175,7 @@ ) ) ) - (property "Value" "560R" + (property "Value" "1K" (at 0 1.65 90) (layer "F.Fab") (hide yes) @@ -6083,7 +6252,7 @@ ) ) ) - (property "LCSC" "C28636" + (property "LCSC" "C4410" (at 0 0 -90) (unlocked yes) (layer "F.Fab") @@ -6109,6 +6278,175 @@ ) ) ) + (property "LCSC-Link" "https://jlcpcb.com/partdetail/4817-1206W4F1001T5E/C4410" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "8bd5436d-9d9c-4fa8-bb17-50d3fd880b22") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "DIGIKEY" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "4a7b2f68-1e7c-4558-899d-99204bacfd75") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "DIGIKEY-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "c3168779-6461-4c18-97bc-3fa9cd4b0ca0") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "REICHELT" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "b70d49e4-7d36-445b-a5c5-f837e44269be") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "REICHELT-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "46e98806-ce70-4db7-a8d1-b6b5a257ba66") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "RS" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "6bff66bb-973d-43aa-8ab5-7c61cdc6c7ec") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "RS-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "c81e10f8-1b83-41e0-8094-92d48287e24e") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "CONRAD" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "efe4cf80-7897-45f4-bdd7-078e4e3a3a9d") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "CONRAD-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "336252d2-3590-4d81-b6cc-f48d7c470dfa") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "EBAY" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "cadd9d22-915e-4664-8014-dea062e7c2f0") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "EBAY-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "c8ef5d97-2650-4870-97e8-15df8c90eba4") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "MOUSER" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "711f571c-10d6-4fc9-b882-c55a656ec1a5") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "MOUSER-LINK" "" + (at 0 0 -90) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "a087dc75-e77b-4392-b36e-b9fd4a3d79bb") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) (property ki_fp_filters "R_*") (path "/4d0a896d-8a94-4c0e-a8e6-470ac5b7108b") (sheetname "Stammblatt") @@ -6230,7 +6568,7 @@ (size 1.2 1.4) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.208333) - (net 66 "/LED-GREEN{slash}PC2") + (net 66 "/LED-RED{slash}PC2") (pintype "passive") (uuid "5130eae2-fb78-466d-927f-6543fca91357") ) @@ -20560,7 +20898,7 @@ (size 0.25 1.075) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25) - (net 66 "/LED-GREEN{slash}PC2") + (net 66 "/LED-RED{slash}PC2") (pinfunction "PC2") (pintype "bidirectional") (uuid "3739242b-f224-4e02-b83b-dd031ff32df6") @@ -20580,7 +20918,7 @@ (size 1.075 0.25) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25) - (net 68 "/LED-RED{slash}PC4") + (net 68 "/LED-GREEN{slash}PC4") (pinfunction "PC4") (pintype "bidirectional") (uuid "a93e1459-5739-4a94-903b-e96b97dc2f51") diff --git a/kicad/nano-644.kicad_pro b/kicad/nano-644.kicad_pro index 511361c..cf069ca 100644 --- a/kicad/nano-644.kicad_pro +++ b/kicad/nano-644.kicad_pro @@ -646,6 +646,84 @@ "label": "JLCPCB Rotation Offset", "name": "JLCPCB Rotation Offset", "show": false + }, + { + "group_by": false, + "label": "EBAY", + "name": "EBAY", + "show": false + }, + { + "group_by": false, + "label": "CONRAD", + "name": "CONRAD", + "show": false + }, + { + "group_by": false, + "label": "MOUSER", + "name": "MOUSER", + "show": false + }, + { + "group_by": false, + "label": "MOUSER-LINK", + "name": "MOUSER-LINK", + "show": false + }, + { + "group_by": false, + "label": "REICHELT", + "name": "REICHELT", + "show": false + }, + { + "group_by": false, + "label": "REICHELT-LINK", + "name": "REICHELT-LINK", + "show": false + }, + { + "group_by": false, + "label": "RS", + "name": "RS", + "show": false + }, + { + "group_by": false, + "label": "RS-LINK", + "name": "RS-LINK", + "show": false + }, + { + "group_by": false, + "label": "CONRAD-LINK", + "name": "CONRAD-LINK", + "show": false + }, + { + "group_by": false, + "label": "DIGIKEY", + "name": "DIGIKEY", + "show": false + }, + { + "group_by": false, + "label": "DIGIKEY-LINK", + "name": "DIGIKEY-LINK", + "show": false + }, + { + "group_by": false, + "label": "EBAY-LINK", + "name": "EBAY-LINK", + "show": false + }, + { + "group_by": false, + "label": "LCSC-Link", + "name": "LCSC-Link", + "show": false } ], "filter_string": "", diff --git a/kicad/nano-644.kicad_sch b/kicad/nano-644.kicad_sch index 85a6c38..3995747 100644 --- a/kicad/nano-644.kicad_sch +++ b/kicad/nano-644.kicad_sch @@ -6,7 +6,7 @@ (paper "A4") (title_block (title "Nano-644") - (date "2024-06-17") + (date "2024-07-12") (rev "V1a") (company "HTBLA Kaindorf") (comment 1 "SX/LI") @@ -10473,7 +10473,7 @@ ) (uuid "1c1a8836-0d09-4023-b572-291dadde3588") ) - (label "LED-RED{slash}PC4" + (label "LED-GREEN{slash}PC4" (at 86.36 100.33 0) (fields_autoplaced yes) (effects @@ -10715,7 +10715,7 @@ ) (uuid "6947ceeb-8c57-4731-8b6e-f6546079d328") ) - (label "LED-GREEN{slash}PC2" + (label "LED-RED{slash}PC2" (at 86.36 95.25 0) (fields_autoplaced yes) (effects @@ -10968,7 +10968,7 @@ ) (uuid "b54e705b-40a6-405f-a7a7-cb27bf069128") ) - (label "LED-GREEN{slash}PC2" + (label "LED-RED{slash}PC2" (at 77.47 167.64 0) (fields_autoplaced yes) (effects @@ -11155,7 +11155,7 @@ ) (uuid "eda604a6-3080-4dde-a780-2a659db038c0") ) - (label "LED-RED{slash}PC4" + (label "LED-GREEN{slash}PC4" (at 77.47 182.88 0) (fields_autoplaced yes) (effects @@ -15150,7 +15150,7 @@ ) ) ) - (property "Value" "560R" + (property "Value" "1K" (at 102.362 165.354 90) (effects (font @@ -15176,7 +15176,7 @@ (hide yes) ) ) - (property "Description" "125mW Thick Film Resistors 150V ±100ppm/℃ ±1% 560Ω 0805 Chip Resistor - Surface Mount ROHS" + (property "Description" "250mW Thick Film Resistors 200V ±1% 1kΩ 1206 Chip Resistor - Surface Mount ROHS" (at 100.33 167.64 0) (effects (font @@ -15203,7 +15203,7 @@ (hide yes) ) ) - (property "LCSC" "C28636" + (property "LCSC" "C4410" (at 100.33 167.64 0) (effects (font @@ -15221,6 +15221,123 @@ (hide yes) ) ) + (property "LCSC-Link" "https://jlcpcb.com/partdetail/4817-1206W4F1001T5E/C4410" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "DIGIKEY" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "DIGIKEY-LINK" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "REICHELT" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "REICHELT-LINK" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "RS" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "RS-LINK" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "CONRAD" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "CONRAD-LINK" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "EBAY" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "EBAY-LINK" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "MOUSER" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "MOUSER-LINK" "" + (at 100.33 167.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) (pin "2" (uuid "8f93c7ad-7839-40aa-8d4d-49ef2b89493b") ) @@ -21367,7 +21484,7 @@ ) ) ) - (property "Value" "560R" + (property "Value" "4K7" (at 102.362 180.594 90) (effects (font @@ -21420,7 +21537,7 @@ (hide yes) ) ) - (property "LCSC" "C28636" + (property "LCSC" "C17936" (at 100.33 182.88 0) (effects (font @@ -21438,6 +21555,123 @@ (hide yes) ) ) + (property "LCSC-Link" "https://jlcpcb.com/partdetail/18624-1206W4F4701T5E/C17936" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "DIGIKEY" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "DIGIKEY-LINK" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "REICHELT" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "REICHELT-LINK" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "RS" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "RS-LINK" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "CONRAD" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "CONRAD-LINK" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "EBAY" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "EBAY-LINK" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "MOUSER" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "MOUSER-LINK" "" + (at 100.33 182.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) (pin "2" (uuid "a1fae828-704c-466c-8800-17e98e6a2ba6") )