From 010c1e3e4007f74253b8819166a2ef77896e3998 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Tue, 27 Sep 2022 23:02:38 -0700 Subject: [PATCH 1/9] start of different EPROM sizes --- .vscode/extensions.json | 10 -------- src/SendEPROM | 1 + src/{ => teensy}/main.cpp | 48 +++++++++++++++++++++++++++------------ 3 files changed, 34 insertions(+), 25 deletions(-) delete mode 100644 .vscode/extensions.json create mode 160000 src/SendEPROM rename src/{ => teensy}/main.cpp (73%) diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 080e70d..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "platformio.platformio-ide" - ], - "unwantedRecommendations": [ - "ms-vscode.cpptools-extension-pack" - ] -} diff --git a/src/SendEPROM b/src/SendEPROM new file mode 160000 index 0000000..852bcbb --- /dev/null +++ b/src/SendEPROM @@ -0,0 +1 @@ +Subproject commit 852bcbb35134d515fa85c28a36daf8a93beeb717 diff --git a/src/main.cpp b/src/teensy/main.cpp similarity index 73% rename from src/main.cpp rename to src/teensy/main.cpp index db25f40..5caa4d0 100644 --- a/src/main.cpp +++ b/src/teensy/main.cpp @@ -2,24 +2,34 @@ #include #include -// forced to a 2mbit eprom // FLASHMEM // DMAMEM // PROGMEM +enum eMode : unsigned char +{ + m27C256 = 1, + m27C020 = 2, + mUnknown = 0xFF +}; + #define ROM_BUFFER_LEN (256*1024) char buffer[ROM_BUFFER_LEN]; const char *filename = "rom.bin"; +eMode mode = m27C020; +Stream* stream; int32_t inPins[] = { 19,18,14,15,40,41,17,16,22,23,20,21,38,39,26,27,24,25,-1 }; int32_t outPins[] = { 10,12,11,13,8,7,36,37,-1 }; -void readFile(int port) +void readData(Stream* s) { const int length = 1024; char buff[length]; - memset(buffer, 0, ROM_BUFFER_LEN); + mode = (eMode)s->read(); + + memset(buffer, 0xFF, ROM_BUFFER_LEN); size_t read = 0; size_t total = 0; @@ -29,15 +39,7 @@ void readFile(int port) { memset(buff, 0, length); - switch(port) - { - case 0: - read = Serial.readBytes(buff, length); - break; - case 1: - read = Serial1.readBytes(buff, length); - break; - } + read = s->readBytes(buff, length); total += read; if(read > 0) @@ -90,7 +92,23 @@ void loop() uint32_t outb = 0; // read address pins - uint32_t addr = ((io6 >> 16) & 0xFFFF) | ((io6 & 0x3000) << 4); + uint32_t addr = 0; + + switch(mode) + { + // 32Kbit, 8KB, 0x0000-0x7FFF + case m27C256: + addr = ((io6 >> 16) & 0x7FFF); + break; + + // 2Mbit, 256KB, 0x00000-0x3FFFF + case m27C020: + addr = ((io6 >> 16) & 0xFFFF) | ((io6 & 0x3000) << 4); + break; + + default: + break; + } // get byte at addr char b = buffer[addr]; @@ -101,8 +119,8 @@ void loop() // read file from either serial port, if available if(Serial.available()) - readFile(0); + readData(&Serial); if(Serial1.available()) - readFile(1); + readData(&Serial1); } From 7e9a8b821653dc31d911025620b2793f78bf6066 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Tue, 27 Sep 2022 23:06:59 -0700 Subject: [PATCH 2/9] oops --- src/SendEPROM | 1 - src/SendEPROM/App.config | 7 ++++ src/SendEPROM/Program.cs | 61 ++++++++++++++++++++++++++++++++++ src/SendEPROM/SendEPROM.csproj | 15 +++++++++ src/SendEPROM/SendEPROM.sln | 25 ++++++++++++++ 5 files changed, 108 insertions(+), 1 deletion(-) delete mode 160000 src/SendEPROM create mode 100644 src/SendEPROM/App.config create mode 100644 src/SendEPROM/Program.cs create mode 100644 src/SendEPROM/SendEPROM.csproj create mode 100644 src/SendEPROM/SendEPROM.sln diff --git a/src/SendEPROM b/src/SendEPROM deleted file mode 160000 index 852bcbb..0000000 --- a/src/SendEPROM +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 852bcbb35134d515fa85c28a36daf8a93beeb717 diff --git a/src/SendEPROM/App.config b/src/SendEPROM/App.config new file mode 100644 index 0000000..b8db93d --- /dev/null +++ b/src/SendEPROM/App.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/SendEPROM/Program.cs b/src/SendEPROM/Program.cs new file mode 100644 index 0000000..1c3880a --- /dev/null +++ b/src/SendEPROM/Program.cs @@ -0,0 +1,61 @@ +using System.IO.Ports; +using System.Configuration; + +namespace SendEPROM +{ + public class Program + { + public static int Main(string[] args) + { + if(args.Length != 3 && args.Length != 2) + return Usage(); + + string port = ConfigurationManager.AppSettings["port"]; + int baud = int.Parse(ConfigurationManager.AppSettings["baud"]); + string file = string.Empty; + byte mode = 0; + + if(args.Length == 2) + { + mode = byte.Parse(args[0]); + file = args[1]; + } + else if(args.Length == 3) + { + port = args[0]; + baud = int.Parse(args[1]); + file = args[2]; + } + + Console.WriteLine($"Reading {file}"); + byte[] buff = File.ReadAllBytes(file); + + Console.WriteLine($"Opening {port} at {baud}"); + var sp = new SerialPort(port) + { + BaudRate = baud + }; + sp.Open(); + + if(mode != 0) + { + Console.WriteLine($"Sending mode {mode}"); + byte[] modeBuff = { mode }; + sp.Write(modeBuff, 0, 1); + } + + Console.WriteLine($"Sending {buff.Length} bytes"); + sp.Write(buff, 0, buff.Length); + sp.Close(); + Console.WriteLine("Done!"); + + return 0; + } + + private static int Usage() + { + Console.WriteLine("Usage: SendEPROM [COMX] [baud] [EPROM mode] filename"); + return -1; + } + } +} \ No newline at end of file diff --git a/src/SendEPROM/SendEPROM.csproj b/src/SendEPROM/SendEPROM.csproj new file mode 100644 index 0000000..942af57 --- /dev/null +++ b/src/SendEPROM/SendEPROM.csproj @@ -0,0 +1,15 @@ + + + + Exe + net6.0 + enable + disable + + + + + + + + diff --git a/src/SendEPROM/SendEPROM.sln b/src/SendEPROM/SendEPROM.sln new file mode 100644 index 0000000..1513a9e --- /dev/null +++ b/src/SendEPROM/SendEPROM.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SendEPROM", "SendEPROM.csproj", "{1B795DA1-604C-44C9-8306-BE3E84743BA2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1B795DA1-604C-44C9-8306-BE3E84743BA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1B795DA1-604C-44C9-8306-BE3E84743BA2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1B795DA1-604C-44C9-8306-BE3E84743BA2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1B795DA1-604C-44C9-8306-BE3E84743BA2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C5F74E1C-5293-43CD-9F71-72BC2BEB69B5} + EndGlobalSection +EndGlobal From 8fc3c4ba03c214805287ec176384bccffbf43e65 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Tue, 27 Sep 2022 23:08:58 -0700 Subject: [PATCH 3/9] update ignore/extensions --- .gitignore | 365 ++++++++++++++++++++++++++++++++++++++++ .vscode/extensions.json | 10 ++ 2 files changed, 375 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore index ed8cea9..0c59ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,368 @@ fp-info-cache # Exported BOM files *.xml *.csv + + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} From 63befcb95f260e9cdeead4ae214a9573983d2249 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Tue, 27 Sep 2022 23:35:26 -0700 Subject: [PATCH 4/9] update firmware + sender --- src/SendEPROM/App.config | 7 ----- src/SendEPROM/Program.cs | 53 ++++++++++++++++------------------ src/SendEPROM/SendEPROM.csproj | 3 +- src/teensy/main.cpp | 6 ++-- 4 files changed, 29 insertions(+), 40 deletions(-) delete mode 100644 src/SendEPROM/App.config diff --git a/src/SendEPROM/App.config b/src/SendEPROM/App.config deleted file mode 100644 index b8db93d..0000000 --- a/src/SendEPROM/App.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/SendEPROM/Program.cs b/src/SendEPROM/Program.cs index 1c3880a..23f5fa7 100644 --- a/src/SendEPROM/Program.cs +++ b/src/SendEPROM/Program.cs @@ -1,34 +1,39 @@ using System.IO.Ports; -using System.Configuration; +using System.CommandLine; namespace SendEPROM { public class Program { - public static int Main(string[] args) + public static async Task Main(string[] args) { - if(args.Length != 3 && args.Length != 2) - return Usage(); + var rootCmd = new RootCommand("Send a binary image to the EPROM emulator"); - string port = ConfigurationManager.AppSettings["port"]; - int baud = int.Parse(ConfigurationManager.AppSettings["baud"]); - string file = string.Empty; - byte mode = 0; + var portOption = new Option (new string[] {"--port", "-p" }, description: "COM port on which to send the file", getDefaultValue: () => "COM3"); + var baudOption = new Option (new string[] {"--baud", "-b" }, description: "Baud rate at which to send", getDefaultValue: () => 115200); + var modeOption = new Option (new string[] {"--mode", "-m" }, description: "EPROM mode (1 = 27C256, 2 = 27C020)", getDefaultValue: () => 2); - if(args.Length == 2) + var fileArgument = new Argument("file", description: "File to send"); + + rootCmd.AddOption(portOption); + rootCmd.AddOption(baudOption); + rootCmd.AddOption(modeOption); + rootCmd.AddArgument(fileArgument); + + rootCmd.SetHandler((port, baud, mode, file) => { - mode = byte.Parse(args[0]); - file = args[1]; - } - else if(args.Length == 3) - { - port = args[0]; - baud = int.Parse(args[1]); - file = args[2]; - } + SendData(port, baud, mode, file); + }, + portOption, baudOption, modeOption, fileArgument); - Console.WriteLine($"Reading {file}"); - byte[] buff = File.ReadAllBytes(file); + return await rootCmd.InvokeAsync(args); + } + + static void SendData(string port, int baud, byte mode, FileInfo file) + { + + Console.WriteLine($"Reading {file.Name}"); + byte[] buff = File.ReadAllBytes(file.Name); Console.WriteLine($"Opening {port} at {baud}"); var sp = new SerialPort(port) @@ -48,14 +53,6 @@ namespace SendEPROM sp.Write(buff, 0, buff.Length); sp.Close(); Console.WriteLine("Done!"); - - return 0; - } - - private static int Usage() - { - Console.WriteLine("Usage: SendEPROM [COMX] [baud] [EPROM mode] filename"); - return -1; } } } \ No newline at end of file diff --git a/src/SendEPROM/SendEPROM.csproj b/src/SendEPROM/SendEPROM.csproj index 942af57..a933b14 100644 --- a/src/SendEPROM/SendEPROM.csproj +++ b/src/SendEPROM/SendEPROM.csproj @@ -8,7 +8,8 @@ - + + diff --git a/src/teensy/main.cpp b/src/teensy/main.cpp index 5caa4d0..8a37ff2 100644 --- a/src/teensy/main.cpp +++ b/src/teensy/main.cpp @@ -96,17 +96,15 @@ void loop() switch(mode) { - // 32Kbit, 8KB, 0x0000-0x7FFF + // 256Kbit, 32KB, 0x0000-0x7FFF case m27C256: addr = ((io6 >> 16) & 0x7FFF); break; // 2Mbit, 256KB, 0x00000-0x3FFFF case m27C020: - addr = ((io6 >> 16) & 0xFFFF) | ((io6 & 0x3000) << 4); - break; - default: + addr = ((io6 >> 16) & 0xFFFF) | ((io6 & 0x3000) << 4); break; } From 25c90418b7d8e9b22fa58c342d7b59be01a4a248 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Tue, 27 Sep 2022 23:36:00 -0700 Subject: [PATCH 5/9] remove unknown, always default to 2mbit --- src/teensy/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/teensy/main.cpp b/src/teensy/main.cpp index 8a37ff2..dbe9503 100644 --- a/src/teensy/main.cpp +++ b/src/teensy/main.cpp @@ -10,7 +10,6 @@ enum eMode : unsigned char { m27C256 = 1, m27C020 = 2, - mUnknown = 0xFF }; #define ROM_BUFFER_LEN (256*1024) From 8e6956034f77ea126f7e5b6955df1065a0cd8b70 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Sat, 1 Oct 2022 16:15:10 -0700 Subject: [PATCH 6/9] Oops, needs FullName, not Name --- .vscode/tasks.json | 12 ++++++++++- src/SendEPROM/Program.cs | 39 +++++++++++++++++++--------------- src/SendEPROM/SendEPROM.csproj | 1 - 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index eb7fd53..54db57a 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,4 +1,14 @@ { "version": "2.0.0", - "tasks": [] + "tasks": [ + { + "type": "PlatformIO", + "task": "Build", + "problemMatcher": [ + "$platformio" + ], + "group": "build", + "label": "PlatformIO: Build" + } + ] } \ No newline at end of file diff --git a/src/SendEPROM/Program.cs b/src/SendEPROM/Program.cs index 23f5fa7..a805233 100644 --- a/src/SendEPROM/Program.cs +++ b/src/SendEPROM/Program.cs @@ -1,5 +1,8 @@ -using System.IO.Ports; +using System; +using System.IO; +using System.IO.Ports; using System.CommandLine; +using System.Threading.Tasks; namespace SendEPROM { @@ -7,24 +10,26 @@ namespace SendEPROM { public static async Task Main(string[] args) { - var rootCmd = new RootCommand("Send a binary image to the EPROM emulator"); - - var portOption = new Option (new string[] {"--port", "-p" }, description: "COM port on which to send the file", getDefaultValue: () => "COM3"); - var baudOption = new Option (new string[] {"--baud", "-b" }, description: "Baud rate at which to send", getDefaultValue: () => 115200); - var modeOption = new Option (new string[] {"--mode", "-m" }, description: "EPROM mode (1 = 27C256, 2 = 27C020)", getDefaultValue: () => 2); + var portOption = new Option(new string[] {"--port", "-p" }, description: "COM port on which to send the file", getDefaultValue: () => "COM3"); + var baudOption = new Option (new string[] {"--baud", "-b" }, description: "Baud rate at which to send", getDefaultValue: () => 115200); + var modeOption = new Option (new string[] {"--mode", "-m" }, description: "EPROM mode (1 = 27C256, 2 = 27C020)", getDefaultValue: () => 2); var fileArgument = new Argument("file", description: "File to send"); - rootCmd.AddOption(portOption); - rootCmd.AddOption(baudOption); - rootCmd.AddOption(modeOption); - rootCmd.AddArgument(fileArgument); - - rootCmd.SetHandler((port, baud, mode, file) => + var rootCmd = new RootCommand("Send a binary image to the EPROM emulator") { - SendData(port, baud, mode, file); - }, - portOption, baudOption, modeOption, fileArgument); + portOption, + baudOption, + modeOption, + fileArgument + }; + + rootCmd.SetHandler( + (port, baud, mode, file) => + { + SendData(port, baud, mode, file); + }, + portOption, baudOption, modeOption, fileArgument); return await rootCmd.InvokeAsync(args); } @@ -32,8 +37,8 @@ namespace SendEPROM static void SendData(string port, int baud, byte mode, FileInfo file) { - Console.WriteLine($"Reading {file.Name}"); - byte[] buff = File.ReadAllBytes(file.Name); + Console.WriteLine($"Reading {file.FullName}"); + byte[] buff = File.ReadAllBytes(file.FullName); Console.WriteLine($"Opening {port} at {baud}"); var sp = new SerialPort(port) diff --git a/src/SendEPROM/SendEPROM.csproj b/src/SendEPROM/SendEPROM.csproj index a933b14..08ef6d4 100644 --- a/src/SendEPROM/SendEPROM.csproj +++ b/src/SendEPROM/SendEPROM.csproj @@ -3,7 +3,6 @@ Exe net6.0 - enable disable From 8ff6f6264f456dd6a36e5cbd9ad1d7006ad5e3f3 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Fri, 21 Oct 2022 11:07:48 -0700 Subject: [PATCH 7/9] remove unused files --- schematic/epromemu.kicad_pro | 2 +- schematic/epromemu.pro | 248 ------------- schematic/epromemu.rules | 101 ------ schematic/epromemu.sch | 668 ----------------------------------- 4 files changed, 1 insertion(+), 1018 deletions(-) delete mode 100644 schematic/epromemu.pro delete mode 100644 schematic/epromemu.rules delete mode 100644 schematic/epromemu.sch diff --git a/schematic/epromemu.kicad_pro b/schematic/epromemu.kicad_pro index 9b8fdd6..5268d1a 100644 --- a/schematic/epromemu.kicad_pro +++ b/schematic/epromemu.kicad_pro @@ -418,7 +418,7 @@ "workbook_filename": "" }, "page_layout_descr_file": "", - "plot_directory": "", + "plot_directory": "./", "spice_adjust_passive_values": false, "spice_external_command": "spice \"%I\"", "subpart_first_id": 65, diff --git a/schematic/epromemu.pro b/schematic/epromemu.pro deleted file mode 100644 index a7b73d2..0000000 --- a/schematic/epromemu.pro +++ /dev/null @@ -1,248 +0,0 @@ -update=12/26/2021 1:36:16 PM -version=1 -last_client=kicad -[general] -version=1 -RootSch= -BoardNm= -[cvpcb] -version=1 -NetIExt=net -[eeschema] -version=1 -LibDir= -[eeschema/libraries] -[schematic_editor] -version=1 -PageLayoutDescrFile= -PlotDirectoryName= -SubpartIdSeparator=0 -SubpartFirstId=65 -NetFmtName=Pcbnew -SpiceAjustPassiveValues=0 -LabSize=50 -ERC_TestSimilarLabels=1 -[pcbnew] -version=1 -PageLayoutDescrFile= -LastNetListRead=test.net -CopperLayerCount=2 -BoardThickness=1.6 -AllowMicroVias=0 -AllowBlindVias=0 -RequireCourtyardDefinitions=0 -ProhibitOverlappingCourtyards=1 -MinTrackWidth=0.1524 -MinViaDiameter=0.508 -MinViaDrill=0.254 -MinMicroViaDiameter=0.2 -MinMicroViaDrill=0.09999999999999999 -MinHoleToHole=0.25 -TrackWidth1=0.1524 -ViaDiameter1=0.6858 -ViaDrill1=0.3302 -dPairWidth1=0.2 -dPairGap1=0.25 -dPairViaGap1=0.25 -SilkLineWidth=0.12 -SilkTextSizeV=1 -SilkTextSizeH=1 -SilkTextSizeThickness=0.15 -SilkTextItalic=0 -SilkTextUpright=1 -CopperLineWidth=0.2 -CopperTextSizeV=1.5 -CopperTextSizeH=1.5 -CopperTextThickness=0.3 -CopperTextItalic=0 -CopperTextUpright=1 -EdgeCutLineWidth=0.05 -CourtyardLineWidth=0.05 -OthersLineWidth=0.15 -OthersTextSizeV=1 -OthersTextSizeH=1 -OthersTextSizeThickness=0.15 -OthersTextItalic=0 -OthersTextUpright=1 -SolderMaskClearance=0.0508 -SolderMaskMinWidth=0 -SolderPasteClearance=0 -SolderPasteRatio=-0 -[pcbnew/Layer.F.Cu] -Name=F.Cu -Type=0 -Enabled=1 -[pcbnew/Layer.In1.Cu] -Name=In1.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In2.Cu] -Name=In2.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In3.Cu] -Name=In3.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In4.Cu] -Name=In4.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In5.Cu] -Name=In5.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In6.Cu] -Name=In6.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In7.Cu] -Name=In7.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In8.Cu] -Name=In8.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In9.Cu] -Name=In9.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In10.Cu] -Name=In10.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In11.Cu] -Name=In11.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In12.Cu] -Name=In12.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In13.Cu] -Name=In13.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In14.Cu] -Name=In14.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In15.Cu] -Name=In15.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In16.Cu] -Name=In16.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In17.Cu] -Name=In17.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In18.Cu] -Name=In18.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In19.Cu] -Name=In19.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In20.Cu] -Name=In20.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In21.Cu] -Name=In21.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In22.Cu] -Name=In22.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In23.Cu] -Name=In23.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In24.Cu] -Name=In24.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In25.Cu] -Name=In25.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In26.Cu] -Name=In26.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In27.Cu] -Name=In27.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In28.Cu] -Name=In28.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In29.Cu] -Name=In29.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.In30.Cu] -Name=In30.Cu -Type=0 -Enabled=0 -[pcbnew/Layer.B.Cu] -Name=B.Cu -Type=0 -Enabled=1 -[pcbnew/Layer.B.Adhes] -Enabled=1 -[pcbnew/Layer.F.Adhes] -Enabled=1 -[pcbnew/Layer.B.Paste] -Enabled=1 -[pcbnew/Layer.F.Paste] -Enabled=1 -[pcbnew/Layer.B.SilkS] -Enabled=1 -[pcbnew/Layer.F.SilkS] -Enabled=1 -[pcbnew/Layer.B.Mask] -Enabled=1 -[pcbnew/Layer.F.Mask] -Enabled=1 -[pcbnew/Layer.Dwgs.User] -Enabled=1 -[pcbnew/Layer.Cmts.User] -Enabled=1 -[pcbnew/Layer.Eco1.User] -Enabled=1 -[pcbnew/Layer.Eco2.User] -Enabled=1 -[pcbnew/Layer.Edge.Cuts] -Enabled=1 -[pcbnew/Layer.Margin] -Enabled=1 -[pcbnew/Layer.B.CrtYd] -Enabled=1 -[pcbnew/Layer.F.CrtYd] -Enabled=1 -[pcbnew/Layer.B.Fab] -Enabled=1 -[pcbnew/Layer.F.Fab] -Enabled=1 -[pcbnew/Layer.Rescue] -Enabled=0 -[pcbnew/Netclasses] -[pcbnew/Netclasses/Default] -Name=Default -Clearance=0.1524 -TrackWidth=0.1524 -ViaDiameter=0.6858 -ViaDrill=0.3302 -uViaDiameter=0.6858 -uViaDrill=0.3302 -dPairWidth=0.2 -dPairGap=0.25 -dPairViaGap=0.25 diff --git a/schematic/epromemu.rules b/schematic/epromemu.rules deleted file mode 100644 index c9d365d..0000000 --- a/schematic/epromemu.rules +++ /dev/null @@ -1,101 +0,0 @@ - -(rules PCB epromemu - (snap_angle - fortyfive_degree - ) - (autoroute_settings - (fanout off) - (autoroute on) - (postroute on) - (vias on) - (via_costs 50) - (plane_via_costs 5) - (start_ripup_costs 100) - (start_pass_no 37791) - (layer_rule "F.Cu" - (active on) - (preferred_direction horizontal) - (preferred_direction_trace_costs 1.0) - (against_preferred_direction_trace_costs 2.7) - ) - (layer_rule "B.Cu" - (active on) - (preferred_direction vertical) - (preferred_direction_trace_costs 1.0) - (against_preferred_direction_trace_costs 1.6) - ) - ) - (rule - (width 250.0) - (clear 200.2) - (clear 125.0 (type smd_to_turn_gap)) - ) - (padstack "Via[0-1]_685.8:330.2_um" - (shape - (circle "F.Cu" 685.8 0.0 0.0) - ) - (shape - (circle "B.Cu" 685.8 0.0 0.0) - ) - (attach off) - ) - (padstack "Via[0-1]_800:400_um" - (shape - (circle "F.Cu" 800.0 0.0 0.0) - ) - (shape - (circle "B.Cu" 800.0 0.0 0.0) - ) - (attach off) - ) - (via - "Via[0-1]_685.8:330.2_um" "Via[0-1]_685.8:330.2_um" "default" - ) - (via - "Via[0-1]_685.8:330.2_um-kicad_default" "Via[0-1]_685.8:330.2_um" "kicad_default" - ) - (via - "Via[0-1]_800:400_um" "Via[0-1]_800:400_um" "default" - ) - (via - "Via[0-1]_800:400_um-kicad_default" "Via[0-1]_800:400_um" "kicad_default" - ) - (via_rule - "default" "Via[0-1]_800:400_um" - ) - (via_rule - "kicad_default" "Via[0-1]_800:400_um-kicad_default" - ) - (class "default" - "unconnected-(U1-Pad25)" "unconnected-(U1-Pad26)" "unconnected-(U1-Pad24)" "unconnected-(U1-Pad27)" "unconnected-(U1-Pad34)" "unconnected-(U1-Pad11)" "unconnected-(U1-Pad8)" "unconnected-(U1-Pad7)" - "unconnected-(U1-Pad6)" "unconnected-(U1-Pad5)" "unconnected-(U1-Pad4)" "A19_5V" "A19_3V3" "unconnected-(U1-Pad46)" "unconnected-(U1-Pad47)" "unconnected-(U3-Pad8)" - "unconnected-(U1-Pad20)" "A18_5V" "A18_3V3" "Net-(J1-Pad32)" "unconnected-(U5-Pad8)" "unconnected-(U5-Pad9)" "unconnected-(U5-Pad11)" "unconnected-(U5-Pad12)" - "unconnected-(U1-Pad21)" "unconnected-(U1-Pad22)" "unconnected-(U1-Pad23)" "unconnected-(U3-Pad9)" "unconnected-(U3-Pad11)" "unconnected-(U3-Pad12)" "Net-(U2-Pad19)" - (clearance_class "default") - (via_rule "default") - (rule - (width 250.0) - ) - (circuit - (use_layer F.Cu B.Cu) - ) - ) - (class "kicad_default" - "+5V" "A17_5V" "A14_5V" "A13_5V" "A8_5V" "A9_5V" "A11_5V" "GND" - "A10_5V" "D7_5V" "D6_5V" "D5_5V" "D4_5V" "D3_5V" "D2_5V" "D1_5V" - "D0_5V" "A0_5V" "A1_5V" "A2_5V" "A3_5V" "A4_5V" "A5_5V" "A6_5V" - "A7_5V" "A12_5V" "A15_5V" "A16_5V" "A1_3V3" "A16_3V3" "A17_3V3" "A0_3V3" - "+3V3" "D1_3V3" "D6_3V3" "A14_3V3" "A15_3V3" "A6_3V3" "A7_3V3" "D2_3V3" - "D0_3V3" "D5_3V3" "D7_3V3" "D4_3V3" "D3_3V3" "A4_3V3" "A5_3V3" "A9_3V3" - "A8_3V3" "A3_3V3" "A2_3V3" "A12_3V3" "A13_3V3" "A10_3V3" "A11_3V3" "OE_5V" - "CE_5V" - (clearance_class "kicad_default") - (via_rule "kicad_default") - (rule - (width 250.0) - ) - (circuit - (use_layer F.Cu B.Cu) - ) - ) -) \ No newline at end of file diff --git a/schematic/epromemu.sch b/schematic/epromemu.sch deleted file mode 100644 index 5e250ce..0000000 --- a/schematic/epromemu.sch +++ /dev/null @@ -1,668 +0,0 @@ -EESchema Schematic File Version 4 -EELAYER 30 0 -EELAYER END -$Descr USLetter 11000 8500 -encoding utf-8 -Sheet 1 1 -Title "EPROM Emulator" -Date "2021-12-09" -Rev "0.1" -Comp "Brian Peek" -Comment1 "" -Comment2 "" -Comment3 "" -Comment4 "" -$EndDescr -$Comp -L teensy:Teensy4.1 U1 -U 1 1 61A52DD6 -P 5350 3300 -F 0 "U1" H 5350 5700 50 0000 C CNN -F 1 "Teensy4.1" H 5350 5600 50 0000 C CNN -F 2 "teensy:Teensy41" H 4950 3700 50 0001 C CNN -F 3 "" H 4950 3700 50 0001 C CNN - 1 5350 3300 - 1 0 0 -1 -$EndComp -Text GLabel 4250 2050 0 50 Input ~ 0 -D4_3V3 -Text GLabel 6450 3050 2 50 Input ~ 0 -D7_3V3 -Text GLabel 4250 1950 0 50 Input ~ 0 -D5_3V3 -Text GLabel 4250 2250 0 50 Input ~ 0 -D0_3V3 -Text GLabel 4250 2350 0 50 Input ~ 0 -D2_3V3 -Text GLabel 4250 2450 0 50 Input ~ 0 -D1_3V3 -Text GLabel 6450 1850 2 50 Input ~ 0 -A0_3V3 -Text GLabel 6450 1950 2 50 Input ~ 0 -A1_3V3 -Text GLabel 2300 1500 0 50 Input ~ 0 -D4_5V -Text GLabel 2300 2000 0 50 Input ~ 0 -D7_5V -Text GLabel 2300 1400 0 50 Input ~ 0 -D5_5V -Text GLabel 2300 1600 0 50 Input ~ 0 -D0_5V -Text GLabel 2300 1700 0 50 Input ~ 0 -D2_5V -Text GLabel 2300 1800 0 50 Input ~ 0 -D1_5V -Text GLabel 4250 2650 0 50 Input ~ 0 -A16_3V3 -Text GLabel 6450 3150 2 50 Input ~ 0 -D6_3V3 -Text GLabel 4250 2850 0 50 Input ~ 0 -A14_3V3 -Text GLabel 4250 2950 0 50 Input ~ 0 -A15_3V3 -Text GLabel 6450 2050 2 50 Input ~ 0 -A6_3V3 -Text GLabel 6450 2150 2 50 Input ~ 0 -A7_3V3 -Text GLabel 2300 2100 0 50 Input ~ 0 -D6_5V -NoConn ~ 4250 1250 -NoConn ~ 4250 1350 -NoConn ~ 4250 1450 -NoConn ~ 4250 1550 -NoConn ~ 4250 1650 -NoConn ~ 4250 1750 -NoConn ~ 4250 3050 -NoConn ~ 4250 3150 -NoConn ~ 4250 3250 -NoConn ~ 4250 3350 -Text GLabel 6450 2450 2 50 Input ~ 0 -D3_3V3 -Text GLabel 6450 2750 2 50 Input ~ 0 -A4_3V3 -Text GLabel 6450 2650 2 50 Input ~ 0 -A5_3V3 -Text GLabel 6450 1450 2 50 Input ~ 0 -A9_3V3 -Text GLabel 6450 1550 2 50 Input ~ 0 -A8_3V3 -Text GLabel 6450 2250 2 50 Input ~ 0 -A3_3V3 -Text GLabel 6450 2350 2 50 Input ~ 0 -A2_3V3 -Text GLabel 6450 2950 2 50 Input ~ 0 -A12_3V3 -Text GLabel 6450 2850 2 50 Input ~ 0 -A13_3V3 -Text GLabel 6450 1750 2 50 Input ~ 0 -A10_3V3 -Text GLabel 6450 1650 2 50 Input ~ 0 -A11_3V3 -NoConn ~ 6450 1350 -NoConn ~ 6450 1250 -NoConn ~ 6450 1150 -NoConn ~ 6450 2550 -Text GLabel 7350 1650 0 50 Input ~ 0 -A11_3V3 -Text GLabel 7350 1750 0 50 Input ~ 0 -A10_3V3 -Text GLabel 7350 3950 0 50 Input ~ 0 -A13_3V3 -Text GLabel 7350 4050 0 50 Input ~ 0 -A12_3V3 -Text GLabel 7350 1550 0 50 Input ~ 0 -A8_3V3 -Text GLabel 7350 1450 0 50 Input ~ 0 -A9_3V3 -Text GLabel 8350 1650 2 50 Input ~ 0 -A11_5V -Text GLabel 8350 1750 2 50 Input ~ 0 -A10_5V -Text GLabel 8350 1550 2 50 Input ~ 0 -A8_5V -Text GLabel 8350 1450 2 50 Input ~ 0 -A9_5V -Text GLabel 3300 3750 2 50 Input ~ 0 -A14_3V3 -Text GLabel 3300 3850 2 50 Input ~ 0 -A15_3V3 -Text GLabel 2300 1900 0 50 Input ~ 0 -D3_5V -Text GLabel 2300 3850 0 50 Input ~ 0 -A15_5V -Text GLabel 2300 3750 0 50 Input ~ 0 -A14_5V -Wire Wire Line - 4100 1150 4250 1150 -$Comp -L power:GND #PWR0106 -U 1 1 61B2EF8F -P 4100 1150 -F 0 "#PWR0106" H 4100 900 50 0001 C CNN -F 1 "GND" H 4105 977 50 0000 C CNN -F 2 "" H 4100 1150 50 0001 C CNN -F 3 "" H 4100 1150 50 0001 C CNN - 1 4100 1150 - 1 0 0 -1 -$EndComp -Wire Wire Line - 3600 2550 3700 2550 -$Comp -L power:GND #PWR0103 -U 1 1 61B6B98A -P 2800 2700 -F 0 "#PWR0103" H 2800 2450 50 0001 C CNN -F 1 "GND" H 2805 2527 50 0000 C CNN -F 2 "" H 2800 2700 50 0001 C CNN -F 3 "" H 2800 2700 50 0001 C CNN - 1 2800 2700 - 1 0 0 -1 -$EndComp -$Comp -L power:PWR_FLAG #FLG0101 -U 1 1 61B71FE1 -P 4250 1150 -F 0 "#FLG0101" H 4250 1225 50 0001 C CNN -F 1 "PWR_FLAG" H 4250 1323 50 0000 C CNN -F 2 "" H 4250 1150 50 0001 C CNN -F 3 "~" H 4250 1150 50 0001 C CNN - 1 4250 1150 - 1 0 0 -1 -$EndComp -Connection ~ 4250 1150 -$Comp -L power:PWR_FLAG #FLG0102 -U 1 1 61B73F25 -P 3700 2550 -F 0 "#FLG0102" H 3700 2625 50 0001 C CNN -F 1 "PWR_FLAG" H 3700 2723 50 0000 C CNN -F 2 "" H 3700 2550 50 0001 C CNN -F 3 "~" H 3700 2550 50 0001 C CNN - 1 3700 2550 - 1 0 0 -1 -$EndComp -Connection ~ 3700 2550 -Wire Wire Line - 3700 2550 4250 2550 -$Comp -L 74xx:74HC245 U2 -U 1 1 61BFF42A -P 2800 1900 -F 0 "U2" H 2800 2881 50 0000 C CNN -F 1 "74HC245" H 2800 2790 50 0000 C CNN -F 2 "Package_DIP:DIP-20_W7.62mm_Socket" H 2800 1900 50 0001 C CNN -F 3 "http://www.ti.com/lit/gpn/sn74HC245" H 2800 1900 50 0001 C CNN - 1 2800 1900 - 1 0 0 -1 -$EndComp -$Comp -L 74xx:74HC245 U3 -U 1 1 61C044A4 -P 2800 4050 -F 0 "U3" H 2800 5031 50 0000 C CNN -F 1 "74HC245" H 2800 4940 50 0000 C CNN -F 2 "Package_DIP:DIP-20_W7.62mm_Socket" H 2800 4050 50 0001 C CNN -F 3 "http://www.ti.com/lit/gpn/sn74HC245" H 2800 4050 50 0001 C CNN - 1 2800 4050 - 1 0 0 -1 -$EndComp -$Comp -L 74xx:74HC245 U4 -U 1 1 61C0A79A -P 7850 1950 -F 0 "U4" H 7850 2931 50 0000 C CNN -F 1 "74HC245" H 7850 2840 50 0000 C CNN -F 2 "Package_DIP:DIP-20_W7.62mm_Socket" H 7850 1950 50 0001 C CNN -F 3 "http://www.ti.com/lit/gpn/sn74HC245" H 7850 1950 50 0001 C CNN - 1 7850 1950 - 1 0 0 -1 -$EndComp -$Comp -L power:GND #PWR0101 -U 1 1 61C10C6A -P 2800 4850 -F 0 "#PWR0101" H 2800 4600 50 0001 C CNN -F 1 "GND" H 2805 4677 50 0000 C CNN -F 2 "" H 2800 4850 50 0001 C CNN -F 3 "" H 2800 4850 50 0001 C CNN - 1 2800 4850 - 1 0 0 -1 -$EndComp -$Comp -L power:GND #PWR0102 -U 1 1 61C11276 -P 7850 2750 -F 0 "#PWR0102" H 7850 2500 50 0001 C CNN -F 1 "GND" H 7855 2577 50 0000 C CNN -F 2 "" H 7850 2750 50 0001 C CNN -F 3 "" H 7850 2750 50 0001 C CNN - 1 7850 2750 - 1 0 0 -1 -$EndComp -$Comp -L power:GND #PWR0104 -U 1 1 61C117F6 -P 7850 4850 -F 0 "#PWR0104" H 7850 4600 50 0001 C CNN -F 1 "GND" H 7855 4677 50 0000 C CNN -F 2 "" H 7850 4850 50 0001 C CNN -F 3 "" H 7850 4850 50 0001 C CNN - 1 7850 4850 - 1 0 0 -1 -$EndComp -$Comp -L power:+3.3V #PWR0105 -U 1 1 61C14256 -P 3600 2550 -F 0 "#PWR0105" H 3600 2400 50 0001 C CNN -F 1 "+3.3V" H 3615 2723 50 0000 C CNN -F 2 "" H 3600 2550 50 0001 C CNN -F 3 "" H 3600 2550 50 0001 C CNN - 1 3600 2550 - -1 0 0 1 -$EndComp -$Comp -L 74xx:74HC245 U5 -U 1 1 61C0D6BD -P 7850 4050 -F 0 "U5" H 7850 5031 50 0000 C CNN -F 1 "74HC245" H 7850 4940 50 0000 C CNN -F 2 "Package_DIP:DIP-20_W7.62mm_Socket" H 7850 4050 50 0001 C CNN -F 3 "http://www.ti.com/lit/gpn/sn74HC245" H 7850 4050 50 0001 C CNN - 1 7850 4050 - 1 0 0 -1 -$EndComp -Text GLabel 8350 4150 2 50 Input ~ 0 -CE_5V -Text GLabel 7350 4150 0 50 Input ~ 0 -CE_3V3 -Text GLabel 7350 4250 0 50 Input ~ 0 -PGM_3V3 -Text GLabel 8350 4250 2 50 Input ~ 0 -PGM_5V -Text GLabel 6450 3450 2 50 Input ~ 0 -PGM_3V3 -Text GLabel 6450 3350 2 50 Input ~ 0 -CE_3V3 -Wire Wire Line - 2800 2700 1950 2700 -Wire Wire Line - 1950 2700 1950 2300 -Wire Wire Line - 1950 2300 2300 2300 -Connection ~ 2800 2700 -Wire Wire Line - 7850 2750 7350 2750 -Connection ~ 7850 2750 -Wire Wire Line - 7850 4850 7350 4850 -Connection ~ 7850 4850 -Wire Wire Line - 2800 4850 2300 4850 -Connection ~ 2800 4850 -Wire Wire Line - 7350 4550 7350 4850 -Wire Wire Line - 7350 2450 7350 2750 -Wire Wire Line - 2300 4550 2300 4850 -Text GLabel 2300 2400 0 50 Input ~ 0 -OE_5V -NoConn ~ 6450 3250 -$Comp -L power:GND #PWR0111 -U 1 1 61C3A75C -P 1850 1300 -F 0 "#PWR0111" H 1850 1050 50 0001 C CNN -F 1 "GND" H 1855 1127 50 0000 C CNN -F 2 "" H 1850 1300 50 0001 C CNN -F 3 "" H 1850 1300 50 0001 C CNN - 1 1850 1300 - 1 0 0 -1 -$EndComp -Wire Wire Line - 1750 1100 1850 1100 -Connection ~ 1850 1100 -Wire Wire Line - 1850 1100 2800 1100 -$Comp -L power:GND #PWR0108 -U 1 1 61C52358 -P 1650 3450 -F 0 "#PWR0108" H 1650 3200 50 0001 C CNN -F 1 "GND" H 1655 3277 50 0000 C CNN -F 2 "" H 1650 3450 50 0001 C CNN -F 3 "" H 1650 3450 50 0001 C CNN - 1 1650 3450 - 1 0 0 -1 -$EndComp -Connection ~ 1650 3250 -$Comp -L power:GND #PWR0109 -U 1 1 61C5A8E3 -P 8950 1350 -F 0 "#PWR0109" H 8950 1100 50 0001 C CNN -F 1 "GND" H 8955 1177 50 0000 C CNN -F 2 "" H 8950 1350 50 0001 C CNN -F 3 "" H 8950 1350 50 0001 C CNN - 1 8950 1350 - -1 0 0 -1 -$EndComp -Wire Wire Line - 9050 1150 8950 1150 -Connection ~ 8950 1150 -$Comp -L power:+3.3V #PWR0110 -U 1 1 61C5A8EC -P 9050 1150 -F 0 "#PWR0110" H 9050 1000 50 0001 C CNN -F 1 "+3.3V" V 9065 1278 50 0000 L CNN -F 2 "" H 9050 1150 50 0001 C CNN -F 3 "" H 9050 1150 50 0001 C CNN - 1 9050 1150 - 0 1 -1 0 -$EndComp -$Comp -L power:GND #PWR0115 -U 1 1 61C5BDC1 -P 8950 3450 -F 0 "#PWR0115" H 8950 3200 50 0001 C CNN -F 1 "GND" H 8955 3277 50 0000 C CNN -F 2 "" H 8950 3450 50 0001 C CNN -F 3 "" H 8950 3450 50 0001 C CNN - 1 8950 3450 - -1 0 0 -1 -$EndComp -Wire Wire Line - 9050 3250 8950 3250 -Connection ~ 8950 3250 -$Comp -L power:+3.3V #PWR0116 -U 1 1 61C5BDCA -P 9050 3250 -F 0 "#PWR0116" H 9050 3100 50 0001 C CNN -F 1 "+3.3V" V 9065 3378 50 0000 L CNN -F 2 "" H 9050 3250 50 0001 C CNN -F 3 "" H 9050 3250 50 0001 C CNN - 1 9050 3250 - 0 1 -1 0 -$EndComp -$Comp -L Device:C_Small C2 -U 1 1 61C36AE0 -P 1850 1200 -F 0 "C2" H 1650 1200 50 0000 L CNN -F 1 "0.1uf" H 1550 1100 50 0000 L CNN -F 2 "Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm" H 1850 1200 50 0001 C CNN -F 3 "~" H 1850 1200 50 0001 C CNN - 1 1850 1200 - 1 0 0 -1 -$EndComp -$Comp -L Device:C_Small C3 -U 1 1 61C52352 -P 1650 3350 -F 0 "C3" H 1450 3350 50 0000 L CNN -F 1 "0.1uf" H 1350 3250 50 0000 L CNN -F 2 "Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm" H 1650 3350 50 0001 C CNN -F 3 "~" H 1650 3350 50 0001 C CNN - 1 1650 3350 - 1 0 0 -1 -$EndComp -$Comp -L Device:C_Small C4 -U 1 1 61C5A8DD -P 8950 1250 -F 0 "C4" H 8850 1250 50 0000 R CNN -F 1 "0.1uf" H 8850 1150 50 0000 R CNN -F 2 "Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm" H 8950 1250 50 0001 C CNN -F 3 "~" H 8950 1250 50 0001 C CNN - 1 8950 1250 - -1 0 0 -1 -$EndComp -Text GLabel 3300 1900 2 50 Input ~ 0 -D3_3V3 -Text GLabel 3300 2100 2 50 Input ~ 0 -D6_3V3 -Text GLabel 3300 1800 2 50 Input ~ 0 -D1_3V3 -Text GLabel 3300 1700 2 50 Input ~ 0 -D2_3V3 -Text GLabel 3300 1600 2 50 Input ~ 0 -D0_3V3 -Text GLabel 3300 1400 2 50 Input ~ 0 -D5_3V3 -Text GLabel 3300 2000 2 50 Input ~ 0 -D7_3V3 -Text GLabel 3300 1500 2 50 Input ~ 0 -D4_3V3 -$Comp -L power:+5V #PWR0114 -U 1 1 61B58CD7 -P 1750 1100 -F 0 "#PWR0114" H 1750 950 50 0001 C CNN -F 1 "+5V" V 1765 1273 50 0000 C CNN -F 2 "" H 1750 1100 50 0001 C CNN -F 3 "" H 1750 1100 50 0001 C CNN - 1 1750 1100 - 0 -1 -1 0 -$EndComp -Text GLabel 8350 3850 2 50 Input ~ 0 -A4_5V -Text GLabel 8350 3750 2 50 Input ~ 0 -A5_5V -Text GLabel 8350 3550 2 50 Input ~ 0 -A3_5V -Text GLabel 8350 3650 2 50 Input ~ 0 -A2_5V -Text GLabel 7350 3650 0 50 Input ~ 0 -A2_3V3 -Text GLabel 7350 3550 0 50 Input ~ 0 -A3_3V3 -Text GLabel 7350 2050 0 50 Input ~ 0 -A6_3V3 -Text GLabel 7350 2150 0 50 Input ~ 0 -A7_3V3 -Text GLabel 7350 3850 0 50 Input ~ 0 -A4_3V3 -Text GLabel 7350 3750 0 50 Input ~ 0 -A5_3V3 -Text GLabel 8350 2050 2 50 Input ~ 0 -A6_5V -Text GLabel 8350 2150 2 50 Input ~ 0 -A7_5V -$Comp -L Device:C_Small C5 -U 1 1 61C5BDBB -P 8950 3350 -F 0 "C5" H 8850 3350 50 0000 R CNN -F 1 "0.1uf" H 8850 3250 50 0000 R CNN -F 2 "Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm" H 8950 3350 50 0001 C CNN -F 3 "~" H 8950 3350 50 0001 C CNN - 1 8950 3350 - -1 0 0 -1 -$EndComp -Wire Wire Line - 1650 3250 1850 3250 -NoConn ~ 2300 4050 -NoConn ~ 2300 3950 -NoConn ~ 2300 4150 -NoConn ~ 2300 4250 -NoConn ~ 3300 4250 -NoConn ~ 3300 4150 -NoConn ~ 3300 4050 -NoConn ~ 3300 3950 -Text GLabel 8350 1850 2 50 Input ~ 0 -A0_5V -Text GLabel 8350 1950 2 50 Input ~ 0 -A1_5V -Text GLabel 2300 3650 0 50 Input ~ 0 -A17_5V -Text GLabel 2300 3550 0 50 Input ~ 0 -A16_5V -Text GLabel 7350 1850 0 50 Input ~ 0 -A0_3V3 -Text GLabel 7350 1950 0 50 Input ~ 0 -A1_3V3 -Text GLabel 3300 3650 2 50 Input ~ 0 -A17_3V3 -Text GLabel 3300 3550 2 50 Input ~ 0 -A16_3V3 -Text GLabel 4250 2750 0 50 Input ~ 0 -A17_3V3 -Text GLabel 8350 3950 2 50 Input ~ 0 -A13_5V -Text GLabel 8350 4050 2 50 Input ~ 0 -A12_5V -NoConn ~ 4250 2150 -NoConn ~ 4250 3450 -NoConn ~ 4250 1850 -$Comp -L Connector_Generic:Conn_02x16_Counter_Clockwise J1 -U 1 1 61A9BE2D -P 5300 4800 -F 0 "J1" H 5400 5650 50 0000 R CNN -F 1 "EPROM Connector" H 5650 5750 50 0000 R CNN -F 2 "Connector_PinHeader_2.54mm:PinHeader_2x16_P2.54mm_Vertical" H 5300 4800 50 0001 C CNN -F 3 "~" H 5300 4800 50 0001 C CNN - 1 5300 4800 - 1 0 0 -1 -$EndComp -Text GLabel 5600 4200 2 50 Input ~ 0 -PGM_5V -Text GLabel 5600 4900 2 50 Input ~ 0 -OE_5V -Text GLabel 5600 5100 2 50 Input ~ 0 -CE_5V -Text GLabel 5600 4300 2 50 Input ~ 0 -A17_5V -Text GLabel 5600 4400 2 50 Input ~ 0 -A14_5V -Text GLabel 5600 4500 2 50 Input ~ 0 -A13_5V -Text GLabel 5600 4600 2 50 Input ~ 0 -A8_5V -Text GLabel 5600 4700 2 50 Input ~ 0 -A9_5V -Text GLabel 5600 4800 2 50 Input ~ 0 -A11_5V -Text GLabel 5600 5000 2 50 Input ~ 0 -A10_5V -Text GLabel 5600 5200 2 50 Input ~ 0 -D7_5V -Text GLabel 5600 5300 2 50 Input ~ 0 -D6_5V -Text GLabel 5600 5400 2 50 Input ~ 0 -D5_5V -Text GLabel 5600 5500 2 50 Input ~ 0 -D4_5V -Text GLabel 5600 5600 2 50 Input ~ 0 -D3_5V -Text GLabel 5100 5500 0 50 Input ~ 0 -D2_5V -Text GLabel 5100 5400 0 50 Input ~ 0 -D1_5V -Text GLabel 5100 5300 0 50 Input ~ 0 -D0_5V -Text GLabel 5100 5200 0 50 Input ~ 0 -A0_5V -Text GLabel 5100 5100 0 50 Input ~ 0 -A1_5V -Text GLabel 5100 5000 0 50 Input ~ 0 -A2_5V -Text GLabel 5100 4900 0 50 Input ~ 0 -A3_5V -Text GLabel 5100 4800 0 50 Input ~ 0 -A4_5V -Text GLabel 5100 4700 0 50 Input ~ 0 -A5_5V -Text GLabel 5100 4600 0 50 Input ~ 0 -A6_5V -Text GLabel 5100 4500 0 50 Input ~ 0 -A7_5V -Text GLabel 5100 4400 0 50 Input ~ 0 -A12_5V -Text GLabel 5100 4300 0 50 Input ~ 0 -A15_5V -Text GLabel 5100 4200 0 50 Input ~ 0 -A16_5V -Wire Wire Line - 4950 5600 4950 5650 -Wire Wire Line - 5100 5600 4950 5600 -$Comp -L power:GND #PWR0107 -U 1 1 61B51E9B -P 4950 5650 -F 0 "#PWR0107" H 4950 5400 50 0001 C CNN -F 1 "GND" H 4955 5477 50 0000 C CNN -F 2 "" H 4950 5650 50 0001 C CNN -F 3 "" H 4950 5650 50 0001 C CNN - 1 4950 5650 - -1 0 0 -1 -$EndComp -$Comp -L power:PWR_FLAG #FLG0103 -U 1 1 61B79017 -P 5800 4000 -F 0 "#FLG0103" H 5800 4075 50 0001 C CNN -F 1 "PWR_FLAG" H 5800 4128 50 0000 R CNN -F 2 "" H 5800 4000 50 0001 C CNN -F 3 "~" H 5800 4000 50 0001 C CNN - 1 5800 4000 - -1 0 0 -1 -$EndComp -Wire Wire Line - 5800 4000 5900 4000 -Connection ~ 5800 4000 -Wire Wire Line - 5100 4000 5800 4000 -Wire Wire Line - 5100 4100 5100 4000 -$Comp -L power:+5V #PWR0112 -U 1 1 61B52D90 -P 5900 4000 -F 0 "#PWR0112" H 5900 3850 50 0001 C CNN -F 1 "+5V" V 5900 4200 50 0000 C CNN -F 2 "" H 5900 4000 50 0001 C CNN -F 3 "" H 5900 4000 50 0001 C CNN - 1 5900 4000 - 0 1 -1 0 -$EndComp -Connection ~ 5900 4000 -Wire Wire Line - 5900 4100 5900 4000 -Wire Wire Line - 5600 4100 5900 4100 -Wire Wire Line - 2300 4450 1850 4450 -Wire Wire Line - 1850 4450 1850 3250 -Connection ~ 1850 3250 -Wire Wire Line - 1850 3250 2800 3250 -Wire Wire Line - 1450 3250 1650 3250 -$Comp -L power:+3.3V #PWR0113 -U 1 1 61C536FC -P 1450 3250 -F 0 "#PWR0113" H 1450 3100 50 0001 C CNN -F 1 "+3.3V" V 1465 3378 50 0000 L CNN -F 2 "" H 1450 3250 50 0001 C CNN -F 3 "" H 1450 3250 50 0001 C CNN - 1 1450 3250 - 0 -1 -1 0 -$EndComp -Wire Wire Line - 7850 1150 8950 1150 -Wire Wire Line - 7350 2350 7350 2450 -Connection ~ 7350 2450 -Wire Wire Line - 7850 3250 8950 3250 -Wire Wire Line - 7350 4450 7350 4550 -Connection ~ 7350 4550 -$EndSCHEMATC From 843a85d5777e7ca23f2444ebad4a8aca235c2179 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Wed, 21 Dec 2022 20:42:05 -0700 Subject: [PATCH 8/9] add skip option --- src/SendEPROM/Program.cs | 14 ++++++++------ src/SendEPROM/SendEPROM.csproj | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/SendEPROM/Program.cs b/src/SendEPROM/Program.cs index a805233..7ffea4c 100644 --- a/src/SendEPROM/Program.cs +++ b/src/SendEPROM/Program.cs @@ -13,6 +13,7 @@ namespace SendEPROM var portOption = new Option(new string[] {"--port", "-p" }, description: "COM port on which to send the file", getDefaultValue: () => "COM3"); var baudOption = new Option (new string[] {"--baud", "-b" }, description: "Baud rate at which to send", getDefaultValue: () => 115200); var modeOption = new Option (new string[] {"--mode", "-m" }, description: "EPROM mode (1 = 27C256, 2 = 27C020)", getDefaultValue: () => 2); + var skipOption = new Option (new string[] {"--skip", "-s" }, description: "Skip N bytes at start of file", getDefaultValue: () => 0); var fileArgument = new Argument("file", description: "File to send"); @@ -21,20 +22,21 @@ namespace SendEPROM portOption, baudOption, modeOption, + skipOption, fileArgument }; rootCmd.SetHandler( - (port, baud, mode, file) => + (port, baud, mode, skip, file) => { - SendData(port, baud, mode, file); + SendData(port, baud, mode, skip, file); }, - portOption, baudOption, modeOption, fileArgument); + portOption, baudOption, modeOption, skipOption, fileArgument); return await rootCmd.InvokeAsync(args); } - static void SendData(string port, int baud, byte mode, FileInfo file) + static void SendData(string port, int baud, byte mode, int skip, FileInfo file) { Console.WriteLine($"Reading {file.FullName}"); @@ -54,8 +56,8 @@ namespace SendEPROM sp.Write(modeBuff, 0, 1); } - Console.WriteLine($"Sending {buff.Length} bytes"); - sp.Write(buff, 0, buff.Length); + Console.WriteLine($"Sending {buff.Length} bytes, skipping {skip} bytes"); + sp.Write(buff, skip, buff.Length - skip); sp.Close(); Console.WriteLine("Done!"); } diff --git a/src/SendEPROM/SendEPROM.csproj b/src/SendEPROM/SendEPROM.csproj index 08ef6d4..63c3675 100644 --- a/src/SendEPROM/SendEPROM.csproj +++ b/src/SendEPROM/SendEPROM.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net7.0 disable From 828e3ccb2a3f3fc916609ff8fbbca6faaffc9365 Mon Sep 17 00:00:00 2001 From: Brian Peek <2321675+BrianPeek@users.noreply.github.com> Date: Sat, 24 Dec 2022 16:30:28 -0700 Subject: [PATCH 9/9] remove mirror copy --- src/teensy/main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/teensy/main.cpp b/src/teensy/main.cpp index dbe9503..fb8087d 100644 --- a/src/teensy/main.cpp +++ b/src/teensy/main.cpp @@ -49,10 +49,6 @@ void readData(Stream* s) } while(read != 0); - // on GG (and lynx?) top address bit gets stuck high (?) so mirror to upper region too? - if(total == 131072) - memcpy(p, buffer, 131072); - SD.remove(filename); File f = SD.open(filename, O_WRITE);