SAM3S8/SD8 Software Package: SPI Dataflash Example

SAM3S8/SD8 Software Package 1.2

# SPI Dataflash Example

## Purpose

The spi_dataflash example will help new users get familiar with SPI interface on sam3s. This example gives you an AT45 Dataflash programming code so that can help develop your own SPI devices applications with maximum efficiency.

## Related

You can find following information depends on your needs:

- A Spi low level driver performs SPI device Initializes, data transfer and receive. It can be used by upper SPI driver such as AT45 dataflash.
- A Dataflash driver is based on top of the corresponding Spi driver. It allow user to do operations with dataflash in a unified way.

## Requirements

This package can be used with sam3s-ek(2) and external Data Flash connected. Please connect the SPI peripheral to external board like following matching pairs:

- SAM3S--DataFlash
- VCC -- VCC
- GND -- GND
- NPCS0(PA11) -- NSS
- MISO(PA12) -- MISO
- MOSI(PA13) -- MOSI
- SPCK(PA14) -- SPCK Because PA11 is multiplexed with ADS7843 (by default) and this example, so please remove R66 on the EK board to make PA11 is dedicated to this example.

## Description

The demonstration program tests the dataflash connected to the evaluation kit by erasing and writing each one of its pages.

## Requirements

1. Build the program and download it inside the evaluation board. Please refer to the SAM-BA User Guide, the GNU-Based Software Development application note or to the IAR EWARM User and reference guides, depending on your chosen solution.
2. On the computer, open and configure a terminal application (e.g. HyperTerminal on Microsoft Windows) with these settings:
   - 115200 bauds
   - 8 bits of data
   - No parity
   - 1 stop bit
   - No flow control
3. Start the application.
4. Upon startup, the application will output the following lines on the terminal.

           -- SPI Dataflash Example xxx --
           -- xxxxxx-xx
           -- Compiled: xxx xx xxxx xx:xx:xx --
           -I- Initializing the SPI and AT45 drivers
           -I- At45 enabled
           -I- Waiting for a dataflash to be connected ...

5. As soon as a dataflash is connected, the tests will start. Eventually, the test result (pass or fail) will be output to the hyperterminal.

## References

- spi_dataflash/main.c
- spi_pdc.c
- spi_at45.c
- at45d.c

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines