
169
7734Q–AVR–02/12
AT90PWM81/161
13.18.2
Event Capture
The PSCR can capture the value of time (PSCR counter) when a retrigger event or fault event
occurs on PSCR inputs. This value can be read by software in PICRrH/L register.
13.18.3
Using the Input Capture Unit
The main challenge when using the Input Capture unit is to assign enough processor capacity
for handling the incoming events. The time between two events is critical. If the processor has
not read the captured value in the PICR1 Register before the next event occurs, the PICR1 will
be overwritten with a new value. In this case the result of the capture will be incorrect.
When using the Input Capture interrupt, the PICR1 Register should be read as early in the inter-
rupt handler routine as possible. Even though the Input Capture interrupt has relatively high
priority, the maximum interrupt response time is dependent on the maximum number of clock
cycles it takes to handle any of the other interrupt requests.
13.19 Analog Synchronization
PSCR generates a signal to synchronize the sample and hold; synchronization is mandatory for
measurements.
This signal can be selected between all falling or rising edge of PSCr0 or PSCr1 outputs.
13.20 Interrupt Handling
List of interrupt sources:
Counter reload (end of On Time 1)
PSCR Input event (active edge or at the beginning of level configured event)
13.21 PSC Clock Sources
PSCR must be able to generate high frequency with enhanced resolution.
The PSCR has two clock inputs:
CLK PLL from the PLL
CLK I/O
10
Do not use
11
12
13
14
Valid
15
Do not use
Table 13-6.
Available input modes according to running modes. (Continued)
Input mode number:
1 Ramp mode
2 Ramp mode
4 Ramp mode