Specifications
Chapter 3 – Input/Output Interfaces
82 PL 3120/PL 3150/PL 3170 Power Line Smart Transceiver Data Boo
k
Timer/Counter Input Objects
The PL Smart Transceivers have two 16-bit timer/counters. For the first timer/counter, IO0 is used as the output, and a
multiplexer selects one of pins IO4 – IO7 as the input. The second timer/counter uses IO1 as the output and IO4 as the
input (see Figure 2.7). Multiple timer/counter input objects can be declared on different pins within a single application.
By calling the io_select() function, the application can use the first timer/counter in up to four different input
functions. If a timer/counter is configured in one of the output functions, or as a quadrature input, then it can not
be reassigned to another timer/counter object in the same application program.
The timing numbers shown in this section are valid for both an explicit I/O call or an implicit I/O call through a when
clause, and are assumed to be for a PL Smart Transceiver running at 10MHz.
Input timer/counter objects have the advantage (over non-timer/counter objects) in that input events will be captured
even if the application processor is occupied doing something else when the event occurs. A true when statement
condition for an event being measured by a timer/counter is the completion of the measurement and a value being
returned to an event register. If the processor is delayed due to software processing and cannot read the register
before another event occurs, then the value in the register will reflect the status of the last event. The
timer/counters are automatically reset upon completion of a measurement. The first measured value of a
timer/counter is always discarded to eliminate the possibility of a bad measurement after the chip comes out of a
reset condition. Single events can not be measured with the timer/counters. Figure 3.40 shows an example of how
the timer/counter objects are processed with a Neuron C when statement.
Example of a
when statement
missing a present
event but evalu-
ating a previous
event
TIME
INPUT
SIGNAL
Example of a
when statement
evaluating true
(unless it is the
first event)
STOP TIMER/COUNTER
SET FLAG LOAD NEW VALUE
INTO REGISTER
START
TIMER/
COUNTER
READ TIMER/COUNTER FLAG AND REG-
ISTER FROM THE PREVIOUS EVENT
END OF
io_in()
START OF
io_in()
STOP
TIMER/COUNTER
SET FLAG
LOAD EVENT
REGISTER
START
TIMER/
COUNTER
TIME
INPUT
SIGNAL
(event)
READ
TIMER/
COUNTER
FLAG AND
REGISTER
CLEAR FLAG
END OF
io_in()
START OF
io_in()
when
statement)
(
t
fin
t
ret
t
fin
t
ret
Figure 3.40 Example of when Statement Processing Using the Ontime Input Function










