Page 1 of 1

SPI capturing and decoding

PostPosted: Wed Mar 23, 2016 11:27 pm
by silverk

I'm facing issues with SPI capturing (Only clock and MOSI).

Sometimes capturing succeeds, mostly not.

I have tried different clock frequencies in SPI master. What could be working settings (sample count and rate) to capture single word (8bit) when clock is 30kHz, 100kHz and 1MHz?

For example when clock frequency is 30kHz I need to capture 1M Samples @ 1MHz to get any reasonable output. Sometimes I'm able to get one sample. Both program and device restart does not recover it. I even do not understand how it recovers, but it recovers. When it does not work, voltage levels change but time when it changes does not make any sense.

I have used it before for UART so far without any issues.

I know that SPI works. I'm able to see clock and data with scope and decode it with BusPirate.

Operating system: OS X 10.10.5 (14F1713)
DSView: 0.9.2

Re: SPI capturing and decoding

PostPosted: Thu Mar 24, 2016 2:30 am
by silverk
Seems that it can be OS X issue. Reboot solved it for this time.

But anyway if clock frequency is 1 MHz I will lose some bits when sample rate is 1 MHz or 2 MHz. It seems to be reliable at 5 MHz.

Re: SPI capturing and decoding

PostPosted: Thu Mar 24, 2016 11:07 pm
by Andy
The sample rate should be 4x-10x times than the signal you captured.
consider the sample point at each signal edge, 2x sample rate may capture nothing.