User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 248
UG585 (v1.11) September 27, 2016
Chapter 8: Timers
2. Set overflow handling, select external pulse level, enable the event timer (Event Control Timer
register). This step starts measuring the width of the selected level (High or Low) of the external
pulse.
3. Enable interrupt (Interrupt Enable register). This step is optional, if interrupt is to be enabled.
4. Read the measured width (Event register). Note that the returned value is not correct when
overflow happened. See the description for the E_Ov bit of the Event Control Timer register in
section 8.5.3 Functional Description.
Interrupt Clear and Acknowledge Sequence
1. Read Interrupt register: All bits in the Interrupt register are cleared on read.
8.5.6 Clock Input Option for Counter/Timer
The following shows how AP SoC selects the clock source for TTC0 counter/timer 0:
if slcr.MIO_PIN_19[6:0] is 1100000, use MIO pin 19
else if slcr.MIO_PIN_31[6:0] is 1100000, use MIO pin 31
else if slcr.MIO_PIN_43[6:0] is 1100000, use MIO pin 43
else use EMIOTTC0CLKI0
TTC0 counter/timer 1 can use only EMIOTTC0CLKI1.
TTC0 counter/timer 2 can use only EMIOTTC0CLKI2.
The following shows how Zynq SoC selects the clock source for TTC1 counter/timer 0:
if slcr.MIO_PIN_17[6:0] is 1100000, use MIO pin 17
else if slcr.MIO_PIN_29[6:0] is 1100000, use MIO pin 29
else if slcr.MIO_PIN_41[6:0] is 1100000, use MIO pin 41
else use EMIOTTC1CLKI0
TTC1 counter/timer 1 can use only EMIOTTC1CLKI1.
TTC1 counter/timer 2 can use only EMIOTTC1CLKI2.
IMPORTANT: When an MIO pin or EMIOTTCxCLKIx is chosen to be the clock source, if the clock stops
running, the corresponding Count Value register retains the old value, regardless of the fact that the
clock has already stopped. Caution must be exercised in this case.