diff --git a/README.md b/README.md index 95d2850..b2d6327 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The project is heavily inspired by the [*Briel Computers Apple 1 Replica*](http: - Design a modular casing with laser cut parts. The casing will house the main board, but additional layers can be put on top of it to increase its size and allow for expansion boards to be added later on. - Release several varations of a DIY kit for this project (PCB only, PCB + passives, PCB + passives + casing, complete kit, etc.) so others can easily build the computer at home. -**Pictures of revision 0 (very first PCB based on the schematic to verify that it functions properly):** +**Pictures of revision 0 (very first PCB based on the schematic to verify that it functions properly):** *(Revision 1, which is designated to be the first production revision, is currently being tested)* diff --git a/code/AVR/SerialIO/SerialIO.ino b/code/firmware/SerialIO/SerialIO.ino similarity index 97% rename from code/AVR/SerialIO/SerialIO.ino rename to code/firmware/SerialIO/SerialIO.ino index ed22a88..e153ed2 100644 --- a/code/AVR/SerialIO/SerialIO.ino +++ b/code/firmware/SerialIO/SerialIO.ino @@ -1,5 +1,5 @@ // ---------------------------------------------------------------------------------- // -// Apple 1 Replica firmware for Arduino // +// Apple 1 Mini firmware for Arduino // // // // Version 1.0 // // By Ruud van Falier // @@ -103,13 +103,13 @@ void display_boot_message() Serial.print(VT100_OFF); Serial.print(VT100_DEFAULT); Serial.println("+-----------------------+"); - Serial.print("| "); + Serial.print("| "); Serial.print(VT100_OFF); Serial.print(VT100_BOLD); - Serial.print("APPLE 1 REPLICA"); + Serial.print("APPLE 1 MINI"); Serial.print(VT100_OFF); Serial.print(VT100_DEFAULT); - Serial.println(" |"); + Serial.println(" |"); Serial.print(VT100_OFF); Serial.print(VT100_DEFAULT); Serial.println("|-----------------------|"); diff --git a/code/programs/BLACKJACK.TXT b/code/programs/tested/blackjack.txt similarity index 99% rename from code/programs/BLACKJACK.TXT rename to code/programs/tested/blackjack.txt index bf4d2b8..53bebd1 100644 --- a/code/programs/BLACKJACK.TXT +++ b/code/programs/tested/blackjack.txt @@ -1,4 +1,3 @@ - 004A: 00 08 00 10 00 1B 0050: FF FF FF FF FF FF FF FF 0058: FF FF FF FF FF FF FF FF @@ -278,6 +277,3 @@ 0FE8: CC C9 CD C9 D4 A0 C9 D3 0FF0: A0 A4 B3 B0 B0 B0 AE A0 0FF8: 29 47 03 5F B3 B8 0B 01 -E2B3R - -RUN diff --git a/code/programs/tested/blackjack_run.txt b/code/programs/tested/blackjack_run.txt new file mode 100644 index 0000000..30a2907 --- /dev/null +++ b/code/programs/tested/blackjack_run.txt @@ -0,0 +1,3 @@ +E2B3R + +RUN \ No newline at end of file diff --git a/code/programs/tested/hello-world.txt b/code/programs/tested/hello-world.txt new file mode 100644 index 0000000..ec64d26 --- /dev/null +++ b/code/programs/tested/hello-world.txt @@ -0,0 +1,2 @@ +280: A2 C BD 8B 2 20 EF FF CA D0 F7 60 8D C4 CC D2 CF D7 A0 CF CC CC C5 C8 + diff --git a/code/programs/tested/memory-test.txt b/code/programs/tested/memory-test.txt new file mode 100644 index 0000000..0e9146c --- /dev/null +++ b/code/programs/tested/memory-test.txt @@ -0,0 +1,39 @@ +0: 00 05 00 10 00 00 00 00 +8: 00 00 00 00 00 00 00 00 +280: A9 00 85 07 A9 00 A8 AA +288: 85 06 A5 00 85 04 A5 01 +290: 85 05 C0 04 D0 04 A5 04 +298: 85 06 C0 05 D0 04 A5 05 +2A0: 85 06 A5 06 81 04 A1 04 +2A8: C5 06 D0 2E E6 04 D0 02 +2B0: E6 05 A5 02 C5 04 D0 04 +2B8: A5 03 C5 05 D0 D4 A5 00 +2C0: 85 04 A5 01 85 05 C0 04 +2C8: D0 04 A5 04 85 06 C0 05 +2D0: D0 04 A5 05 85 06 A1 04 +2D8: C5 06 D0 69 E6 04 D0 02 +2E0: E6 05 A5 02 C5 04 D0 04 +2E8: A5 03 C5 05 D0 D8 C0 00 +2F0: D0 08 A9 FF 85 06 C8 4C +2F8: 8A 02 C0 01 D0 04 A9 01 +300: D0 F2 C0 02 D0 08 06 06 +308: 90 ED A9 7F D0 E6 C0 03 +310: D0 08 38 66 06 B0 E0 C8 +318: D0 DD C0 04 F0 F9 A9 50 +320: 20 6C 03 A9 41 20 6C 03 +328: A9 53 20 6C 03 A9 53 20 +330: 6C 03 20 9C 03 E6 07 A5 +338: 07 20 70 03 20 91 03 EA +340: EA EA 4C 84 02 48 98 20 +348: 70 03 20 9C 03 A5 05 20 +350: 70 03 A5 04 20 70 03 20 +358: 9C 03 A5 06 20 70 03 20 +360: 9C 03 68 20 70 03 20 91 +368: 03 4C 00 FF 20 EF FF 60 +370: 48 4A 4A 4A 4A 29 0F 09 +378: 30 C9 3A 90 02 69 06 20 +380: 6C 03 68 29 0F 09 30 C9 +388: 3A 90 02 69 06 20 6C 03 +390: 60 A9 0D 20 6C 03 A9 0A +398: 20 6C 03 60 A9 20 20 6C +3A0: 03 60 diff --git a/code/Uploader/Uploader.sln b/code/utilities/DataUploader/DataUploader.sln similarity index 85% rename from code/Uploader/Uploader.sln rename to code/utilities/DataUploader/DataUploader.sln index 144032b..9cf5aa2 100644 --- a/code/Uploader/Uploader.sln +++ b/code/utilities/DataUploader/DataUploader.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Uploader", "Uploader\Uploader.csproj", "{A6D02388-9408-492F-A165-B6D4EA110558}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataUploader", "DataUploader\DataUploader.csproj", "{A6D02388-9408-492F-A165-B6D4EA110558}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/code/Uploader/Uploader/App.config b/code/utilities/DataUploader/DataUploader/App.config similarity index 100% rename from code/Uploader/Uploader/App.config rename to code/utilities/DataUploader/DataUploader/App.config diff --git a/code/Uploader/Uploader/Uploader.csproj b/code/utilities/DataUploader/DataUploader/DataUploader.csproj similarity index 95% rename from code/Uploader/Uploader/Uploader.csproj rename to code/utilities/DataUploader/DataUploader/DataUploader.csproj index 92a5add..f62f62c 100644 --- a/code/Uploader/Uploader/Uploader.csproj +++ b/code/utilities/DataUploader/DataUploader/DataUploader.csproj @@ -6,8 +6,8 @@ AnyCPU {A6D02388-9408-492F-A165-B6D4EA110558} Exe - Uploader - Uploader + DataUploader + DataUploader v4.5.2 512 true diff --git a/code/Uploader/Uploader/Program.cs b/code/utilities/DataUploader/DataUploader/Program.cs similarity index 51% rename from code/Uploader/Uploader/Program.cs rename to code/utilities/DataUploader/DataUploader/Program.cs index b385f4e..7a65d07 100644 --- a/code/Uploader/Uploader/Program.cs +++ b/code/utilities/DataUploader/DataUploader/Program.cs @@ -1,16 +1,22 @@ using System; +using System.Diagnostics; using System.IO; using System.IO.Ports; using System.Text; using System.Threading; using System.Windows.Forms; -namespace Uploader +namespace DataUploader { class Program { - private const string PORT = "COM7"; + private const string PORT = "COM5"; + private const int DELAY_CHAR = 30; + private const int DELAY_LINE = 100; + private static SerialPort serial = new SerialPort(PORT, 9600, Parity.None, 8, StopBits.One); + private static bool receiving; + private static Stopwatch duration; [STAThread] static void Main(string[] args) @@ -26,7 +32,15 @@ namespace Uploader Console.WriteLine("Connected..."); Console.WriteLine($"Uploading {dialog.FileName}"); - + + // Wait for firmware to load (Arduino may reset on connect). + Thread.Sleep(2000); + + // Clear the buffer + SendNewLine(); + + duration = Stopwatch.StartNew(); + using (var reader = new StreamReader(dialog.FileName, Encoding.ASCII)) { int progress = 0; @@ -35,26 +49,41 @@ namespace Uploader while (reader.Peek() >= 0) { int data = reader.Read(); - + + // Don't send any data if we are busy receiving + while (receiving) + { + Thread.Sleep(10); + } + if (data < 96) { - serial.Write(new byte[] { (byte)data }, 0, 1); - - Thread.Sleep(50); - - if (data == 13) + if (data != 10 && data != 13) { - Thread.Sleep(150); + serial.Write(((char) data).ToString()); + Thread.Sleep(DELAY_CHAR); + } + else if (data == 13) + { + SendNewLine(); } - Console.Write((char)data); + Console.Write((char) data); + } + else + { + Debug.Write(string.Format("[{0}]", data)); } Progress(++progress, total); } } + + Console.WriteLine(""); + Console.WriteLine("Finishing..."); + + SendNewLine(); - serial.WriteLine(""); serial.Close(); Console.Title = "Upload succeeded!"; @@ -64,16 +93,27 @@ namespace Uploader Console.ReadKey(); } + private static void SendNewLine() + { + serial.Write("\r"); + Thread.Sleep(DELAY_CHAR); + serial.Write("\n"); + Thread.Sleep(DELAY_LINE); + } + private static void Serial_DataReceived(object sender, SerialDataReceivedEventArgs e) { + receiving = true; serial.ReadExisting(); + receiving = false; } private static void Progress(int progress, long total) { decimal percentage = progress / ((decimal)total / 100); + int bytesPerSec = (int)(progress / duration.Elapsed.TotalSeconds); - Console.Title = $"Uploading... ({progress:N0} of {total:N0} bytes - {percentage:N2}%)"; + Console.Title = $"Uploading... ({progress:N0} of {total:N0} bytes - {bytesPerSec} bytes/sec - {percentage:N2}%)"; } } } diff --git a/code/Uploader/Uploader/Properties/AssemblyInfo.cs b/code/utilities/DataUploader/DataUploader/Properties/AssemblyInfo.cs similarity index 93% rename from code/Uploader/Uploader/Properties/AssemblyInfo.cs rename to code/utilities/DataUploader/DataUploader/Properties/AssemblyInfo.cs index 5f5609a..afda18f 100644 --- a/code/Uploader/Uploader/Properties/AssemblyInfo.cs +++ b/code/utilities/DataUploader/DataUploader/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Uploader")] +[assembly: AssemblyTitle("DataUploader")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Uploader")] +[assembly: AssemblyProduct("DataUploader")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/code/Uploader/README.md b/code/utilities/DataUploader/README.md similarity index 77% rename from code/Uploader/README.md rename to code/utilities/DataUploader/README.md index 3637d5e..3825ff7 100644 --- a/code/Uploader/README.md +++ b/code/utilities/DataUploader/README.md @@ -1,8 +1,10 @@ -# Data uploader utility +# Data Uploader utility + +## Upload memory data to the Apple 1 Mini It's difficult to upload data to the Apple 1 Mini using most standard terminal clients because there need to be specific delays in between data being sent. This utility simplifies that process by letting select a file and handling the upload for you. **Utility is still under development and not very user friendly at the moment!** -Requires Visual Studio to build \ No newline at end of file +*Requires Visual Studio to build* \ No newline at end of file diff --git a/docs/PuTTY-setup/PuTTY settings colours cursor.png b/docs/PuTTY-setup/PuTTY settings colours cursor.png new file mode 100644 index 0000000..96303ce Binary files /dev/null and b/docs/PuTTY-setup/PuTTY settings colours cursor.png differ diff --git a/docs/PuTTY-setup/PuTTY settings colours.png b/docs/PuTTY-setup/PuTTY settings colours.png new file mode 100644 index 0000000..64efcdd Binary files /dev/null and b/docs/PuTTY-setup/PuTTY settings colours.png differ diff --git a/docs/PuTTY-setup/PuTTY settings font.png b/docs/PuTTY-setup/PuTTY settings font.png new file mode 100644 index 0000000..5804f5e Binary files /dev/null and b/docs/PuTTY-setup/PuTTY settings font.png differ diff --git a/docs/PuTTY-setup/PuTTY settings.png b/docs/PuTTY-setup/PuTTY settings.png new file mode 100644 index 0000000..983b6ee Binary files /dev/null and b/docs/PuTTY-setup/PuTTY settings.png differ