Getting Started With Capture Compare Unit - Ccu4 - Infineon Technologies XMC4000 User Manual

Capture compare unit, ccu4, ccu basics
Hide thumbs Also See for XMC4000:
Table of Contents

Advertisement

Confidential
8

Getting Started with Capture Compare Unit - CCU4

8.1
How to Start Timer CC4y (y=0-3)
In the following examples it is assumed that the CAPCOM4 Ultimate Initialization Sequence start is done before.
8.1.1
Example 1: Start Timer by SW (by Instruction)
CC40TCSET |= 0x00000001; // Start Timer CC40 directly by setting the TRBS bit = 1
8.2
Example 2: Start Timer by HW (by External Event)
8.2.1
External Events Control Setup Registers
The Input Selection register CC4yINS maps External-Event-Sources and Edge/Level Mode conditions to the
Event[2:0] Input Lines. In turn the Connection Matrix Control register CC4yCMC maps the three Event[2:0] Input
Lines to any of the 11 Input Functions. The Timer Control register CC4yTC enables different Mode Alternatives.
8.2.2
Using the External Start Control Register Bitfields
10. CC4yCMC.STRTS
11. CC4yINS.<Event-x bitfields> Event Source EVxIS (CC4yINS[P:A]), Event Mode EVxEM or EVxLM bitfields
12. CC4yTC.<bitfields>
Note: When using the index 'x' in event nomenclature, it should be understood as 'Actual Event[2:0] Number '.
Note: When using the index 'x' in CCU4x nomenclature, it should be understood as 'Actual CCU4 Unit Number'.
Note: The Ultimate Event
Note: If External Events Control of Up/Down Counting is used – then the counting scheme is always edge
aligned and the Timer Counting Mode bit (TCM) is read-only!
// Example 2:
// Assume a falling edge transition on GPIO Pin P1.3 as a "considered" external
// event control signal to start Timer CC40 in CAPCOM Unit CCU40.
// Define this event as "Event2". (The alternatives Event0..1 would do as well!):
CC40CMC |= 0x00000003; // Start of Timer CC40 indirectly by External Event 2.
// Setup Timer CC40 External Event Control Input Selection register (CC40INS)
// to activate GPIO Pin P1.3 as selected source for Event 2 in the bitfield EV2S:
EV2S = 0; // where "0" is the input number (from 0-15) for the input "CCU40IN0[A]"
// and represents Pin P1.3 according to the Top-level Connection Matrix.
EV2EM = 2; // set signal active on falling edge on Event 2, as "considered".
// See reference: Table 26-10 Pin Definition and I/O Functions
//
8.2.3
Example 3: Start Timers Synchronized (by Global Command)
// Start on Negative Edge on Port Pin P1.3 for CCU40IN0[A]
// See reference: Table 26-10 Pin Definition and I/O Functions
Input function Selection and Event Number (x=0-2) Input Line Selection bitfield
Timer Mode selections e.g. Modes/Extended modes, Counting Schemes etc
Number 'x' for the STRTS Input Function is x == <STRTS>-1 (when <STRTS> != 0).
Capture Compare Unit - CCU4
Getting Started with Capture Compare Unit - CCU4
Device Guide XMC4500

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xmc4500 family

Table of Contents