65SPI
*** Note - this device used the Xilinx 6572 CPLD which is not longer being manfactured.
Please see my newer V2 65SPI for a current solution.
An SPI interface for the 65C02 family of microprocessors
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.
Features:
· 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
· SCLK has an 6 bit programmable divider – CLK/2 through CLK/128
· 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 | /CS2 | PHI2 | A1 | A0 | R/W=1 (Read) | R/W=0 (Write) |
0 | x | x | x | x | Hi-Z | Hi-Z |
x | 1 | x | x | x | Hi-Z | Hi-Z |
x | x | 0 | x | x | Hi-Z | Hi-Z |
1 | 0 | 1 | 0 | 0 | SPI Data In | SPI Data Out |
1 | 0 | 1 | 0 | 1 | SPI Status | SPI Control |
1 | 0 | 1 | 1 | 0 | SCLK Divisor | SCLK Divisor |
1 | 0 | 1 | 1 | 1 | Slave Select | Slave Select |
See the full datasheet along with the source and Intel Hex object files here -> 65SPI
Home |