I am using max335 spi switches for a music sequencer. I want to add some leds to show the channel that is on. I can't just tap the channel as the voltage changes from zero to 10v so I was thinking of using an 18m2 that reads the CS and advances as the CS is addressed.
Here is what I had in mind:
The idea is that when DIN(C.1) and CS(C.0) both see data the sequence advances. IE I'm looking to decode the spi on the 18m2 to set the port and mimic the channel on the leds
Do you think I can just read the DIN line and CS and set a variable that defines the port pin status? IE simulated SPI?
Here is what I had in mind:
Code:
dirsC=%00000000
dirsb=%11111111
b1=%00000001
main:
If pinC.0=1 and pinc.1=1 then goto seq:
if pinC.0=0 then goto Main:
seq:
if b1=%00000000 then let b1=%00000001
endif
let pinsb=b1
b1=b1*2
goto main
Do you think I can just read the DIN line and CS and set a variable that defines the port pin status? IE simulated SPI?