SAMV71 Xplained Ultra Software Package 1.4

TC Capture Waveform Example

Purpose

This example indicates how to use TC in capture mode to measure the pulse frequency and count the total pulse number of an external signal injected on TIOA pin.

Requirements

This package can be used with SAM V71 Xplained Ultra board. It generates a waveform from one channel TIOAx , and it capture wave from another channel TIOAy. To measure the waveform on TIOAx, you shall connect TIOAx to TIOAy, configure TIOAx as output pin and TIOAy as input pin.

Descriptions

This example shows how to configure TC in waveform and capture mode. In capture mode, pulse signal is set as an input, RA and RB will be loaded when programmed event occurs. When TC interrupt happens, we could read RA and RB value for calculating pulse frequency and pulse number be increased. The current pulse frequency and total pulse number is output on DBGU.

The code can be roughly broken down as follows:

Usage

  1. Connect Pin07 with Pin16 on EXT1 on the board.
  2. Connect the DBGU port of the evaluation board to the computer.
  3. Open and configure a terminal application on PC (e.g. HyperTerminal on Microsoft Windows) with these settings:
    • 115200 baud rate
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control

Build the program and download it inside the SAM V71 Xplained Ultra board. Please refer to the Getting Started with SAM V71 Microcontrollers.pdf

  1. Upon startup, the application will output the following line on the DBGU:
         -- TC Capture Waveform Example  xxx --
         -- SAMxxxxx-xx
         -- Compiled: xxx xx xxxx xx:xx:xx --
    
  2. Choose the item in the following menu to test.
         Menu :
         ------
           Output waveform property:
           0: Set Frequency =  400 Hz, Duty Cycle = 30%
           1: Set Frequency =  500 Hz, Duty Cycle = 50%
           2: Set Frequency =  800 Hz, Duty Cycle = 75%
           3: Set Frequency =  1000 Hz, Duty Cycle = 80%
           4: Set Frequency =  4000 Hz, Duty Cycle = 55%
           -------------------------------------------
           c: Capture waveform from TC capture channel 
           s: Stop capture and display informations what have been captured
           h: Display menu
         ------
    

References

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines