{"id":8883,"date":"2007-07-19T15:57:00","date_gmt":"2007-07-19T19:57:00","guid":{"rendered":"https:\/\/nuxx.net\/blog\/2007\/07\/19\/spi-sniffer-idea\/"},"modified":"2026-07-01T11:35:48","modified_gmt":"2026-07-01T15:35:48","slug":"spi-sniffer-idea","status":"publish","type":"post","link":"https:\/\/nuxx.net\/blog\/2007\/07\/19\/spi-sniffer-idea\/","title":{"rendered":"SPI Sniffer Idea"},"content":{"rendered":"<p>Can someone validate that the idea I have for a cheesey, hokey SPI sniffer will work?<\/p>\n<p>I have a device which contains a PIC and a NEC chip, which talk via SPI. Single master, single slave. I want to see all the data going in both directions and see it in relation to each other so I can figure out the protocol the PIC is talking.<\/p>\n<p>My thought is that I will make a sniffer for one direction (say, from the PIC to the NEC chip) as follows, then duplicate this to sniff the other direction (say, NEC chip to PIC):<\/p>\n<blockquote><p>Take a PIC and connect it&#8217;s SPI input and clock lines to the line-to-be-sniffed and clock going between the PIC and NEC chip. Have some simple software on the PIC which reads data from the SPI line into a FIFO as it comes in, then writes it out the UART as it can.<\/p>\n<p>Then I&#8217;ll take the data coming out the UART, run it through a MAX232 to make it RS232 levels, and feed it into a serial port.<\/p><\/blockquote>\n<p>I figure two of these tied to two serial ports and a cheesey little VB app to do the decoding (as I learn the protocol) could make for a nice, simple sniffer.<\/p>\n<p>I could even take it further by shoving the TTL level serial into one of the readily available TTL serial to USB chips, but that&#8217;s probably overkill for what I want to do.<\/p>\n<p>I think this should work&#8230; Can any of you see a reason why it wouldn&#8217;t? It&#8217;d be cheaper \/ more specific than a SPI-decoding logic analyzer, as I should be able to have lengthy samples, and matching the timing of the SPI line will easily be handled by the PIC.<\/p>\n<p>(I think <lj user=jerronimo> first mentioned doing it this way&#8230; I think&#8230;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Can someone validate that the idea I have for a cheesey, hokey SPI sniffer will work? I have a device which contains a PIC and a NEC chip, which talk via SPI. Single master, single slave. I want to see all the data going in both directions and see it in relation to each other\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,34],"tags":[],"class_list":["post-8883","post","type-post","status-publish","format-standard","hentry","category-electronics","category-moved-from-livejournal"],"_links":{"self":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/8883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/comments?post=8883"}],"version-history":[{"count":1,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/8883\/revisions"}],"predecessor-version":[{"id":12747,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/8883\/revisions\/12747"}],"wp:attachment":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/media?parent=8883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/categories?post=8883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/tags?post=8883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}