Atmega32, !SS and SPI

Ran into some trouble trying to get the SPI interface to work on the Atmega32 micro controller. Sometimes, the interface would not work after a reset, It looked as if the interface just would not get initialized while my code looked fine.

After some investigation and debugging i found out that sometimes the MSTR bit would be cleared before the software could fully initialize the SPI interface. So i looked up the chapter on PSI in the datasheet to see if there was some special situation that could clear this bit. (more…)