Re: SPI on the User Port ... Mode Hang-Ups.



BruceMcF wrote:

CIA native is the second clock line (clock=1) and the second phase
line (phase=1) ... mode %11 = ... Mode3.

And, I'll show your idea in CLK line 3 below.

> \_________________________________/--
> __/-\_/-\_/-\_/-\_/-\_/-\_/-\_/-\____
> --\_/-\_/-\_/-\_/-\_/-\_/-\_/-\_/----
> ____/-\_/-\_/-\_/-\_/-\_/-\_/-\_/--\_
> .=1=x=2=x=3=x=4=x=5=x=6=x=7=x=8=x=...
> ..x=1=x=2=x=3=x=4=x=5=x=6=x=7=x=8=...

CLKout=SS XOR CLK gets close to what you want, using no select lines

SS CLK CLKout
1 1 0
0 0 0
0 1 1
1 0 1

If you put a F/F in there that clocked /SS out on falling edge of CLK, that would take care of the beginning. The end would need something to override that (maybe use /CLR on a F/F to reset it. Thus:


PORTD:4 is sent to D of F/F
/Q is sent out as SSout
CLK of F/F is hooked to CLK
PORTD:4 is sent to /CLR
CLKout is SSout XOR CLK

SSout can be use as input to '138 to give 8 (or 16) targets, as noted before. PORTD:4-0 is hooked to 138.

Thus, any address between 16-31 will select a device.

It would require 3 ICs ('138, '86 and some D F/F with CLR ('74?)

Jim












.