There's a lot of similar posts about the binary SPI speed, so if this has already been addressed, I apologize.
I'm trying to sniff SPI data in binary mode at 8MHz (using a modified SPI Sniffer utility), and after successfully receiving some data (~30 bytes), the MODE LED would go off and transmission would stop. Some debugging in the firmware indicated that the SPI buffer was overflowing (specifically, SPI2STATbits.SPIROV == 1).
On a hunch, I modified the firmware to use a stripped down version of the spiSniffer while loop (in SPI.c), which also only called UARTbufService() when CS was high (ie, no SPI data being transmitted). Sure enough, it happily transmitted all the data it could sniff (the data I'm sniffing comes in bursts, not continuously).
What this tells me is that, although the SPI hardware can do 8MHz no problem, the other things the firmware is doing in the while loop are taking too long. I'm not sure the appropriate fix (interrupt driven SPI handling?), but I thought I'd share my findings here.
VERSIONS
Board: Sparkfun Bus Pirate v3.somethingorother
Firmware: SVN r1983
SPI Sniffer: 0.3
IDE: MPLAB8 w/ C30 compiler
(note: I spent the time digging up links to all the versions I used, but spam prevention says I can't use them, so you'll have to go find them yourself)
Thanks for the info, sorry about the spam filter. I do intend to move spi and uart to interrupt eventually. I will check your fix and roll it into the next release if everything looks good.
Sorry, to be clear I made a fix that works for me, but probably isn't good enough for the general population (it essentially strips out everything but getting the SPI bytes and putting them in the UART buffer, and postpones sending the UART until the CS line is high and no data is coming in). I'll post here if I end up making it something more robust.
One interesting calculation is how many instructions can be run between checking the SPI in order to prevent overflows. Assuming 62.5ns per instruction (16MHz), and 1us per SPI byte (8MHz clk), that's only 16 instructions (which includes reading the SPI and sending the UART). Please let me know if any of my values or calculations are incorrect.