Example of using the Z-80 PIO to communicate with the SPI style interface, just sends data no receive function.
My first test was using only two pins to drive the data and clk lines, just tieing the Reset to Vcc and Chip Select to ground.
Here is where I made the change to my existing code library for the Noritake VFD display, since I use C to create the library for the display I only needed to change port pins being used and the Z80 calls to do that.
void write_char(char k )
{
char i, j;
j = k;
for(i=0; i < 8; i++) // shift out 8 bits left (MSB First-LSB).
{
z80_pio_write_bit(0x01, 7, 0);
if (j & 0x80)
{
z80_pio_write_bit(0x01, 6, 1);
}else{
z80_pio_write_bit(0x01, 6, 0);
}
z80_pio_write_bit(0x01, 7, 1); //data bit is read from the transition of low to high.
j = j<<1;
}
}