====== Making your own Applesauce Software ====== Created by John K. Morris\\ jmorris@evolutioninteractive.com Version 0.1 – July 23, 2021 – EXTREMELY ROUGH DRAFT This document is for people who wish to be able to connect directly up to the Applesauce hardware with their own client software. It describes the communication protocol to perform all floppy drive functionality. ----- ==== How do I connect to the Applesauce hardware? ==== The Applesauce shows up as a USB serial device with the name “Applesauce” (Product ID: 0x0483 / Vendor ID: 0x16c0 / Manufacturer: Evolution Interactive). The connection speed is 12Mb/s. It is possible that you may need a serial driver for Windows devices. ----- ==== Hardware Architecture ==== The architecture of the hardware is very straightforward. The Applesauce contains a 160K internal buffer that it uses for all binary data. ----- ==== Communication ==== All commands to Applesauce as well as responses are human readable strings, end with a ‘\n’ character, and are case insensitive. There is a common set of basic responses from the hardware. “.” means ok/acknowleded “!” mean bad “?” command is not recognized “+” on – sent in response to queries “-” off – sent in response to queries “v” no power – a command was attempted that requires the device to be powered up, but there is no power ----- ==== Fundamental Commands ==== **?** – always returns the string “Applesauce”. Easy way to determine if the communication channel is working. **connect** – requests that the Applesauce connect to the floppy drive. This will initiate the process where Applesauce will probe all of the drive connectors to determine where and what is connected. This process will also power up the drive. Returns “.” if a drive was found and identified. “!” when it could not detect a connected drive. **disconnect** – logically disconnect the Applesauce from the drive this will also power down the drive. This will always return “.”. **?vers** – returns the firmware version **?pcb** – returns the PCB revision number **?kind** – returns a string describing the type of drive that is connected. “5.25” is a Disk II-compatible drive on the 20-pin or DB-19 port, “3.5” is an Apple 3.5 drive that uses the Sony protocol, “PC” is for a PC-compatible drive on the 34-pin port. If no drive was detected, then “NONE” is returned. **?idlog** – returns a text string that describes the process used to determine the type of drive that is connected. Used to debug when drives aren’t recognized properly. **force:5.25**, **force:3.5**, **force:pc** – forces Disk II 5.25", Apple 3.5", or PC drive mode, respectively. Should not be necessary outside of testing and debugging as autodetection will normally detect the drive – see the documentation for **connect** and **?kind**. **?safe** – returns “+” or “-” depending on the position of the Safe switch on the front of the Applesauce ----- ==== Power Supply ==== The drive power is typically handled automatically by the “connect” and “disconnect” commands. But if you need to do anything special, then this is how you can manage and query the power supply. **psu:?** – returns “+” or “-” indicating whether the power supply is currently turned on **psu:on** – turns on the power supply. If the power is successfully turned on, then “+” is returned. If there was an electrical problem, “-” is returned. **psu:off** – turns off the power supply **psu:?5v** – current voltage on the +5V rail (eg: 5.02) **psu:?12v** – current voltage on the +12V rail **psu:?5a** – milliamp load on the +5V rail **psu:?12a** – milliamp load on the +12V rail ----- ==== Data Buffer ==== All binary data between the Applesauce and your client happen using a 160K buffer that exists in the hardware. This interface allows you to upload and download the data. **data:**>//xxx// – upload data to the Applesauce. “xxx” is the number of bytes that you are sending. It will respond with “.” to indicate that it is ready to receive the binary bytes or “!” if the amount of data you are sending will overflow the buffer. After uploading the bytes, Applesauce will again respond with a “.” if the transfer succeeds or “!” if it fails or times out. This will overwrite all data in the buffer. **data:**