Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PIO Alternate Function Example
\par Purpose

The PIO Alternate Function demonstrates how to alternate ERASE pin between system
I/O mode and PIO mode.

\par Requirements

This package can be used with SAM EKs.

\par Description

The application shows the alternate function of ERASE pin, which extends PIO
from a dedicated system I/O line. It first programs the internal flash with
a walking pattern and then enables ERASE pin in PIO mode. After the erase
operation, it checks the content of flash, which is unchanged due to ERASE in
PIO mode. In the next step, it puts ERASE pin in system I/O mode, which will
enable the erase function. The content of flash should be erased to 0xFF, which
indicates the ERASE pin functioning.

The pins which are used by USB(DDM,DDP), JTAG(TCK,TMS,TDO,TDI) and Oscillator(XIN,
XOUT,XIN32,XOUT32) could also be alternated between general purpose I/O and system
I/O in the similar way.

\par Usage

-# Build the program and download it into the evaluation board.
-# 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
-# Start application.
-# In the terminal window, the
   following text should appear (values depend on the board and the chip used):
-- PIO Alternate Function Example --
-- xxxxxx-xx --
-- Compiled: xxx xx xxxx xx:xx:xx --
  1. Perform erase operation following the application prompt.