SPI Controller Device


An SPI interface for the 65C02 family of microprocessors

This is the second version of my 65SPI using an Atmel ATF1504 CPLD.

*** This design has not yet been tested on actual silicon. Use at your own risk.

This device was created to provide a basic SPI interface for the 65xx family of microprocessors.   Currently, the only way to provide SPI is to bit-bang it using a 6522 or equivalent device.   That uses a lot of microprocessor time and program space.   This device takes care of the data loading, shifting, clocking, and control - freeing the microprocessor for more important duties.   There is interrupt support to allow an ISR to handle the SPI interface.   The status register provides signals for polling if interrupts are not desired.


∑ CPU bus is compatible with 65C02 and 65C816 microprocessors
∑ Uses 4-byte memory map for host access to registers
∑ Operates as an SPI master
∑ SCLK derived from PHI2 or an External Clock source
∑ SPI Mode 0, 1, 2, 3 supported
∑ Shifts MSB first
∑ 8-bit Slave select register with 8 Slave Select outputs
∑ External slave select decoding can yield up to 255 addresses.
∑ Direct slave select decoding yields 8 devices
∑ Programmable interrupt
∑ Interrupt or polled transmit complete flags

Chip Layout:

Pin Descriptions

A0-A1    Microprocessor address bus (input)
CS1      Chip select, active high (input) 
/CS2     Chip select, active low (input) 
D0-D7    Microprocessor data bus (bidirectional)
EXTC     External shift clock (optional input) 
GND      System ground 
/IRQ     Microprocessor interrupt line, active low (output) 
MISO     SPI Master In, Slave Out line (input) 
MOSI     SPI Master Out, Slave In line (output) 
PHI2     Microprocessor system clock (input) 
/RES     Microprocessor reset line, active low (input)
R/W      Microprocessor data read/write line (input) 
SCLK     SPI Shift Clock output 
SS0-SS7  Slave Select lines (outputs) 
VCC      System +5vdc 
n/c      No connection 

Register Address Map

CS1/CS2PHI2A1A0R/W=1 (Read)R/W=0 (Write)
10100SPI Data InSPI Data Out
10101SPI StatusSPI Control
1011xSlave SelectSlave Select
    x = donít care

See the full datasheet along with the source and Intel Hex object files here -> 65SPI v2

All info provided "as-is" and is Copyright 2020.