AVR32 AP7 - SPI Driver Documentation

Introduction

This is the documentation for the data structures, functions, variables, defines, enums, and typedefs in the software for application note AVR32105. It also gives an example of the usage of the SPI driver for both master and slave mode.

Main Files

Compilation Info

This software was written for the GNU GCC for AVR32 and IAR Systems compiler for AVR32. Other compilers may or may not work.

Device Info

All AVR32 devices with a SPI module can be used. This example has been tested with the following setup:

Setup Information

CPU speed: 20 MHz

This example uses the switches, LEDs and RGB LEDs on the STK1000 card. They must be connected by the following scheme for the example to work out of the box.

This example uses chip select signal 0, which is shared with the external DAC on the STK1000 development kit. This signal is pulled low when the microprocessor is active in master mode. And the same signal is used to signal the device while in slave mode.

The SPI buss located on the SPI header (J27) on the STK1000 board must be connected to anther target capable of SPI. For example an other STK1000 board or an Atmel AVR. It is nessesary to connect NPCS0 (chip select signal) on AP7000 for the application to work in slave mode.

Application Usage

The device will start up in slave mode, and LED6 and LED0 on STK1000 board should be lit. If LED6 and LED0 is not lit there is a problem with setup or the CPU is not running.

The application is controlled using the switches on the STK1000 board. The switches have the following functions:

SW5, SW4 and SW3 does not have any function in slave mode.

The application polls the SPI module in slave mode and will read all data sent on the SPI bus if NPSC0 is pulled low.

Slave mode

When receiving data on the SPI bus the LED1 will blink for a very short periode and then LED3 will be lit while the device is comparing the text string received with the expected text string. At the same time as LED3 is lit the RGB LEDs will blink orange.

After the compare the status will be displayed using the RGB LEDs. The RGB LEDs have the following status:

The blinking red mode will usually follow by a new analyse mode since the application breaks the processing and there is often still data in the SPI receive register. I.e. normally there will first be blinking orange, then blinking red, then blinking orange and then continously red.

Master mode

When SW5, SW4 or SW3 switch is pressed, a text string is sent on the SPI bus. While sending LED1 will be active on the STK1000 board.

Contact Info

For more info about Atmel AVR32 visit Atmel AVR32
AVR32 Application Notes
Support mail: avr32@atmel.com

Generated on Tue Nov 25 11:16:34 2008 for AVR32 AP7 - SPI Driver by  doxygen 1.5.6