Skip to main content

Topics

This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

Topics - mrjogo

1
Bus Pirate Development / binary SPI sniffer 8MHz overflow
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)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01082249080session_write_close ( )...(null):0
20.01112380672ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01112381448Database_MySQL->query( ).../DatabaseHandler.php:119
40.05352520184Database_MySQL->error( ).../Db-mysql.class.php:273