Hi, On Tue, Aug 27, 2013 at 08:32:29PM +0200, Clemens Novak wrote: > A short update / additional information on this: I attached an sr > file (0: CS#, 1: MOSI, 3: SCK) which is cut off at the beginning; > i.e. the first "block" contains only 6 bits (instead of eight). > > If I decode this signal with > > sigrok-cli -i spi_atmega32_cutoff.sr -P > spi:wordsize=8:miso=1:mosi=1:sck=3:cs=0 > > it outputs: > ... > spi: "MOSI: 0x59, MISO: 0x59" > ... > spi: "MOSI: 0x5d, MISO: 0x5d" > ... > > Looking at the capture, you can see that the decoder combines 6 bits > from the "block" 1 with 2 bits from "block" 2; yielding a value of > 0x59. The it takes 6 bits from "block" 2 and 2 bits from "block" 3 > yielding a value of 0x5d.
Yup, that's indeed what happens. I changed/fixed a bunch of other stuff in the SPI decoder today to make it ready for GUI use, part of that also fixed (some of) these issues. Here's what the decoder does now: $ sigrok-cli -i spi_atmega32_cutoff.sr -P spi:miso=1:mosi=1:sck=3 spi: "59/59" spi: "5D/5D" spi: "61/61" spi: "65/65" spi: "69/69" spi: "6D/6D" $ sigrok-cli -i spi_atmega32_cutoff.sr -P spi:miso=1:mosi=1:sck=3:cs=0 spi: "57/57" spi: "58/58" spi: "59/59" spi: "5A/5A" spi: "5B/5B" spi: "5C/5C" The CS# pin is now an optional one. If you supply it, it is honored and the internal state machine is reset everytime a CS# transition is seen, which leads to "incomplete" frames like the first one in your *.sr file to be ignored. This may not yet catch all corner cases, but it's a start. When CS# is not supplied to the PD, it'll behave like before, i.e. sample SPI data bits on every clock transition (depending on SPI mode). I've also tested this with a bunch of other files and stacked PDs, it seems to work OK so far. Thanks for your report and helping to diagnose this! Cheers, Uwe. -- http://hermann-uwe.de | http://randomprojects.org | http://sigrok.org ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. Consolidate legacy IT systems to a single system of record for IT 2. Standardize and globalize service processes across IT 3. Implement zero-touch automation to replace manual, redundant tasks http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

