SAM3S4C : SPI example with PDC for Zigbee

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

mahenece
Posts: 1
Joined: Mon Aug 09, 2010 10:38 am

SAM3S4C : SPI example with PDC for Zigbee

Tue Oct 19, 2010 9:44 am

Hi,

I am having some problem using the PDC with SPI for Zigbee especailly in the TX side.

> uint8_t command_data = TRX_CMD_FW ;

>

> ENTER_CRITICAL_REGION();

>

> /* Start SPI transaction by pulling SEL low */

> SS_LOW();

>

> /* DMA transfer for SAM3S */

> /* Disable both read and write. */

> SPI_USED->SPI_PTCR = SPI_PTCR_RXTDIS | SPI_PTCR_TXTDIS;

>

> // Setup dma transfer including trx command byte

> SPI_USED->SPI_TPR = (uint32_t)&command_data;

> SPI_USED->SPI_TCR = 1;

> SPI_USED->SPI_TNPR = (uint32_t)data;

> SPI_USED->SPI_TNCR = length;

>

> // start transfer

> /* Enable read and write. */

> SPI_USED->SPI_PTCR = SPI_PTCR_RXTEN | SPI_PTCR_TXTEN;

>

> // wait while transfer isnt finished

> while((SPI_USED->SPI_SR & SPI_SR_TXBUFE) != 0);

>

> /* Wait for end of write; send counter should not matter. */

> /* Stop the SPI transaction by setting SEL high. */

> SS_HIGH();

>

> LEAVE_CRITICAL_REGION();


Can somebody check what is the probelm
User avatar
pfilippi
Contact:
Posts: 320
Joined: Fri Feb 13, 2004 7:53 pm

Re: SAM3S4C : SPI example with PDC for Zigbee

Mon Oct 25, 2010 9:00 pm

Hello,

could you give more information about the problem you are seeing please ?
No transfer occur ? no receive ?

Thanks.

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 2 guests