From 124f109857bd6ae3c381eb0168e58b39d2ff2a24 Mon Sep 17 00:00:00 2001 From: stefanrueger Date: Thu, 5 Jun 2025 11:17:58 +0200 Subject: [PATCH] Model F_MCS51 family in avrintel.c --- src/avrintel.c | 31 ++++++++++++++++--------------- src/libavrdude-avrintel.h | 9 +++++---- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/avrintel.c b/src/avrintel.c index 61180330..f57ea411 100644 --- a/src/avrintel.c +++ b/src/avrintel.c @@ -9,7 +9,7 @@ * Meta-author Stefan Rueger * * v 1.44 - * 23.04.2025 + * 05.06.2025 * */ @@ -1324,20 +1324,6 @@ const Avrintel uP_table[] = { // Value of -1 typically means unknown /*AT86RF401*/ 0, NULL, 0, UART_NONE, -1, NULL, // Register file, UART /*AT86RF401*/ -1, NULL, WDT_CLASSIC3}, // Ports, WDT - //AT89S51 avrdude // Sources - {"AT89S51", 372, F_AVR8, {0x1E, 0x51, 0x06}, // ID - /*AT89S51*/ 0, 0x01000, 0x001, 0, 0, 0, 0, 0, -1, -1, // Mem - /*AT89S51*/ -1, -1, 0, NULL, 0, NULL, // ISRs, Config - /*AT89S51*/ 0, NULL, 0, UART_UNKNOWN, -1, NULL, // Register file, UART - /*AT89S51*/ -1, NULL, WDT_UNKNOWN}, // Ports, WDT - - //AT89S52 avrdude // Sources - {"AT89S52", 373, F_AVR8, {0x1E, 0x52, 0x06}, // ID - /*AT89S52*/ 0, 0x02000, 0x001, 0, 0, 0, 0, 0, -1, -1, // Mem - /*AT89S52*/ -1, -1, 0, NULL, 0, NULL, // ISRs, Config - /*AT89S52*/ 0, NULL, 0, UART_UNKNOWN, -1, NULL, // Register file, UART - /*AT89S52*/ -1, NULL, WDT_UNKNOWN}, // Ports, WDT - //AT90PWM1 atdf, avr-gcc 12.2.0, avrdude // Sources {"AT90PWM1", 166, F_AVR8, {0x1E, 0x93, 0x83}, // ID /*AT90PWM1*/ 0, 0x02000, 0x040, 4, 0x0100, 0, 0x0200, 4, 0x0100, 0x0200, // Mem @@ -3026,6 +3012,21 @@ const Avrintel uP_table[] = { // Value of -1 typically means unknown /*AVR128DB64*/ 16, 4, 65, vtab_avr128db64, 16, cfgtab_avr32db28, // ISRs, Config /*AVR128DB64*/ 698, rgftab_avr128db64, 6, UART_AVR8X, 12, uarts_avr64da64, // Register file, UART /*AVR128DB64*/ 7, ports_avr64da64, WDT_AVR8X}, // Ports, WDT + + + //AT89S51 avrdude // Sources + {"AT89S51", 372, F_MCS51, {0x1E, 0x51, 0x06}, // ID + /*AT89S51*/ 0, 0x01000, 0x001, 0, 0, 0, 0, 0, -1, -1, // Mem + /*AT89S51*/ -1, -1, 0, NULL, 0, NULL, // ISRs, Config + /*AT89S51*/ 0, NULL, 0, UART_UNKNOWN, -1, NULL, // Register file, UART + /*AT89S51*/ -1, NULL, WDT_UNKNOWN}, // Ports, WDT + + //AT89S52 avrdude // Sources + {"AT89S52", 373, F_MCS51, {0x1E, 0x52, 0x06}, // ID + /*AT89S52*/ 0, 0x02000, 0x001, 0, 0, 0, 0, 0, -1, -1, // Mem + /*AT89S52*/ -1, -1, 0, NULL, 0, NULL, // ISRs, Config + /*AT89S52*/ 0, NULL, 0, UART_UNKNOWN, -1, NULL, // Register file, UART + /*AT89S52*/ -1, NULL, WDT_UNKNOWN}, // Ports, WDT }; diff --git a/src/libavrdude-avrintel.h b/src/libavrdude-avrintel.h index 7f8bb342..cd057db7 100644 --- a/src/libavrdude-avrintel.h +++ b/src/libavrdude-avrintel.h @@ -12,7 +12,7 @@ * Meta-author Stefan Rueger * * v 1.44 - * 23.04.2025 + * 05.06.2025 * */ @@ -71,7 +71,7 @@ typedef struct { typedef struct { // Value of -1 typically means unknown const char *name; // Name of part uint16_t mcuid; // ID of MCU in 0..2039 - uint8_t avrarch; // F_AVR8L, F_AVR8, F_XMEGA or F_AVR8X + uint8_t avrarch; // F_AVR8L, F_AVR8, F_XMEGA, F_AVR8X or F_MCS51 uint8_t sigs[3]; // Signature bytes int32_t flashoffset; // Flash offset in dual-chip MCUs (not flash->offset) int32_t flashsize; // Flash size @@ -128,6 +128,7 @@ typedef enum { #define F_AVR8 2 // ISP programming with SPI, "classic" AVRs #define F_XMEGA 4 // PDI programming, ATxmega family #define F_AVR8X 8 // UPDI programming, newer 8-bit MCUs +#define F_MCS51 16 // ISP programming, MCS-51 family (not AVR8) #define UARTTYPE_UNKNOWN (-1) #define UARTTYPE_NONE 0 @@ -320,8 +321,6 @@ extern const Avrintel uP_table[412]; #define id_at43usb355 163u #define id_at76c711 164u #define id_at86rf401 165u -#define id_at89s51 372u -#define id_at89s52 373u #define id_at90pwm1 166u #define id_at90pwm2 167u #define id_at90pwm2b 168u @@ -563,6 +562,8 @@ extern const Avrintel uP_table[412]; #define id_avr128da64 370u #define id_avr128da64s 397u #define id_avr128db64 371u +#define id_at89s51 372u +#define id_at89s52 373u // Interrupt vector table sizes (number of vectors)