Sign in

username:

password:



Not a member?

Search AT91SAM



Search tips

Subscribe to AT91SAM



Ads

Discussion Groups

Discussion Groups | AT91SAM ARM | SPI1 Loop Back on AT91SAM7X-EK

For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU. This group is to exchange information to help users get started and learn how to use the devices.

SPI1 Loop Back on AT91SAM7X-EK - hudson_low - Aug 12 7:07:01 2008

Hi,

Any one have Problem with SPI1?

I am using my SAM7-EK to test the SPI code.

I started to test the spi code with internal loop back.
SPI_MR =(AT91C_SPI_MSTR | AT91C_SPI_MODFDI | AT91C_SPI_LLB)
and both SPI0 and SPI1 work.

Then I try with external Loop Back,(MISO and MOSI short tohether with
wire)
And I manage to get echo back on SPI0 but NOT on SPI1
with same set of code to configure the SPI0 and SPI1 as below:

Any one have any idea or similar problem with SPI1?
//----------------------------------------------------------------//
// Disable the interrupt
AT91C_BASE_AIC->AIC_IDCR = 0x1 << AT91C_ID_SPI1;
// Disable the PDC transfer
AT91C_BASE_SPI1->SPI_PTCR = AT91C_PDC_RXTDIS | AT91C_PDC_TXTDIS;

// Enable the SPI in PMC
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SPI1;

AT91C_BASE_SPI1->SPI_CR = AT91C_SPI_SWRST |AT91C_SPI_SPIEN;
AT91C_BASE_SPI1->SPI_MR = AT91C_SPI_MSTR | AT91C_SPI_MODFDI;

// Configure Chip select register
AT91C_BASE_SPI1->SPI_CSR[0] = SPI_NPCS0_CONFIG;

//----------------------------------------------------------------//
Thanks in advance

:)
------------------------------------



(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )


Re: SPI1 Loop Back on AT91SAM7X-EK - hudson_low - Aug 12 10:41:11 2008

I have found the solution:

http://www.at91.com/phpbb/viewtopic.php?t=1572&highlight=spi1

------------------------------------



(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )