Microchip® Advanced Software Framework

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

This example demonstrates how to use PIO Parallel Capture function of
the PIO Controller.

\par Requirements

This package can only be used with SAM3/4 MCU featuring PIO Parallel 
Capture function.

\par Description

The PIO Controller integrates an interface that is able to read data from
a CMOS digital image sensor, a high-speed parallel ADC, a DSP synchronous
port in synchronous mode, etc.

The application is composed of 2 softwares:
- one for using the PIO to simulate a sensor in send mode.
- one for using the PIO Parallel Capture in receive mode.

Two boards are required to use. Connect one to the other, and at first put
one board in send mode(to avoid unexpected signal to slave) and then
the second in receive mode.
Different choices can be selected to use the data enable pins or not, and
to sample all the data or only one out of two.
Pins to be connected between the 2 boards:<br />
  PA15 - PA15<br />
  PA16 - PA16<br />
  PA23 - PA23<br />
  PA24 - PC0<br />
  PA25 - PC1 <br />
  PA26 - PC2<br />
  PA27 - PC3<br />
  PA28 - PC4<br />
  PA29 - PC5<br />
  PA30 - PC6<br />
  PA31 - PC7<br />
  And, of course: GND<br />

\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
-# Connect the first board to the second board.
-# Start the application of the first board.
-# Put the software in send mode.
-# In the terminal window, the
   following text should appear (values depend on the board and the chip used):
-- PIO Parallel Capture example --
-- xxxx-xx --
-- Compiled: xxx xx xxxx xx:xx:xx --
Frequency: xxx MHz.
Press r to Receive data on PPIO Parallel Capture.
Press s to Send data on PIO Parallel Capture.
** SEND mode **
This is for debug purpose only !
Frequency of PIO controller clock must be strictly superior to 2 times
the frequency of the clock of the device which generates the parallel data.
Please, connect the second board, and put it in receive mode.
Press y to indicate that receiver samples all data.
Press n to indicate that receiver samples data with an even index.
Receiver samples all data, or Receiver samples data with an even index.
Press y to send data without enabling the data enable pins.
Press n to send data with data enable pins enabled.
Send data without enabling the data enable pins, or Send data with both data enable pins enabled.
Send data without enabling the data enable pins.
Press a key
or
Send data with both data enable pins enabled.
Press a key
  1. Start the application of the second board.
  2. Put the software in receive mode.
  3. In the terminal window, the following text should appear (values depend on the board and the chip used):
    -- PIO Parallel Capture example --
    -- xxxxxx-xx --
    -- Compiled: xxx xx xxxx xx:xx:xx --
    Frequency: xxx MHz
    Press r to Receive data on PIO Parallel Capture.
    Press s to Send data on PIO Parallel Capture.
    ** RECEIVE mode **
    Press y to sample the data when both data enable pins are enabled.
    Press n to sample the data, don't care the status of the data enable pins.
    Receive data, don't care the status of the data enable pins, or Receive data when both data enable pins are enabled.
    Press y to sample all the data.
    Press n to sample the data only one out of two.
    Only one out of two data is sampled, with an even index, or All data are sampled.
    Waiting...