I am trying to run SPI on Atmega168 at uncommon frequencies like 6MHz,7MHz and so on. How can I do this? Is one way to do this is to bit bang the AVR ports? The other way I was thinking was to use a timer output as the SPI clock so I can adjust the counter to get 6MHz for example. Will this work? The slave will be another AVR so does the slave crystal frequency have to be equal to the master SPI clock frequency (in this case 6MHz)?