I'm having a problem with initializing an SPI slave device and maintaining its proper operation. The data being returned to the master is from some front panel switches. 0xFF means no switches are down, and zero bits mean one or more switches are held down. Data from the master is destined for a display. On one of the master devices there are no apparent problems. On the other one however, the switch data that I am writing to SPDR apparently causes the WCOL bit to be set. This in turn apparently causes the SPI receiver to read 0x00 from SPDR for every successive interrupt, despite the Beagle Analyzer showing copious amounts of non-zero display data. If I force a watchdog RESET then the SPI recovers and the second master works pretty much like the first one which never seems to have the problem.
I have some questions:
1. How can I avoid the WCOL problem from occurring in the first place?
2. How can I recover from it once it does?
3. How would you initialize the SPI port, check for this condition, and correct it?