Ir Signal Generation And Learning; Introduction; Modulated Codes; Frequency Error Calculation For 38-Khz Carrier - Texas Instruments CC253x User Manual

System-on-chip for 2.4ghz
Table of Contents

Advertisement

www.ti.com
9.9

IR Signal Generation and Learning

This section describes how Timer 1 can be configured in IR generation mode, where it counts Timer 3
periods and the output is ANDed with the output of Timer 3 to generate modulated consumer IR signals
with minimal CPU interaction.

9.9.1 Introduction

Generation of IR signals for remote control is generally done in one of two ways:

Modulated codes

Non-modulated codes (C-codes, flash codes)
The device includes flexible timer functionality to implement generation and learning of both types of IR
signals with minimal CPU interaction. Most IR protocols can be implemented with only one CPU
intervention per command.
9.9.2 Modulated Codes
Modulated codes can be generated using Timer 1 (16-bit) and Timer 3 (8-bit). Timer 3 in modulo mode is
used to generate the carrier. Timer 3 has an individual prescaler for its input. Its period is set using
T3CC0. Timer 3 channel 1 is used for PWM output. The duty cycle of the carrier is set using T3CC1.
Channel 1 uses compare mode: Clear output on compare, set on 0x00 (T3CCTL1.CMP = 100).
shows the frequency error calculation for a 38-kHz carrier using Timer 3.
The IRCTL.IRGEN register bit enables IR generation mode in Timer 1. When the IRGEN bit is set,
Timer 1 takes the output of the Timer 3 channel 1 compare signal as tick instead of the system tick. The
Timer 1 period is set using T1CC0 with Timer 1 in modulo mode (T1CTL.MODE = 10) and channel 0 in
compare mode (T1CCTL0.MODE = 1). Channel 1 compare mode Clear output on compare, set on 0x0000
(T1CCTL1.CMP = 100) is used for output of the gating signal.
The number of mark carrier periods is set by T1CC1. T1CC1 must be updated every Timer 1 period by the
DMA or CPU. Note that an update to T1CC1 is buffered and does not take effect before Timer 1 reaches
0x0000.
The number of space carrier periods is set by T1CC0. Its value should be set to the total number of mark
and space carrier periods wanted. The compare values are buffered until the timer hits 0x0000.
The output of Timer 1 channel 1 is ANDed with that of Timer 3 channel 1 to form the IR output as shown
in
Figure 9-7
SWRU191F – April 2009 – Revised April 2014
Submit Documentation Feedback
Table 9-2. Frequency Error Calculation for 38-kHz
Description
System clock frequency
IR carrier frequency
System clock period
IR carrier period
Timer prescaler
Timer period
Ideal timer value
True timer value
True timer period
True timer frequency
Period error
Frequency error
Frequency error %
Copyright © 2009–2014, Texas Instruments Incorporated
Carrier
Value
32,000 kHz
38 kHz
0.00003125 ms
0.026315789 ms
4
0.000125 ms
210.5263158
211
0.026375 ms
37.91469194 kHz
59.21052632 ns
85.30805687 Hz
0.2245%
IR Signal Generation and Learning
Table 9-2
Timer 1 (16-Bit Timer)
111

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents