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
:)
SPI1 Loop Back on AT91SAM7X-EK
Started by ●August 12, 2008
Reply by ●August 12, 20082008-08-12