Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Table of Contents

Introduction


This page gives an overview of ttcps driver which is available as part of the Xilinx Vivado and SDK distributionSource path for the driver:

Driver Sources

The source code for the driver is included with the Vitis Unified Software Platform installation, as well as being available in the Xilinx Github repository. 


Driver Name

Path in Vitis

Path in Github

ttcps

<Vitis Install Directory>/data/embedded/XilinxProcessorIPLib/drivers/ospipsv

https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/ttcps



Info

Note: To view the sources for a particular release, use the rel-version tag in github.  For example, for the 2020.1 release, the proper version of the code is: https://github.com/Xilinx/embeddedsw/tree/

masterDriver


The driver source code is organized into different folders.

Below diagram

  The table below shows the ttcps driver source organization

ttcps


Directory
Description
|

doc

-- Doc - - Examples - Reference application to

Provides the API and data structure details

|

data

Driver .tcl and .mdd file

examples

Example applications that show how to use the driver

APIs and calling sequence
|
- Source -

features

src

Driver source files

Features Supported

Controller/Driver features supported

Driver Implementation

For a full list of features supported by this IP, please refer Zynq/ZynqMP/Versal TRM.

Features Supported

  • Three independent 32-bit timer/counters for ZynqMP/Versal and 16-bit timer/counter for Zynq
  • Clock can be selected from:
    • Internal PS bus clock (CPU_1x)
    • Internal clock (from PL)
    • External clock (from MIO)
  • 16-bit pre-scalar for clock
  • Three interrupts, one for each counter
  • Support both increment and decrement counting
  • Interrupt on overflow, at regular interval, or counter matching programmable values
  • Ability to generate waveform output (e.g. PWM) through the MIO
  • Support waveform output to the PL

Known issues and Limitations
  • None

Test cases

TTC interrupt example

Example Applications

Refer to the driver examples directory for various example applications that exercise the different features of the driver. Each application is linked in the table below. The following sections describe the usage and expected output of the various applications.  These example applications can be imported into the Vitis IDE from the Board Support Package  settings tab. 

Links to Examples

Examples Path:

https://github.com/Xilinx/embeddedsw/

blob

tree/master/XilinxProcessorIPLib/drivers/ttcps

/examples/


Test Name

Example Source

Description
TTC interrupt examples

xttcps_intr_example.c

xttcps_tapp_example.c

xttcps_rtc_example.c

These examples demonstrates TTC interval mode and match mode functionality with interrupts.
TTC low level example

xttcps_low_level_example.c

This examples uses TTC timer/counter to generate square wave  output on waveform output pin. It works on polling mode.

Example Application Usage

TTC interrupt example

This example uses

two

2 timer counters

in the Triple Timer Counter (TTC) module in the Ps block in

, one in interval mode and other in match  mode. It uses interrupt mode.

Output
Expected output
Code Block
themeMidnight
TTC Interrupt Example Test
Successfully ran TTC Interrupt Example Test

TTC rtc example:

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/ttcps/examples/xttcps_rtc_example.c


This example uses one timer/counter to make a real time clock. The number of seconds elapsed are displayed on
the console till 121 seconds are elapsed.Output


Expected output
Code Block
themeMidnight
Starting Timer RTC Example
Successfully ran ttcps rtc Example

TTC

low level example:https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/ttcps/examples/xttcps_

low

_

level

_

example

.c


This example uses triple timer counter in polled match mode to generate square wave output on waveform out pin.Output


Expected output
Code Block
themeMidnight
TTC Lowlevel Interrupt Example Test
Successfully ran Lowlevel TTC Interrupt Example Test

TTC

tapp example:https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/ttcps/examples/xttcps_

tapp

_

example

.c


This example uses triple timer counter to generate interrupt and update a flag which is checked in the interrupt example to confirm whether the interrupt is generated or not.

OutputExpected output
Code Block
themeMidnight
Starting Timer interrupt Example
Successfully ran ttcps tapp Example

Changelog

2021.1

2020.2

  • Updated makefile for parallel make execution and incremental build support.

2020.1

  • Fixed the warnings reported by ARMCC compiler

2019.2

  • Added interrupt handler in driver. Updated examples to use driver's  interrupt handler.

2019.1

  • Fixed bug in XTtcPs_ClearInterruptStatus function

2018.3

  • Fixed bug in XTtcPs_CalcIntervalFromFreq API to use  correct maximum interval count (32 bit) for ZynqMP .

2017.3

  • Updated ttcps.tcl to append 'U' to all constant definitions exported from the ttcps driver to the xparameters.h

2017.2

  • No changes for 2017.2

2017.1

  • Updated the ttcps.tcl script to generate the canonical names and constant defines in xparameters.h, based on the ttcps instance number.
  • Updated ttcps_tapp.tcl to check whether ttc device is interrupting current processor or not.If device is not interrupting the current processor then,do not include ttc driver instance and interrupt example source/header files to peripheral test application.
  • Updated gen_testfunc_call proc in ttcps_tapp.tcl script, to fix bug in the instance number calculation

2016.4

  • Modified XTtcPs_GetCounterValue,XTtcPs_GetInterval and XTtcPs_CalcIntervalFromFreq functions to use 32 bit counter/interval values for Zynq Ultrascale+ MPSoC

2016.3

  • No changes for 2016.3

Related Links