Rigol DS1054Z SPI decoder issue - Page 1
Forum section: electronics / testgear

author: vnv
author_rank: Contributor
timestamp: December 29, 2018, 03:47:46 pm
content: Hi everyone,got some issues with my RIGOL DS1054Zso I wanted to share it with you and maybe someone can help out.So this is the case, I am using Buspirate to generate SPI signal.Buspirate configuration:Mode: SPISpeed: 1 MHZClock polarity: Idle low *defaultOutput clock edge: Activate to idle *defaultInput sample phase: Middle *defaultCS: /CS *defaultOutput type: Normal (H=3.3V, L=GND)And after setting up my scope (which you can see from the pictures) I send [ 0x20 ] to SPI.Scope has SPI decoder ON and crazy thing is that after decoding it shows decoded number as 00000000Just to be sure Buspirate works I connected it to my Saleae Logic analyzer and it showed all was ok, everything that I've sent logic analyzer showed as ok.So this is how my scope looks like...Thanks in advance!!

author: MarkF
author_rank: Super Contributor
timestamp: December 29, 2018, 07:05:38 pm
content: It's been a while since I've looked at SPI.I seem to remember that the threshold levels need to be adjusted.(Bottom right button on your QuickPrint3 picture)

author: Fungus
author_rank: Super Contributor
timestamp: December 29, 2018, 07:14:44 pm
content: Try setting your mode to "timeout" instead of "CS"

author: vnv
author_rank: Contributor
timestamp: December 29, 2018, 11:46:12 pm
content: Thanks for helping out, so here comes the new info.... So I pulled out my STM32F103 board and wrote SPI code on it and started to play.To be sure that I add more issues to it, I have removed all but one GND from probes and it still worked, at around 4MHz without any issue as seen on picture 2.1.I've concluded that problem could be because of long wait for data to come in (CS gets low but there is long pause afterward till data start comming), so I started to add pause and then (picture 2.3 and 2.4) problem started to go off.It seems that for some reason time between CS going low and data coming in creates issue for SPI decoderWhat do you say ?? Could it be such stupid BUG exists?

author: vnv
author_rank: Contributor
timestamp: December 29, 2018, 11:50:11 pm
content: Quote from: Fungus on December 29, 2018, 07:14:44 pmSorry but how could I use "timeout", never worked with it?

author: Martin72
author_rank: Super Contributor
timestamp: December 30, 2018, 12:08:07 am
content: You should use timeout when you have a 2-wiring protocol, CLK and Data.Another point is, your DS1054 can only decode what´s on the screen displayed.

author: vnv
author_rank: Contributor
timestamp: December 30, 2018, 12:37:06 am
content: Quote from: Martin72 on December 30, 2018, 12:08:07 amIn the first set of pictures I have it in the screen, and trigger is set to Single so it should show it decoded, but as I said if the pause is to big (going from trigger - CS low) no decoding gets done. This is one very strange thing.

author: Martin72
author_rank: Super Contributor
timestamp: December 30, 2018, 12:52:02 am
content: What´s the length..We have 16bit length, therefore:https://www.directupload.net/file/d/5300/vqsctiu7_png.htm

author: vnv
author_rank: Contributor
timestamp: December 30, 2018, 01:26:01 am
content: Quote from: Martin72 on December 30, 2018, 12:52:02 amIt doesn't matter the size. First time I had the situation it was with 8bit, then I have done it with 16 and more.What is your pause from CS going low? Can you test it out with pause of 50us (also post the picture if possible).I have uploaded pics so you can see how it looks above.

author: Martin72
author_rank: Super Contributor
timestamp: December 30, 2018, 01:41:49 am
content: Hi,QuoteIn our case appx 1 µs

author: vnv
author_rank: Contributor
timestamp: December 30, 2018, 01:43:31 am
content: Quote from: Martin72 on December 30, 2018, 01:41:49 amIf you want to test the issue add 50us or 80us and see if it decodes.

author: Martin72
author_rank: Super Contributor
timestamp: December 30, 2018, 10:53:22 am
content: Hi,I´ll do it at work next week.

author: vnv
author_rank: Contributor
timestamp: December 30, 2018, 11:37:15 am
content: Great, please tell what you get.

author: 2N3055
author_rank: Super Contributor
timestamp: December 30, 2018, 02:13:34 pm
content: Like other have said, it decodes from the screen. Decoder needs to "see" CS edges going up and down before and after packet for it to work. So on screen you have to have CS edge going low , data packet and then CS going up. Using timeout (explained in manual) doesn't need CS and would work with only data packet on screen...

author: Fungus
author_rank: Super Contributor
timestamp: December 30, 2018, 08:39:41 pm
content: Quote from: 2N3055 on December 30, 2018, 02:13:34 pmHence "timeout" mode. It doesn't look at CS, it looks for clock pulses.

author: Martin72
author_rank: Super Contributor
timestamp: December 30, 2018, 09:24:54 pm
content: Quote from: Martin72 on December 30, 2018, 01:41:49 amMy fault - I meant timeout about 1µs, afaik we don´t use CS.Sorry

author: vnv
author_rank: Contributor
timestamp: December 30, 2018, 09:38:51 pm
content: How do you assert CS line , how do you mean you don't use it?

author: Martin72
author_rank: Super Contributor
timestamp: December 30, 2018, 10:22:52 pm
content: On our controller boards there existing two measuring points for testing, SPI out and SPI clock.We had several (analog) inputs for supervision the circuits (e.g., Input voltage)on the controller board.This will be feed in the µC.The µC gives a value out in decimal to the SPI out testpoints( e.g., 400Vdc Input means a value of 920d).To decode it correct, if you don´t use CS (like we didn´t), you must choose "timeout".

author: vnv
author_rank: Contributor
timestamp: December 30, 2018, 10:24:11 pm
content: Got it!Cool approach.

author: Martin72
author_rank: Super Contributor
timestamp: December 30, 2018, 10:38:34 pm
content: We are in the market for power inverters/converters.Using long time mostly analog control circuits, except creating pulsewidth modulation and error supervisions, realized by an PLD (lattice).Today we use in new projects controlboards fully controlled by µCs, even regulation.To get sure that the a/d conversion circuits are proper mounted with the right resistor/capacitor values, we use the "debugging function" via SPI, check the values for every input circuit on the board.