On 2013-07-29 20:19, Peter Stuge wrote:
> Joel Holdsworth wrote:
>>>> The patch considers CS# and decodes MOSI / MISO only after a CS#
>>>> H-L transition.
>>> 
>>> What if CS# is tied low?
>> 
>> Yes that's a good point. I can think of some chips that require the
>> transition for each packet, or even each byte.
> 
> Sure, I know of those too.
> 
> 
>> Some chips don't care and you can tie CS# low.
> 
> Right.
> 
> 
>> I wonder how important it is to deal with all this.
> 
> It makes the difference between sigrok being useful and sigrok
> not being useful. I think it's important that sigrok is useful.
> 
> 
>> Maybe the CS# behavior could be optional, defaulted to ignore.
> 
> Ignore is also not so great. I would suggest a default of only
> sampling when CS# is low, with an option to additionally require
> a H->L transition on CS#, but *always* restarting on a new word
> whenever a H->L transition is seen, regardless of the option value.
> 
> 
> //Peter


I have tried to draw an example with a wordsize of 4 bits, sampling of 
MOSI @ rising edge of SCK & a default SCK value of H.


CS# makes a H-L transition -> decoder starts working; CS# goes H after 
frame.

     __                           ___
CS#   |_________________________|

     __     __    __    __    _____
SCK   |___|  |__|  |__|  |__|

      _             ______________
MOSI  |___________|


decoder output -> 0011



A CS# H-L transition always starts a new frame (the old frame is left 
"unfinished")

     __             ________                       ________
CS#   |___________|        |_____________________|

     __     __    __    __    __    __    __    ________
SCK   |___|  |__|  |__|  |__|  |__|  |__|  |__|

      _             _________________
MOSI  |___________|                 |___________________


decoder output -> 00, 1100



The decoder decodes subsequent frames as long as CS# is low
     __                                                      ___
CS#   |____________________________________________________|

     __     __    __    __    __    __    __    __    __________
SCK   |___|  |__|  |__|  |__|  |__|  |__|  |__|  |__|

      _             __________________
MOSI  |___________|                  |_________________________


decoder output -> 0011, 1000


There is a flag which allows the decoder to ignore additional frames 
without another CS# H-L transition.

decoder output MOSI -> 0011


Is that what you have in mind?

Regards - Clemens


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to