[En-Nut-Discussion] Strange problems with SPI in PDC mode on AT91SAM7XC512

Ole Reinhardt ole.reinhardt at embedded-it.de
Fri May 27 16:32:45 CEST 2011


Hi all,

I gave the PDC mode transfer of SPI Bus 0 on the AT91SAM7XC512 a chance.

It seemed to work with an SD Card connected to SPI0_NPCS1, but I have
strange effects when using a dataflash at SPI1_NPCS0 in parallel.

Btw: Both are configured in SPI_MODE0

First of all, the MMC transfers seem to work. Next I try to access the
dataflash with uflashfs. The first transfer done on the NPCS0 (dataflash
cs) is just a status request which should return 0x7F 0xB4

On my oscilloscop everything looks fine, but the result of the PDC
transfer seem to have an offset of 1 so I get 0xFF7F, the 0xB4 byte is
dropped.

In other words, the PDC transfer does not work correctly and is dropping
the first received byte.

Next strange problem:

Again, the PDC transfer with the MMC card works fine, but when accessing
the dataflash again, the chipselect rises too early (here at 14 clocks
on a 2 byte transfer (16 should be ok). 

To workaround this, I tried to add a short delay after each transfer.
Which at least works (CS is hold long enough) but the above problem
still exists.

At least there is a last strange problem :)

To avoid extra overhead for PDC transfers I added this little heuristic
to use polling mode transfers, if xlen < 4

Now the output on the MOSI pin stays at high level and therefor the
transfer does not work properly at all.

Testcase is still the same as above, the problem seem to only occur
together with the dataflash.

I'm totaly confused as with just using polling transfers or just using
interrupt driven transfers everything works fine.

Any suggestions out there?

Bye,

Ole


-- 

Thermotemp GmbH, Embedded-IT

Embedded Hard-/ Software and Open Source Development, 
Integration and Consulting

http://www.embedded-it.de

Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - 
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97

Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 




More information about the En-Nut-Discussion mailing list