lkml.org 
[lkml]   [2008]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: atmel_spi clock polarity
From
On Mon, 18 Feb 2008 12:42:37 +0100, Haavard Skinnemoen <hskinnemoen@atmel.com> wrote:
> > Here is my quick workaround for this problem. It makes all CSRn.CPOL
> > match for the transfer before activating chipselect. I'm not quite
> > sure my analysis is correct, and there might be better solution.
> > Could you give me any comments?
>
> I'm not sure if I fully understand what problem you're seeing. Is the
> clock state wrong when the chip select is activated?

Yes.

> If so, does the patch below help?

Hmm... It might fix my problem. But IIRC the clock state follows
CSRn.CPOL just before the real transfer. Like this (previous transfer
was MODE 0, new transfer is MODE 3):

T0 T1 T2

CS ~~~|________________________________________________

CLK ______________________|~|___|~~~|___|~~~|___|~~~|___

SO ~~~~~~~~~~~~~~~~~~~~~~~~~~|___|~~~|___|~~~|___|~~~|_
MSB

T0-T1 was relatively longer then T1-T2. I suppose T1 is not the
point of updating MR register, but the point of starting DMA transfer.

Anyway, I will try your patch in a few days.

---
Atsushi Nemoto


\
 
 \ /
  Last update: 2008-02-18 15:15    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog