![Texas Instruments CC2533 Скачать руководство пользователя страница 117](http://html.mh-extra.com/html/texas-instruments/cc2533/cc2533_user-manual_1094592117.webp)
PIN
Diode
IR
Demod
CC253x
CC2540
CC2541
Timer 1 Ch 2
Timer 3 Ch 1
B0359-01
Timer 1 Interrupts
9.9.4 Learning
Learning is done by using the capture function of Timer 1 (16-bit) and Timer 3 (8-bit). Timer 3 can handle
the carrier frequency detection and Timer 1 can handle the code learning from the demodulated signal.
The circuit could be set up as described in
Figure 9-9. IR Learning Board Diagram
9.9.4.1
Carrier Frequency Detection
Timer 3 is used to capture and detect the carrier frequency with input directly from the IR PIN diode. The
timer should sample the carrier a limited number of times. If a carrier is detected, the frequency detected
should contribute to the average number, which is what can be stored in the database.
9.9.4.2
Demodulated Code Learning
The output from the IR PIN diode is demodulated by an appropriate circuit. The output from this circuit is
used as input to one of the Timer 1 channels in capture mode.
9.9.5 Other Considerations
The IR output pin should be placed in the high-impedance state or pulled down during reset to avoid
unnecessary power consumption from illuminating the IR LED. Note that only the P1.1 output for Timer 1
channel 1 is placed in the high-impedance state with no pullup during and after reset.
9.10 Timer 1 Interrupts
One interrupt vector is assigned to the timer. An interrupt request is generated when one of the following
timer events occurs:
•
Counter reaches terminal count value (overflow, or turns around zero).
•
Input capture event
•
Output compare event
The status register,
T1STAT
, contains the source interrupt flags for the terminal-count value event and the
five channel compare/capture events. A source interrupt flag is set when the corresponding event occurs,
regardless of interrupt mask bits. The CPU interrupt flag
IRCON.T1IF
is set when one of the events
occurs if the corresponding interrupt mask bit is equal to 1. The interrupt mask bits are
T1CCTLn.IM
for
the five channels and
TIMIF.OVFIM
for the overflow event. The CPU interrupt flag
IRCON.T1IF
is also
set when a Timer 1 source interrupt flag is being cleared and one or more other Timer 1 source interrupt
flags are still set while the corresponding interrupt mask bit is set. An interrupt request is generated when
IRCON.T1IF
goes from 0 to 1 if
IEN1.T1IEN
and
IEN0.EA
are both equal to 1.
9.11 Timer 1 DMA Triggers
There are three DMA triggers associated with Timer 1. These are DMA triggers T1_CH0, T1_CH1, and
T1_CH2, which are generated on timer compare events as follows:
•
T1_CH0
–
Channel 0 compare
•
T1_CH1
–
Channel 1 compare
•
T1_CH2
–
Channel 2 compare
117
SWRU191C
–
April 2009
–
Revised January 2012
Timer 1 (16-Bit Timer)
Copyright
©
2009
–
2012, Texas Instruments Incorporated