I will need to communicate with a device using serial protocol mostly similar to SPI but with several changes:
Data packet can has any bit length (e.g. 35 bits)
Stop sequence formed by lack of clocks for time more than needed to transmit 2 data bits
I could handle this by software implementation of this protocol, but the communication frequency is 40 MHz (20 Mbits/s) so I will need pretty fast controller to handle this.
Now I'm looking for two possibilities:
Use the controller having more flexible SPI (I don't even know where I could look for it, if any of AVR will fit my needs I will be happy).
Attach a hardware shift register to general purpose controller (most likely AVR in my case).
Surely I'd prefer the first option. Any thoughts?