POKEY
POKEY is a digital I/O chip designed by Doug Neubauer at Atari, Inc. for the Atari 8-bit computers. It was first released with the Atari 400 and Atari 800 in 1979 and is included in all later models and the Atari 5200 console.
POKEY combines functions for reading paddle controllers and computer keyboards as well as sound generation and a source for pseudorandom numbers. It produces four voices of distinctive square wave audio, either as clear tones or modified with distortion settings. Neubauer also developed the Atari 8-bit killer application Star Raiders which makes use of POKEY features.
POKEY chips are used for audio in many arcade video games of the 1980s including Centipede, Missile Command, Asteroids Deluxe, and Gauntlet. Some of Atari's arcade systems use multi-core versions with 2 or 4 POKEYs in a single package for more audio channels. The Atari 7800 console allows a game cartridge to contain a POKEY, providing better sound than the system's audio chip. Three licensed games make use of this: the ports of Ballblazer, Commando, and Tiger-Heli.
The LSI chip has 40 pins and is identified as C012294. The USPTO granted U.S. Patent 4,314,236 to Atari on February 2, 1982 for an "Apparatus for producing a plurality of audio sound effects". The inventors listed are Steven T. Mayer and Ronald E. Milner.
Features
- Audio
- * 4 semi-independent audio channels
- * Channels may be configured as one of:
- ** Four 8-bit channels
- ** Two 16-bit channels
- ** One 16-bit channel and two 8-bit channels
- * Per-channel volume, frequency, and waveform
- * 15 kHz or 64 kHz frequency divider.
- * Two channels may be driven at the CPU clock frequency.
- * High-pass filter
- Keyboard scan + 2 modifier bits + Break
- Potentiometer ports
- High Resolution Timers
- Random number generator
- Serial I/O port
- Eight IRQ interrupts
Versions
- C012294 — Used in all Atari 8-bit computers, including the Atari XEGS, and the Atari 5200 console. The suffix on the chip refers to the manufacturer:
- *C012294B-01 — AMI
- *C012294-03 — Signetics
- *C012294-19 — National Semiconductor
- *C012294-22 — OKI Semiconductor
- *C012294-31 — IMP
- 137430-001 — Part number sometimes used in Atari arcade machines for POKEY.
- 137324-1221 — Quad-Core POKEY used in Atari arcade machines Major Havoc, I, Robot, Firefox, and Return of the Jedi.
Pinout
| Pin Name | Pin Number | Description |
| A0 - A3 | 36, 35, 34, 33 | Memory Address Input |
| ACLK | 27 | Serial Clock Output |
| AUD | 37 | Audio Output |
| BCLK | 26 | Bi-direction Clock I/O |
| CS0 | 30 | Chip Select |
| CS1 | 31 | Chip Select |
| D0 - D7 | 38, 39, 40, 2, 3, 4, 5, 6 | Data Bus I/O |
| IRQ | 29 | Interrupt Request Output |
| K0 - K5 | 23, 22, 21, 20, 19, 18 | Keyboard Scan Output |
| KR1 - KR2 | 25, 16 | Keyboard Row strobe Input |
| P0 - P7 | 14, 15, 12, 13, 10, 11, 8, 9 | Potentiometer Scan |
| R/W | 32 | Read/Write I/O Control |
| SID | 24 | Serial Input Data |
| SOD | 28 | Serial Output Data |
| Vcc | 17 | Power +5 Volts |
| Vss | 1 | Ground |
| Ø2 | 7 | Phase 2 Clock Input |
Registers
The Atari 8-bit computers map POKEY to the $D2xxhex page and the Atari 5200 console maps it to the $E8xxhex page.POKEY provides 29 Read/Write registers controlling Sound, Paddle input, keyboard input, serial input/output, and interrupts. Many POKEY register addresses have dual purposes performing different functions as a Read vs a Write register. Therefore, no code should read Hardware registers expecting to retrieve the previously written value.
This problem is solved for some registers by Operating System "Shadow" registers implemented in regular RAM that mirror the values of hardware registers. During the Vertical Blank the Operating System copies the Shadow registers in RAM for Write registers to the corresponding hardware register, and updates Shadow values for Read registers from the hardware accordingly. Therefore, writes to hardware registers which have corresponding shadow registers will be overwritten by the value of the Shadow registers during the next vertical blank.
Reading values directly from hardware at an unknown stage in the display cycle may return inconsistent results. Operating System Shadow registers for Read registers would usually be the preferred source of information.
Some Write hardware registers do not have corresponding Shadow registers. They can be safely written by an application without the value being overwritten during the vertical blank. If the application needs to know the last value written to the register then it is the responsibility of the application to implement its own shadow value to remember what it wrote.
| Name | Description | Read/Write | Hex Addr | Dec Addr | Shadow Name | Shadow Hex Addr | Shadow Dec Addr |
| AUDF1 | Audio Channel 1 Frequency | Write | $D200 | 53760 | |||
| POT0 | Potentiometer 0 | Read | $D200 | 53760 | PADDL0 | $0270 | 624 |
| AUDC1 | Audio Channel 1 Control | Write | $D201 | 53761 | |||
| POT1 | Potentiometer 1 | Read | $D201 | 53761 | PADDL1 | $0271 | 625 |
| AUDF2 | Audio Channel 2 Frequency | Write | $D202 | 53762 | |||
| POT2 | Potentiometer 2 | Read | $D202 | 53762 | PADDL2 | $0272 | 626 |
| AUDC2 | Audio Channel 2 Control | Write | $D203 | 53763 | |||
| POT3 | Potentiometer 3 | Read | $D203 | 53763 | PADDL3 | $0273 | 627 |
| AUDF3 | Audio Channel 3 Frequency | Write | $D204 | 53764 | |||
| POT4 | Potentiometer 4 | Read | $D204 | 53764 | PADDL4 | $0274 | 628 |
| AUDC3 | Audio Channel 3 Control | Write | $D205 | 53765 | |||
| POT5 | Potentiometer 5 | Read | $D205 | 53765 | PADDL5 | $0275 | 629 |
| AUDF4 | Audio Channel 4 Frequency | Write | $D206 | 53766 | |||
| POT6 | Potentiometer 6 | Read | $D206 | 53766 | PADDL6 | $0276 | 630 |
| AUDC4 | Audio Channel 4 Control | Write | $D207 | 53767 | |||
| POT7 | Potentiometer 7 | Read | $D207 | 53767 | PADDL7 | $0277 | 631 |
| AUDCTL | Audio Control | Write | $D208 | 53768 | |||
| ALLPOT | Read 8 Line POT Port State | Read | $D208 | 53768 | |||
| STIMER | Start Timers | Write | $D209 | 53769 | |||
| KBCODE | Keyboard Code | Read | $D209 | 53769 | CH | $02FC | 764 |
| SKREST | Reset Serial Status | Write | $D20A | 53770 | |||
| RANDOM | Random Number Generator | Read | $D20A | 53770 | |||
| POTGO | Start POT Scan Sequence | Write | $D20B | 53771 | |||
| SEROUT | Serial Port Data Output | Write | $D20D | 53773 | |||
| SERIN | Serial Port Data Input | Read | $D20D | 53773 | |||
| IRQEN | Interrupt Request Enable | Write | $D20E | 53774 | POKMSK | $10 | 16 |
| IRQST | IRQ Status | Read | $D20E | 53774 | |||
| SKCTL | Serial Port Control | Write | $D20F | 53775 | SSKCTL | $0232 | 562 |
| SKSTAT | Serial Port Status | Read | $D20F | 53775 |
In the individual register listings below the following legend applies:
| Bit Value | Description |
| 0 | Bit must be 0 |
| 1 | Bit must be 1 |
| ? | Bit may be either 0 or 1, and is used for a purpose. |
| - | Bit is unused, or should not be expected to be a certain value |
| label | Refer to a later explanation for the purpose of the bit. |