AppleIISd/README.md

68 lines
2.9 KiB
Markdown
Raw Normal View History

2017-08-26 10:50:55 +00:00
# Apple][Sd
2017-08-22 17:35:53 +00:00
SD card based ProFile replacement for enhanced Apple IIe computers
2017-08-26 10:50:55 +00:00
The **Apple][Sd** is a SD card based replaced for the ProFile harddrive. In contrast to other SD card based devices, this card does not replace a Disk II drive. Data is saved directly onto the SD card, not via images on a FAT system, like on other cards. The SD card is accessable with [CiderPress](http://a2ciderpress.com/).
2017-08-22 17:35:53 +00:00
2017-08-23 17:37:40 +00:00
A Xilinx CPLD is used as a SPI controller and translates, together with the ROM driver, SD card data to/from the Apple IIe. The VHDL source is based on [SPI65/B](http://www.6502.org/users/andre/spi65b) by André Fachat.
2017-08-22 17:35:53 +00:00
The assembler sources were written in Merlin-8. The [schematics](AppleIISd.pdf) are available as PDF.
2017-08-22 17:35:53 +00:00
## Features
* up to 64MB storage space (2x 65535 blocks)
2017-08-22 17:35:53 +00:00
* ProDOS driver in ROM
* Auto boot
* Access LED
* Card detect and write protect sensing
2017-08-22 17:35:53 +00:00
## Requirements
2017-08-26 10:50:55 +00:00
The Apple][Sd requires and has been tested on an enhanced IIe computer. The ROM code uses some 65c02 opcodes and will therefore not work on a II, II+ or unenhanced IIe. ProDOS versions 1.1 to 2.4.1 seem to work.
When a 2732 type ROM is used, the binary image has to be programmed at offset 0x800, because A11 is always high for compatibility with 2716 type ROMs.
2017-08-26 10:50:55 +00:00
## Timing
The clock of the SPI bus *SCK* may be derived from either *Phi0* or the *7M* clock. Additionally, the divisor may be 2 to 8.
The following measurements were taken with the divisor set to 2, resulting in *fSCK* of 500kHz and 3.5MHz. Reading of a byte requires that a dummy byte is sent on the bus, before the answer can be read. Therefore the measurement is the time between sending the byte and receiving the answer. The measurement for reading of a whole 512 byte block includes the SD card commands to do so.
| Clock | Byte | Block | Image |
| -----: | -----: | -----: | ------------------------------------------------: |
| *Phi0* | 17.7µs | 28.8ms | [Byte](Images/Bus1.gif), [Block](Images/Spi1.png) |
| *7M* | 3.9µs | 15ms | [Byte](Images/Bus2.gif), [Block](Images/Spi2.png) |
This shows that the required to read a single byte can be reduced significantly by increasing *fSCK* (as one might have guessed). Reading at 500kHz actualy requires NOPs to be inserted (or checking the TC bit in the STATUS register), while reading at 3.5MHz can be done immediately.
The time for reading a 512 byte block could *only* be halved, but there are for sure opportunities for optimization in the code surrounding the reading.
```
* single byte @ 500kHz
LDA #$FF
STA $C0C0
NOP
NOP
NOP
NOP
NOP
NOP
NOP
LDA $C0C0
* single byte @ 3.5MHz
LDA #$FF
STA $C0C0
LDA $C0C0
```
2017-08-22 17:35:53 +00:00
## TODOs
2017-08-23 17:37:40 +00:00
* Much more testing
* SRAM option (may never work, though)
* Find a use for the IRQ pin
2017-08-26 10:50:55 +00:00
* Use 28 pin socket to support other EPROMS than 2716 and 2732
2017-08-22 17:35:53 +00:00
2017-08-26 10:50:55 +00:00
## Known Bugs
* Does not always boot in slot 7 (may be a faulty connector, though)
* Does not work, when a Z80 card is present
2017-08-22 17:35:53 +00:00
2017-08-26 10:50:55 +00:00
![Front_Img](Images/Card%20Front.jpg)