update code

This commit is contained in:
Brian Peek 2021-12-27 18:21:24 -07:00
parent 7cae5ddffd
commit 7ada71e725
2 changed files with 20 additions and 26 deletions

Binary file not shown.

View File

@ -1,11 +1,12 @@
#include <Arduino.h> #include <Arduino.h>
// forced to a 1mbit eprom // forced to a 2mbit eprom
char buffer[128*1024]; char buffer[256*1024];
int addrPins[] = { 24,25,22,23,20,21,38,39,26,27,19,18,14,15,40,41,17,16 }; int addrPins[] = { 19,18,14,15,40,41,17,16,22,23,20,21,38,39,26,27,24,25 };
int dataPins[] = { 10,12,11,13,6,9,32,8 }; int dataPins[] = { 10,12,11,13,8,7,36,37,26,25 };
int oePin = 33; int cePin = 34;
int pgmPin = 33;
void readFile() void readFile()
{ {
@ -39,8 +40,6 @@ void setup()
for(int i = 0; i < 8; i++) for(int i = 0; i < 8; i++)
pinMode(dataPins[i], OUTPUT); pinMode(dataPins[i], OUTPUT);
pinMode(oePin, INPUT);
Serial.begin(115200); Serial.begin(115200);
while (!Serial.available()); while (!Serial.available());
readFile(); readFile();
@ -54,26 +53,21 @@ void loop()
Serial.printf("%d", x); Serial.printf("%d", x);
} }
Serial.printf("\r\n"); Serial.printf("\r\n");
if(digitalReadFast(oePin))
{
GPIO7_DR = 0xFF;
}
else
{
uint32_t io6 = GPIO6_DR;
uint16_t addr = ((io6 >> 12 & 0x03) | // read address pins
(io6 >> 14 & 0xFFFC)); uint32_t io6 = GPIO6_DR;
Serial.printf("Addr: %08X\r\n", addr); uint32_t addr = (((io6 >> 16) & 0xFFFF) |
((io6 & 0x0300) << 4));
Serial.printf("Addr: %08X\r\n", addr);
char b = buffer[addr]; // get byte
Serial.printf("%02X\r\n", b); char b = buffer[addr];
// set data pins Serial.printf("%02X\r\n", b);
uint32_t outb = (((b & 0x0F) << 0) |
((b & 0x70) << 5) | // set data pins
((b & 0x80) << 8)); uint32_t outb = ((b & 0x0F) << 0) |
Serial.printf("Data: %08X\r\n", outb); ((b & 0xF0) << 16);
GPIO7_DR = outb; Serial.printf("Data: %08X\r\n", outb);
} GPIO7_DR = outb;
} }