Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


SPI Driver Help

Posted by Allure99 on April 3, 2008

I am using using AT91SAM7 (as SPI master)trying to talk to another Micro(MSP430: SPI slave)

Q1, Do i need PDC for this?

Q2, What are the different for the ISR handler using PDC and Non PDC?

Q3: Any one has sample Driver code for this?

Many Thanks!

RE: SPI Driver Help

Posted by Çağlar Akyüz on April 3, 2008

A1) You don't need to use PDC, but it is easier and more CPU friendly.

A2) The difference is that you don't need ISR for the PDC that much. You
will probably want to know end of transfer so you will only handle PDC related
ENDTx or ENDRX flag in the ISR for the PDC. For the other case, you will need to
handle many more flags in the interrupt handler.

A3) There are some example codes posted to this forum(or to theAT91SAM yahoogroup)
If you are asking for a complete freeRTOS driver, then you have to do it yourself.
I have never seen any. But mechanism is similar for any driver.
For example you can take a serial driver as basis and replace usart related calls with
the spi ones.


RE: SPI Driver Help

Posted by Allure99 on April 4, 2008
Hi Caglar,

Thanks for your reply.
I think i have configure the but not the ISR.

I Refer a sample code From atmel that write/ read external flash through SPID (PDC) and it only service SPI_RXBUFF flag in its SPID handler.

I am a bit confuse which flag to service on ISR.

Do u mind to show me where can i get more detail on how to handle SPI PDC ISR.

Thanks again.

kind regards

RE: SPI Driver Help

Posted by Çağlar Akyüz on April 4, 2008
Yes that's correct. You can use either RXBUFF or ENDRX. RXBUFF means both of the buffers are completed, ENDRX means only current buffer completed.

Do you have a code without interrupt using dma(pdc) to transfer/receive from sam7x to msp430?

RE: SPI Driver Help

Posted by Allure99 on April 4, 2008

Ok I am clearer now.

I am trying the SPI driver with onboard at45 dataflash
to help my self understand how SPI work.

Next step will be then to get the SAM7x and MSP430 talking to each others.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner