The data sheet for the COM-09767 7-Segment Serial Display says "The maximum speed of the SPI clock input is 2MHz", yet I'm unable to get it to work at anything over 0.5Mhz. Looking at the source code for the onboard ATMega328 I see the following:
which should configure the SPI clock as 1/4 of the system clock. I can't see an external resonator or crystal on the board, and looking through the code seems to suggest that it expects a clock rate of 8MHz which would be right if the internal 8Mhz resonator is being used. However I can only get it to run at 0.5MHz using the following SPCR settings on a CPU that's running at 16MHz:
Code: Select all
_BV(SPE) | _BV(MSTR) | _BV(SPI2X) | _BV(SPR1)
That gives a SPI clock of f_osc / 32, which is 16 / 32 or 0.5Mhz.
Why doesn't the display board run at the rated 2MHZ SPI frequency? The only possible suggestion I can come up with is that the CKDIV8 fuse bit has been set incorrectly, but then I'd expect the maximum frequency to be 8 / 8 / 4 = 0.25Mhz, not 0.5MHz.