On Wednesday 15 July 2009, Paulraj, Sandeep wrote:
> > 
> > My copy of the at26540 data sheet says very explicitly that
> > the chip supports only modes 0 and 3.
>
> [Sandeep] so does mine and I've had this question before.
> 8 months before to be precise. 
> 
> I have checked multiple TI sources(RBL, UBL) across multiple SOC's and even
> Spectrum Digital code. 
> They all set bit 16 of the SPI format register to 1.
> That means phase is 1.

Or more likely, that BIT(16) == !CPOL ... the dm365 SPI docs say for bit 16

0 SPI clock signal is not delayed versus the transmit/receive data stream.
  The first data bit is transmitted with the first clock edge and the first
  bit is received with the second (inverse) clock  edge.

1 SPI clock signal is delayed by a half SPI clock cycle versus the
  transmit/receive data stream. The first transmit bit has to output prior
  to the first clock edge. Master and slave receive the first bit with
  the first edge.

But for example

 
http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Clock_polarity_and_phase

describes CPOL=0 CPHA=0 as

  ... data are read on the clock's rising edge (low->high transition) and data
  are changed on a falling edge (high->low clock transition).

Which fits the BIT(16) == !CPOL theory quite nicely, and also matches
what the at25640 data sheet timing diagrams show (Figure 3 for mode 0).


> When I was verifying SPI on the EVM (not running Linux and just running CCS
> test programs) long ago, that I have had issues when the phase is not set
> to '1'.

Understandable ... it seems BIT(16) == !CPOL, so it must be set.  :)

- Dave




_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to