V1.5: Enable 27C322 burning code again

Needs a special eprom adapter that provides 6V VCC and 12V VPP while programming. This can be achieved with two step-ups and a transistor.
This commit is contained in:
sanni 2018-08-24 16:48:35 +02:00 committed by GitHub
parent c9a680a989
commit 540e698e7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 16 deletions

View File

@ -2,8 +2,8 @@
Cartridge Reader for Arduino Mega2560
Author: sanni
Date: 16-08-2018
Version: 1.4
Date: 24-08-2018
Version: 1.5
SD lib: https://github.com/greiman/SdFat
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
@ -35,7 +35,7 @@
infinest - help with GB Memory cart
**********************************************************************************/
char ver[5] = "1.4";
char ver[5] = "1.5";
/******************************************
Define Starting Point
@ -444,9 +444,6 @@ void setup() {
//PORTD |= (1 << 7);
//PORTG |= (1 << 2);
// Initialize LED
rgb.setColor(0, 0, 0);
// Read current folder number out of eeprom
EEPROM_readAnything(10, foldern);
@ -456,15 +453,46 @@ void setup() {
display.setTextSize(1);
display.setTextColor(WHITE);
// Clear the buffer.
// Clear the screen buffer.
display_Clear();
// Draw line
display.drawLine(0, 32, 127, 32, WHITE);
display_Update();
delay(100);
// Initialize LED
rgb.setColor(0, 0, 0);
// Clear the screen.
display_Clear();
display_Update();
delay(25);
// Draw the Logo
display.drawBitmap(28, 0, icon, 72, 64, 1);
for (int s = 1; s < 64; s += 2) {
// Draw Scanlines
display.drawLine(0, s, 127, s, BLACK);
}
display_Update();
delay(50);
// Clear the screen.
display_Clear();
display_Update();
delay(25);
// Draw the Logo
display.drawBitmap(28, 0, icon, 72, 64, 1);
for (int s = 1; s < 64; s += 2) {
// Draw Scanlines
display.drawLine(0, s, 127, s, BLACK);
}
display.setCursor(100, 55);
display.println(ver);
display_Update();
delay(1200);
delay(200);
}
if (enable_Serial) {
@ -473,9 +501,13 @@ void setup() {
Serial.println(F("Cartridge Reader"));
Serial.println(F("2018 sanni"));
Serial.println("");
// LED
// LED Error
rgb.setColor(0, 0, 255);
}
else {
// LED Off
rgb.setColor(0, 0, 0);
}
// Init SD card
if (!sd.begin(chipSelectPin, sdSpeed)) {
@ -490,6 +522,7 @@ void setup() {
Serial.print(F("GB FAT"));
Serial.println(int(sd.vol()->fatType()));
}
startMenu();
}

View File

@ -45,15 +45,16 @@ static const char* const menuOptionsFLASH16[] PROGMEM = {flash16MenuItem1, flash
static const char epromMenuItem1[] PROGMEM = "Blankcheck";
static const char epromMenuItem2[] PROGMEM = "Read 27C322";
static const char epromMenuItem3[] PROGMEM = "Write 27C322";
static const char epromMenuItem4[] PROGMEM = "Reset";
static const char* const menuOptionsEprom[] PROGMEM = {epromMenuItem1, epromMenuItem2, epromMenuItem3, epromMenuItem4};
static const char epromMenuItem4[] PROGMEM = "Verify 27C322";
static const char epromMenuItem5[] PROGMEM = "Reset";
static const char* const menuOptionsEprom[] PROGMEM = {epromMenuItem1, epromMenuItem2, epromMenuItem3, epromMenuItem4, epromMenuItem5};
void flashMenu() {
// create menu with title and 3 options to choose from
unsigned char flashSlot;
// Copy menuOptions out of progmem
convertPgm(menuOptionsFlash, 2);
flashSlot = question_box("Select flashrom slot", menuOptions, 2, 0);
convertPgm(menuOptionsFlash, 3);
flashSlot = question_box("Select flashrom slot", menuOptions, 3, 0);
// wait for user choice to come back from the question box menu
switch (flashSlot)
@ -309,8 +310,8 @@ void epromMenu() {
// create menu with title "Eprom Writer" and 4 options to choose from
unsigned char mainMenu;
// Copy menuOptions out of progmem
convertPgm(menuOptionsEprom, 4);
mainMenu = question_box("Eprom Writer", menuOptions, 4, 0);
convertPgm(menuOptionsEprom, 5);
mainMenu = question_box("Eprom Writer", menuOptions, 5, 0);
// wait for user choice to come back from the question box menu
switch (mainMenu)
@ -336,10 +337,18 @@ void epromMenu() {
display_Clear();
time = millis();
write_Eprom();
//verify_Eprom();
break;
case 3:
filePath[0] = '\0';
sd.chdir("/");
fileBrowser("Verify against");
display_Clear();
time = millis();
verify_Eprom();
break;
case 4:
time = 0;
display_Clear();
display_Update();
@ -350,6 +359,8 @@ void epromMenu() {
print_Msg(F("Operation took: "));
print_Msg((millis() - time) / 1000, DEC);
println_Msg("s");
println_Msg("Please do a manual");
println_Msg("powercycle now");
display_Update();
}
wait();
@ -569,6 +580,17 @@ void setup_Eprom() {
// 27C322 is a 4MB eprom
flashSize = 4194304;
display_Clear();
println_Msg("This is still a work");
println_Msg("in progress.");
println_Msg("");
println_Msg("Sometimes it works...");
println_Msg("sometimes it blows up");
println_Msg("");
println_Msg("Press Button");
display_Update();
wait();
}
/******************************************