Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


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 ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists