Dual PIA Modification for the Atari 800
- Year
- 1995
- Type
- DIY project
- Category
- Motherboard modification
- Manufacturer
- Homebrew design by Peter Bell (public domain)
Overview
Atari 800 owners who added both an XL/XE-compatible memory expansion and a switchable XL OS hit an awkward conflict. On the 800, the PIA's port B at $D301 drives joystick ports 3 and 4. On the XL and XE, the same register is PORTB, the memory-control port that maps BASIC, the OS ROM, self-test and the 130XE-style RAM banks. An 800 wired for XL banking therefore either loses joysticks 3 and 4, or has its banking register in the wrong place for XL software.
Peter Bell's Dual PIA modification, released into the public domain on 4 February 1995, solves this by fitting a second PIA and swapping the two port-B halves whenever the XL OS is selected. His document covers only the address decoding. What you do with the extra port is up to you. He notes it is only of interest if your 800 already has both a memory expansion and switchable OSes.
How it works
The 6520 PIA occupies just four addresses, mirrored right through the page $D300–$D3FF. Bell's PAL splits that page between two chips using address lines A2 and A0, taken from the POKEY pins where they are convenient:
| Mode | PIA 1 (in socket) selected when… | PIA 2 (piggy-backed) selected when… |
|---|---|---|
| 800 OS | page $D3xx and A2 = 0 |
page $D3xx and A2 = 1 |
| XL/XE OS | $D3xx and (A2 XOR A0) = 0 |
$D3xx and (A2 XOR A0) = 1 |
In 800 mode, $D300–$D303 is the original PIA, so $D301 is joystick ports 3 and 4 as Atari intended, and the new PIA sits at $D304–$D307. In XL/XE mode the XOR term leaves port A and its control register where they belong ($D300, $D302), but swaps port B and its control register ($D301, $D303) with the other chip. Software therefore finds the memory-control PIA at the XL address. Because the B port moves, the PAL also routes the correct PIA's CB2 line to the SIO /COMMAND signal, so disk I/O keeps working in both modes.
Parts
- A second 6520/6820-type PIA.
- A PAL16L8 programmed with Bell's equations (supplied as files with the original document).
- Fine wire and a low-profile socket if the RF shield fouls the stacked chips.
Installation outline
- Inspect how your memory upgrade connects to the existing PIA. If it uses wires soldered to bent-out pins, you can proceed. If it uses a ribbon header plugged into the PIA socket, you'll have to rework that first.
- The original PIA becomes PIA 2. Bend out pins 2–7 and 10–17 (port A and port B; B is probably already out), 23 (CS2), 39 and 40 (CA2, CA1) and 19 (CB2).
- Bend out pin 23 on the new PIA, solder the old PIA on top of it so that no bent pins touch, and plug the stack into the socket.
- Fix the PAL nearby with double-sided tape or glue. There are no 20-pin chips on the 800 board to piggy-back for power. Then wire it:
| PAL pin | Connects to |
|---|---|
| 1 | PIA socket pin 23 (original chip select) |
| 2, 3 | POKEY pin 34 (A2), pin 36 (A0) |
| 4, 5 | CB2 from PIA 1 (socket pin 39) and PIA 2 |
| 6 | ROM-select line: low when the original 800 ROMs are selected |
| 10, 20 | GND (socket pin 1), +5 V (socket pin 20) |
| 13, 14 | CS2 of PIA 1 and PIA 2 |
| 15 | PIA socket pin 39 (SIO /COMMAND) |
Testing
- Power up in 800 mode. Check all four joystick ports and SIO operation.
- Flip the ROM switch to XL/XE mode. Check that the extended RAM banks work and that SIO still works.
Bonus port
The mod leaves a free 8-bit port: port A of the second PIA at $D304 (data/DDR) and $D306 (control), which stays put in both modes. Bell used his as a parallel printer (P:) port. The other spare port B at $D305/$D307 is best ignored, because software would need patching to use it.
Skill level
Advanced. You need to program a PAL, stack DIP chips, work on an 800 motherboard under its RF shielding, and you should already have a working dual-OS and memory upgrade to build on.
Credits
- Picture: Atari's 6520 PIA (C014795): the mod stacks a second one on top of the original. — Multicherry, Wikimedia Commons (CC BY-SA 4.0)
- Peter Bell — Dual PIA modification for Atari 800 (PIAMOD, 4 Feb 1995), Nir Dary collection — Peter Bell, 1995
- comp.sys.atari.8bit FAQ, section 6.12 (PORTB usage on XL/XE) (Michael Current, Feb 2026) — Michael Current (comp.sys.atari.8bit FAQ), 2026
