- Posts: 799
SPI capture guide
- dc59
- Topic Author
- Offline
I have ordered a logic analyzer ,and want to learn SPI capture.
Where can I get some guide or manual to teach me how to do it? I don't have any experience
about this, please help.
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
dc59 wrote: I ues deviation firmware for a long time and now I want to contribute something for deviation,
I have ordered a logic analyzer ,and want to learn SPI capture.
Where can I get some guide or manual to teach me how to do it? I don't have any experience
about this, please help.
I did this video sometimes ago
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
Please Log in or Create an account to join the conversation.
- greenfly
- Offline
The "24Mhz" option describes the rate at which samples will be captured.
Combined, they dictate a *capture period* that you should do all your communication sampling in.
- The more samples you take the longer the capture period
- The lower the sample rate the longer the capture period
You select these in combination to give you just enough resolution you need, but with enough samples that the capture period is long enough to do all your tests. Usually 8Mhz is fast enough so 50 Million samples lets you capture about 10 seconds of activity. You can increase the sample count to extend the capture period... but the file sizes grow quickly. That's why I generally break down captures into individual small single actions.
Edit: I forgot that there is a "trigger" mechanism that can be used to make the timing a little easier. I did not learn how to use that though.
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
greenfly wrote: Those describe the number of samples that will be collected during the next capture.
The "24Mhz" option describes the rate at which samples will be captured.
Combined, they dictate a *capture period* that you should do all your communication sampling in.
- The more samples you take the longer the capture period
- The lower the sample rate the longer the capture period
You select these in combination to give you just enough resolution you need, but with enough samples that the capture period is long enough to do all your tests. Usually 8Mhz is fast enough so 50 Million samples lets you capture about 10 seconds of activity. You can increase the sample count to extend the capture period... but the file sizes grow quickly. That's why I generally break down captures into individual small single actions.
Edit: I forgot that there is a "trigger" mechanism that can be used to make the timing a little easier. I did not learn how to use that though.
Thanks for your reply.
In Seby's video ,he just changed to '50 M Samples' , I didn't find he changed rate to 8Mhz , is 24Mhz ok for SPI capture ?
or I need to change it to 8Mhz?
Please Log in or Create an account to join the conversation.
- Durete
- Offline
- Posts: 610
24mhz is ok, but will generate a huge capture file.dc59 wrote:
greenfly wrote: Those describe the number of samples that will be collected during the next capture.
The "24Mhz" option describes the rate at which samples will be captured.
Combined, they dictate a *capture period* that you should do all your communication sampling in.
- The more samples you take the longer the capture period
- The lower the sample rate the longer the capture period
You select these in combination to give you just enough resolution you need, but with enough samples that the capture period is long enough to do all your tests. Usually 8Mhz is fast enough so 50 Million samples lets you capture about 10 seconds of activity. You can increase the sample count to extend the capture period... but the file sizes grow quickly. That's why I generally break down captures into individual small single actions.
Edit: I forgot that there is a "trigger" mechanism that can be used to make the timing a little easier. I did not learn how to use that though.
Thanks for your reply.
In Seby's video ,he just changed to '50 M Samples' , I didn't find he changed rate to 8Mhz , is 24Mhz ok for SPI capture ?
or I need to change it to 8Mhz?
For TX captures, usually 8mhz is ok.
For RX captures, usually is needed more resolution. 16Mhz should be ok.
Please Log in or Create an account to join the conversation.
- hexfet
- Offline
- Posts: 1891
Sampling at the fastest rate possible to check the SPI clock frequency is a good place to start. Then depending on the clock frequency the sampling rate can be lowered to reduce the file size.
For some reason the SPI buses of two toy quads I've looked at have much higher SPI clock frequencies on the receiver than the transmitter.
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
Please Log in or Create an account to join the conversation.
- Durete
- Offline
- Posts: 610
hexfet wrote: Those rates should typically be okay, but the minimum rate is determined by the frequency of the SPI clock signal. To not miss any transitions in the signal being sampled the sample rate needs to be greater than the fastest transitions in the signal (for example, a square wave has transitions twice every cycle so the sample rate needs to be at least twice the square wave frequency). Haven't tested but I'd expect the SPI decoder in the logic analyzer needs to see every SPI clock transition, so the sample rate needs to be more than twice the SPI clock frequency.
Sampling at the fastest rate possible to check the SPI clock frequency is a good place to start. Then depending on the clock frequency the sampling rate can be lowered to reduce the file size.
For some reason the SPI buses of two toy quads I've looked at have much higher SPI clock frequencies on the receiver than the transmitter.
Perfect explanation that I couldn't with my bad English
Hats off, Sir
Please Log in or Create an account to join the conversation.
- greenfly
- Offline
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
~ 10MB Session data.
www.mediafire.com/download/2p3n5zzrbdm55...ni-SPI-LogicData.zip
~2.2MB Export CSV data
www.mediafire.com/download/vxue8tpbtyvuwm3/H8mini-SPI-CSV.zip
Can anyone help me to check it out and try to develop protocol?
Thanks.
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
dc59 wrote: I captured Eachine H8 mini SPI data as below:
~ 10MB Session data.
www.mediafire.com/download/2p3n5zzrbdm55...ni-SPI-LogicData.zip
~2.2MB Export CSV data
www.mediafire.com/download/vxue8tpbtyvuwm3/H8mini-SPI-CSV.zip
Can anyone help me to check it out and try to develop protocol?
Thanks.
You should save session & data also via the top right option menu
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
SeByDocKy wrote:
dc59 wrote: I captured Eachine H8 mini SPI data as below:
~ 10MB Session data.
www.mediafire.com/download/2p3n5zzrbdm55...ni-SPI-LogicData.zip
~2.2MB Export CSV data
www.mediafire.com/download/vxue8tpbtyvuwm3/H8mini-SPI-CSV.zip
Can anyone help me to check it out and try to develop protocol?
Thanks.
You should save session & data also via the top right option menu
Yes, I follow your tutorial to save session&data at #1 10MB file.
Please Log in or Create an account to join the conversation.
- S.Giles
- Offline
- Posts: 27
The 16MHz sample rate worked for me, and didn't seem to generate un-useably large files.
Please Log in or Create an account to join the conversation.
- robca
- Offline
- Posts: 174
Trying to guess how many samples you need is super frustrating
Please Log in or Create an account to join the conversation.
- Durete
- Offline
- Posts: 610
robca wrote: I set very longcapture times, then manually stop the process when the right events are captured... there's no need to guess how much you need, when you stop capture the Logic software saves the file until that point
Trying to guess how many samples you need is super frustrating
Yep, me too. 100% agree
Please Log in or Create an account to join the conversation.
- Deal57
- Offline
- Posts: 857
1. Set the SPI decoder to show HEX
2. Set the SPI analyzer settings to match the channels as you've connected them. I think your channels should be:
MOSI: 1 (maybe -- and you can always swap this later)
MISO: 0 (and you can always swap this)
Clock: 2
Enable: 3 (enable is usually configured to be active when the value is low, but you may have to play with this)
3. Use the Options to set the analyzer to show HEX data. You will also use this menu to Save the capture (useful if other people need to be able to manipulate the settings against your capture) or EXPORT data (to save off the data only). I think some of the technical guys prefer the "Save Capture" approach.
4. Set up a trigger on the ENABLE or CLOCK line. Triggers tell the analyzer to begin collecting samples at a certain point. I usually set only one channel for a trigger. In my example I used a downward change on the enable line to tell the analyzer when to begin collecting samples.
5. Once things are set up, you can move the the 0 point and see the data broken out like this:
Let me know if I can elaborate or clarify any of these notes.
Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
Please Log in or Create an account to join the conversation.
- dc59
- Topic Author
- Offline
- Posts: 799
robca wrote: I set very longcapture times, then manually stop the process when the right events are captured... there's no need to guess how much you need, when you stop capture the Logic software saves the file until that point
Trying to guess how many samples you need is super frustrating
That's a good idea, thanks!
I also follow Deal57's setting to set a trigger on clock channel,
it's perfect now.
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- SPI capture guide