The 6846 is the main PIA chip in all machines for the TO range. It handles the tape drive, memory banks commutations, 50Hz interrupt (actually programmable, it's generated using the timer), and a few extra things.
Address | Name | Comments |
---|---|---|
E7C0 | CSR | composite status register |
E7C1 | CRC | Port C control |
E7C2 | DDRC | Port C direction |
E7C3 | PRC | Port C data |
E7C4 | composite status register | |
E7C5 | TCR | timer control |
E7C6 | TMSB | timer most significant byte |
E7C7 | TLSB | timer least significant byte |
This bit allows switching the video RAM page for the CPU. when set to 0, the “color” (attributes) page is mapped. When set to 1, the “shape” (pixels) page is mapped.
(on TO8/9+/8D, this is not actually wired, but the Gate Array emulates it).
This bit is an input. It allows you to read the state of the light pen “click” button.
The data from the tape drive can be read here. The tape drive use hardware demodulation, so what you read here is to be stored directly to memory. There is no need for software decoding. This bit can also be used to detect the tape drive, it is at fixed 1 when the tape drive is plugged and no data is found, but 0 when the tape drive is not connected.
This is the 1-bit sound output. Setting it to 0 and 1 alternatively, at the right speed, may generate squarewaves.
The timer is used as a waveform generator, and the output is sent to the tape drive to save data to tape. As the tape port also has an audio input pin, connecting the two would allow to use the waveform generator for low-CPU sound and music. This has not been done, yet.
The tape format for TO machines is:
The decoding is done using analogue filters set on these frequencies. A comparator between the filters output decides if the bit is a 0 or a 1.
Note this is the same timer that generates the cursor blink interrupt (at a 10Hz frequency).
These two bits allows mapping of the “RAM Disk” memory (external expansion on the TO9). When no internal RAM is selected (bits PB3-PB7 from System 6821 PIA are all 1), the value of these two bits define the mapped RAM disk page.
P6 | P2 | PB7 | PB6 | PB5 | PB4 | PB3 | Mapped memory at A000-DFFF |
---|---|---|---|---|---|---|---|
X | X | 1 | 1 | 1 | X | X | TO7 32K expansion mappings |
X | X | 1 | 1 | 1 | 1 | 0 | Internal bank 0 |
X | X | 1 | 1 | 1 | 0 | 1 | Internal bank 1 |
X | X | X | X | 0 | 1 | 1 | TO9 extra internal RAM mappings |
X | X | 0 | 0 | 0 | 1 | 1 | Internal bank 2 |
X | X | 1 | 0 | 0 | 1 | 1 | Internal bank 3 |
X | X | 0 | 1 | 0 | 1 | 1 | Internal bank 4 |
X | X | 1 | 1 | 0 | 1 | 1 | Internal bank 5 |
X | X | 1 | 1 | 1 | 1 | 1 | TO9 external RAM mappings |
0 | 0 | 1 | 1 | 1 | 1 | 1 | RAMdisk 1 |
1 | 0 | 1 | 1 | 1 | 1 | 1 | RAMdisk 2 |
0 | 1 | 1 | 1 | 1 | 1 | 1 | RAMdisk 3 |
1 | 1 | 1 | 1 | 1 | 1 | 1 | RAMdisk 4 |
On TO9 and later, these two bits are used to switch between different mappings for the cartridge area (0000-3FFF). It allows software (un)mapping of cartridges.
P4 | P5 | Bank 0 | Bank 1 | Bank 2 | Bank 3 |
---|---|---|---|---|---|
0 | 0 | BASIC 128 | Extramon | BASIC 1.0 | Icon DOS |
0 | 1 | Paragraphe | |||
1 | 0 | Fiches et Dossiers | |||
1 | 1 | External cartridge |
Each slot may have up to 4 banks, switching by the banks is done by writing anywhere between 0000 and 1FFF. The two low-order address bits define the bank number.
Monitor entry EC03 (COMSLOT) allows calling code from one ROM bank to another.
Only 2 banks are available.
also switches the floppy ROM banks.
The keyboard link was implemented on the TO9 using a 6850 ACIA. To save costs, it is now implemented using a bit-bang serial link driven by the PIA.
When the keyboard controller want to send a byte, it raises CP1 high. The computer acknowledges by setting PB5 low.
The serial frame is made of:
The signalling is:
The computer can send commands by pulling PB5 low, waiting for CP1 to become low (acknowledge), then leave PB5 low for the right amount of time.