From 79594dc8638b8185c6716829e974ef3fef209c22 Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:45:17 +0800 Subject: [PATCH 1/5] Use library functions for memcpy from flash --- afterburner.ino | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/afterburner.ino b/afterburner.ino index 851fb94..bca8184 100644 --- a/afterburner.ino +++ b/afterburner.ino @@ -598,16 +598,7 @@ void setup() { //copy galinfo item from the flash array into RAM backed struct static void copyGalInfo(void) { - uint8_t* src = (uint8_t*) &galInfoList[gal]; - uint8_t* dst = (uint8_t*) &galinfo; - uint8_t total = sizeof(galinfo_t); - uint8_t i = 0; - while (i < total) { - *dst = pgm_read_byte(src); - dst++; - src++; - i++; - } + memcpy_P(&galinfo, &galInfoList[gal], sizeof(galinfo_t)); } // read from serial line and discard the data From 5c2cd50d47df3ca56c7c948a2f982c797359445d Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:48:09 +0800 Subject: [PATCH 2/5] Support GAL20RA10 --- afterburner.ino | 83 ++++++++++++++++---------------------------- src_pc/afterburner.c | 2 ++ 2 files changed, 32 insertions(+), 53 deletions(-) diff --git a/afterburner.ino b/afterburner.ino index bca8184..a939d4e 100644 --- a/afterburner.ino +++ b/afterburner.ino @@ -147,6 +147,7 @@ typedef enum { GAL16V8, GAL18V10, GAL20V8, + GAL20RA10, GAL20XV10, GAL22V10, GAL26CV12, @@ -178,6 +179,7 @@ typedef enum { #define CFG_BASE_16 2048 #define CFG_BASE_18 3456 #define CFG_BASE_20 2560 +#define CFG_BASE_20RA 3200 #define CFG_BASE_20XV 1600 #define CFG_BASE_22 5808 #define CFG_BASE_26CV 6344 @@ -226,6 +228,14 @@ static const unsigned char cfg18V10[] PROGMEM = 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14, 17, 16, 19, 18 }; +// common CFG fuse address map for cfg20RA10 +// starting address: 3200 +// total size 10 +static const unsigned char cfgRA10[] PROGMEM = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +}; + // common CFG fuse address map for cfg20XV10 // starting address: 1600 // total size 31 @@ -342,6 +352,7 @@ const static galinfo_t galInfoList[] PROGMEM = {GAL16V8, 0x00, 0x1A, 2194, 20, 32, 64, 32, 2056, 8, 63, 62, 58, 8, 60, CFG_BASE_16 , cfgV8AB , sizeof(cfgV8AB) , CFG_STROBE_ROW, PINOUT_16V8 }, {GAL18V10, 0x50, 0x51, 3540, 20, 36, 96, 44, 3476, 8, 61, 60, 58, 10, 16, CFG_BASE_18 , cfg18V10 , sizeof(cfg18V10) , CFG_SET_ROW , PINOUT_18V10 }, {GAL20V8, 0x20, 0x3A, 2706, 24, 40, 64, 40, 2568, 8, 63, 62, 58, 8, 60, CFG_BASE_20 , cfgV8AB , sizeof(cfgV8AB) , CFG_STROBE_ROW, PINOUT_20V8 }, + {GAL20RA10, 0x60, 0x61, 3274, 24, 40, 80, 40, 3210, 8, 61, 60, 58, 10, 16, CFG_BASE_20RA, cfgRA10 , sizeof(cfgRA10) , CFG_SET_ROW , PINOUT_22V10 }, {GAL20XV10, 0x65, 0x66, 1671, 24, 40, 40, 44, 1631, 5, 61, 60, 58, 5, 16, CFG_BASE_20XV, cfgXV10 , sizeof(cfgXV10) , CFG_SET_ROW , PINOUT_22V10 }, {GAL22V10, 0x48, 0x49, 5892, 24, 44, 132, 44, 5828, 8, 61, 62, 58, 10, 16, CFG_BASE_22 , cfgV10 , sizeof(cfgV10) , CFG_SET_ROW , PINOUT_22V10 }, {GAL26CV12, 0x58, 0x59, 6432, 28, 52, 122, 52, 6368, 8, 61, 60, 58, 12, 16, CFG_BASE_26CV, cfg26CV12, sizeof(cfg26CV12), CFG_SET_ROW , PINOUT_22V10 }, @@ -466,6 +477,7 @@ static void setPinMux(uint8_t pm) { break; + case GAL20RA10: case GAL20XV10: case GAL22V10: case GAL26CV12: @@ -1139,6 +1151,7 @@ static void strobeRow(char row, char setBit = BIT_NONE) strobe(2); // pulse /STB for 2ms break; case GAL18V10: + case GAL20RA10: case GAL20XV10: case GAL22V10: case GAL26CV12: @@ -1383,6 +1396,7 @@ void printPes(char type) { case GAL16V8: Serial.print(F("GAL16V8 ")); break; case GAL18V10: Serial.print(F("GAL18V10 ")); break; case GAL20V8: Serial.print(F("GAL20V8 ")); break; + case GAL20RA10: Serial.print(F("GAL20RA10 ")); break; case GAL20XV10: Serial.print(F("GAL20XV10 ")); break; case GAL22V10: Serial.print(F("GAL22V10 ")); break; case GAL26CV12: Serial.print(F("GAL26CV12 ")); break; @@ -1821,11 +1835,17 @@ static void readOrVerifyGal(char verify) case ATF16V8B: case ATF20V8B: + case GAL18V10: + case GAL20RA10: + case GAL20XV10: + case GAL26V12: + case GAL26CV12: + cfgArray = (unsigned char*) galinfo.cfg; //read without delay, no discard if (verify) { - i = verifyGalFuseMap(cfgV8AB, 0, 0); + i = verifyGalFuseMap(cfgArray, 0, 0); } else { - readGalFuseMap(cfgV8AB, 0, 0); + readGalFuseMap(cfgArray, 0, 0); } break; @@ -1839,41 +1859,6 @@ static void readOrVerifyGal(char verify) readGalFuseMap600(cfgArray); } break; - - case GAL18V10: - if (verify) { - i = verifyGalFuseMap(cfg18V10, 0, 0); - } else { - readGalFuseMap(cfg18V10, 0, 0); - } - break; - - - case GAL26CV12: - //read without delay, no discard - if (verify) { - i = verifyGalFuseMap(cfg26CV12, 0, 0); - } else { - readGalFuseMap(cfg26CV12, 0, 0); - } - break; - - case GAL26V12: - //read without delay, no discard - if (verify) { - i = verifyGalFuseMap(cfg26V12, 0, 0); - } else { - readGalFuseMap(cfg26V12, 0, 0); - } - break; - - case GAL20XV10: - if (verify) { - i = verifyGalFuseMap(cfgXV10, 0, 0); - } else { - readGalFuseMap(cfgXV10, 0, 0); - } - break; case GAL22V10: case ATF22V10B: @@ -2093,27 +2078,18 @@ static void writeGal() break; case GAL6001: - writeGalFuseMap600(cfg6001); - break; - case GAL6002: - writeGalFuseMap600(cfg6002); + cfgArray = (unsigned char*) galinfo.cfg; + writeGalFuseMap600(cfgArray); break; case GAL18V10: - writeGalFuseMapV10(cfg18V10, 0, 0); - break; - - case GAL26CV12: - writeGalFuseMapV10(cfg26CV12, 0, 0); - break; - - case GAL26V12: - writeGalFuseMapV10(cfg26V12, 0, 0); - break; - + case GAL20RA10: case GAL20XV10: - writeGalFuseMapV10(cfgXV10, 1, 0); + case GAL26CV12: + case GAL26V12: + cfgArray = (unsigned char*) galinfo.cfg; + writeGalFuseMapV10(cfgArray, 0, 0); break; case GAL22V10: @@ -2299,6 +2275,7 @@ static void printGalName() { case GAL16V8: Serial.println(F("GAL16V8")); break; case GAL18V10: Serial.println(F("GAL18V10")); break; case GAL20V8: Serial.println(F("GAL20V8")); break; + case GAL20RA10: Serial.println(F("GAL20RA10")); break; case GAL20XV10: Serial.println(F("GAL20XV10")); break; case GAL22V10: Serial.println(F("GAL22V10")); break; case GAL26CV12: Serial.println(F("GAL26CV12")); break; diff --git a/src_pc/afterburner.c b/src_pc/afterburner.c index df16f10..2630681 100644 --- a/src_pc/afterburner.c +++ b/src_pc/afterburner.c @@ -57,6 +57,7 @@ typedef enum { GAL16V8, GAL18V10, GAL20V8, + GAL20RA10, GAL20XV10, GAL22V10, GAL26CV12, @@ -94,6 +95,7 @@ galinfo[] = { {GAL16V8, 0x00, 0x1A, "GAL16V8", 2194, 20, 32, 64, 32, 2056, 8, 63, 54, 58, 8, 60, 82}, {GAL18V10, 0x50, 0x51, "GAL18V10", 3540, 20, 36, 96, 36, 3476, 8, 61, 60, 58, 10, 16, 20}, {GAL20V8, 0x20, 0x3A, "GAL20V8", 2706, 24, 40, 64, 40, 2568, 8, 63, 59, 58, 8, 60, 82}, + {GAL20RA10, 0x60, 0x61, "GAL20RA10", 3274, 24, 40, 80, 40, 3210, 8, 61, 60, 58, 10, 16, 10}, {GAL20XV10, 0x65, 0x66, "GAL20XV10", 1671, 24, 40, 40, 44, 1631, 5, 61, 60, 58, 5, 16, 31}, {GAL22V10, 0x48, 0x49, "GAL22V10", 5892, 24, 44, 132, 44, 5828, 8, 61, 60, 58, 10, 16, 20}, {GAL26CV12, 0x58, 0x59, "GAL26CV12", 6432, 28, 52, 122, 52, 6368, 8, 61, 60, 58, 12, 16}, From c7f063b2a9916bd96d509da3954b5e21839e2af3 Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:32:06 +0800 Subject: [PATCH 3/5] Revamp GAL support list --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c35f6e6..b98b89a 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,16 @@ Arduino UNO, which does the programming of the GAL chip. Supported GAL chips: -* Atmel ATF16V8B, ATF16V8BQL, ATF16V8C, ATF20V8B, ATF22V10B, ATF22V10C, ATF22V10CQZ -* Lattice GAL16V8A, GAL16V8B, GAL16V8D -* Lattice GAL18V10B (requires PCB v.3.1 or modified PCB v.3.0 - see Troubleshooting ) -* Lattice GAL22V10B, GAL22V10D -* National GAL16V8 -* ST Microsystems GAL16V8 -* Lattice GAL20V8B (no adapter needed) -* Lattice GAL20XV10B -* Lattice GAL6001B, GAL6002B -* Lattice GAL26CV12B, GAL26V12C (requires adapter - see gerbers, pcb and img directory) +| | 16V8 | 18V10 | 20V8 | 20RA10 | 20XV10 | 22V10 | 6001 | 6002 | 26CV12 | 26V12 | +| --- | ---- | ----- | ---- | ------ | ------ | ----- | ---- | ---- | ------ | ----- | +| Atmel | ATF16V8B, ATF16V8BQL, ATF16V8C | - | ATF20V8B | - | - | ATF22V10B, ATF22V10C, ATF22V10CQZ | - | - | - | - | - | +| Lattice | GAL16V8A, GAL16V8B, GAL16V8D | GAL18V10, GAL18V10B[1] | GAL20V8B | GAL20RA10 | GAL20XV10B | GAL22V10B, GAL22V10D | GAL6001B | GAL6002B | GAL26CV12B[2] | GAL26V12C[2] | +| National | GAL16V8 | - | GAL20V8 | - | - | - | - | - | - | - | +| ST | GAL16V8 | - | - | - | - | - | - | - | - | - | + +[1]: requires PCB v.3.1 or modified PCB v.3.0 - see Troubleshooting +[2]: requires adapter - see gerbers, pcb and img directory +[-]: - represents either this combination does not exist or hasn't been tested yet. Testers are welcome to report their findings. **This is a new Afterburner design with variable programming voltage control and with single ZIF socket for 20 and 24 pin GAL chips.** The PC software is backward compatible with the older Afterburner desgin/boards. From 50bc140928cff46ab10baa2bdfd74a28f36d4fed Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:36:01 +0800 Subject: [PATCH 4/5] Transpose table to fit better --- README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b98b89a..0bf5835 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,20 @@ Arduino UNO, which does the programming of the GAL chip. Supported GAL chips: -| | 16V8 | 18V10 | 20V8 | 20RA10 | 20XV10 | 22V10 | 6001 | 6002 | 26CV12 | 26V12 | -| --- | ---- | ----- | ---- | ------ | ------ | ----- | ---- | ---- | ------ | ----- | -| Atmel | ATF16V8B, ATF16V8BQL, ATF16V8C | - | ATF20V8B | - | - | ATF22V10B, ATF22V10C, ATF22V10CQZ | - | - | - | - | - | -| Lattice | GAL16V8A, GAL16V8B, GAL16V8D | GAL18V10, GAL18V10B[1] | GAL20V8B | GAL20RA10 | GAL20XV10B | GAL22V10B, GAL22V10D | GAL6001B | GAL6002B | GAL26CV12B[2] | GAL26V12C[2] | -| National | GAL16V8 | - | GAL20V8 | - | - | - | - | - | - | - | -| ST | GAL16V8 | - | - | - | - | - | - | - | - | - | +| | Atmel | Lattice | National | ST | +| --- | --- | --- | --- | --- | +| 16V8 | ATF16V8B, ATF16V8BQL, ATF16V8C | GAL16V8A, GAL16V8B, GAL16V8D | GAL16V8 | GAL16V8 | +| 18V10 | - | GAL18V10, GAL18V10B[1] | - | - | +| 20V8 | ATF20V8B | GAL20V8B | GAL20V8 | - | +| 20RA10 | - | GAL20RA10 | - | - | +| 20XV10 | - | GAL20XV10B | - | - | +| 22V10 | ATF22V10B, ATF22V10C, ATF22V10CQZ | GAL22V10B, GAL22V10D | - | - | +| 6001 | - | GAL6001B | - | - | +| 6002 | - | GAL6002B | - | - | +| 26CV12 | - | GAL26CV12B[2] | - | - | +| 26V12 | - | GAL26V12C[2] | - | - | -[1]: requires PCB v.3.1 or modified PCB v.3.0 - see Troubleshooting +[1]: requires PCB v.3.1 or modified PCB v.3.0 - see Troubleshooting [2]: requires adapter - see gerbers, pcb and img directory [-]: - represents either this combination does not exist or hasn't been tested yet. Testers are welcome to report their findings. From ec1e26464f69cd90b13ac3a3704125b4e6318e30 Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:59:43 +0800 Subject: [PATCH 5/5] GAL20RA10B works --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bf5835..20bc0b2 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Supported GAL chips: | 16V8 | ATF16V8B, ATF16V8BQL, ATF16V8C | GAL16V8A, GAL16V8B, GAL16V8D | GAL16V8 | GAL16V8 | | 18V10 | - | GAL18V10, GAL18V10B[1] | - | - | | 20V8 | ATF20V8B | GAL20V8B | GAL20V8 | - | -| 20RA10 | - | GAL20RA10 | - | - | +| 20RA10 | - | GAL20RA10, GAL20RA10B | - | - | | 20XV10 | - | GAL20XV10B | - | - | | 22V10 | ATF22V10B, ATF22V10C, ATF22V10CQZ | GAL22V10B, GAL22V10D | - | - | | 6001 | - | GAL6001B | - | - |