![]() ![]() |
||||
|
||||
[Design Application] CTCSS Unclutters Receiver Sound Short-range-radio co-existence is now possible using CTCSS carrier generation with a 256-B sine-wave lookup table. Jeff Dahlin February 2004
To allow multiple users to share one carrier frequency, many handheld transceivers employ Continuous Tone Coded Squelch System (CTCSS) encoders and decoders. CTCSS systems add a tone at the low end of what the human ear can hear to a transmitted signal. On the receiving end, a CTCSS decoder allows you to choose which signals are heard in your radio's speaker after the tone is removed. Many signals may appear on the same frequency, but you'll only hear the one that is encoded with a pre-selected tone. All other signals are suppressed or squelched. With this approach, multiple short-range radios can coexist on the same carrier frequency in the same area without users having to listen to everyone else's conversations. Motorola developed the original tone-control system, called "Private Line" or PL for short. To this day, the tone frequencies established by Private Line remain the CTCSS standards (Table 1). CTCSS also works with longer range radios, making it possible for different groups to use the same frequencies without bothering each other. This application is seen most often in repeater networks. Additionally, CTCSS systems can act as electronic gate keepers, enabling system operators to restrict access to remote repeaters. This article demonstrates how to implement a CTCSS carrier generator using a 256-B sine-wave lookup table (LUT). The basic routine for generating the sine wave is not application specific. It can be used to generate other waveforms and frequencies as well. The example project is based on Cypress MicroSystems' PSoC mixed-signal array, which includes an 8-b microcontroller. The CTCSS application does not use all of the PSoC's configurable mixed-signal array. In addition, it can be combined with other functions to implement a more complex design. Before delving into the implementation, however, it's important to understand the different aspects of CTCSS. An example is its carrier frequencies. CTCSS uses 38 different frequencies between 67.0 and 250.3 Hz as the selection tones. Table 1 shows the frequency associated with each of those tones. Some radios use additional "non-standard" frequencies for CTCSS functionality. Here, the application focuses on the standard CTCSS frequencies. Frequency generation also must be considered. In this project, the CTCSS frequencies are generated by transferring data from a 256-entry, 8-b LUT into a DAC6 User Module (a 6-b DAC) at a fixed rate. A User Module is a pre-configured and characterized set of PSoC resources and application-programming-interface (API) functions. It creates a virtual peripheral, which a designer can use to customize the PSoC's configuration. The DAC is updated at a constant rate in an Interrupt Service Routine (ISR), which is controlled by a Timer8 User Module (an 8-b timer). To adjust the frequency of the CTCSS tone, just vary the step size through the LUT. The 256-B LUT contains data that represents one cycle of a sine wave. This data is stored in sign and magnitude format. Sign and magnitude is the native format of the DAC data register. It allows the write to the DAC to be done more efficiently than with other formats. In this example project, the Timer8 is set to approximately 10 kHz. The frequency of the CTCSS waveform is determined by the step size of an index through the LUT. For example, with a 10-kHz update rate and a step size of 1, the resulting sine wave would have a frequency of about 39 Hz (10,000/256). If a step size of 2 were used, the resulting sine wave would have about 78 Hztwice the frequency. The 256-B LUT is stored in ROM. It is accessed using the MCU's INDEX instruction. That instruction uses a base address, which is hardcoded as the instruction's operand. It also utilizes an index that is the value in the Accumulator at the start of the command. When the INDEX instruction is executed, the table entry that's pointed to by the sum of the base address and the index is loaded into the Accumulator. The LUT's 8-b index comes from the upper byte of a 16-b index (iCTCSSFreqIndex). That upper byte can be thought of as the integer portion of the index. Think of the lower byte as the index's fractional portion. To step through the LUT, a 16-b index increment (iCTCSSFreqInc) is added to the 16-b accumulated index. That index increment also has integer and fractional portions. As a result, non-integer increments can be used to step through the LUT. This approach creates a more accurate frequency compared to what can be achieved with an integer increment. In the previous example, where a step size of 2 resulted in an output frequency of 78 Hz from a 10-kHz update rate, the index increment would be 0x0200. To get an output frequency of 67 Hz (CTCSS tone 1), a step size of 1.72 is needed. The index increment in this case would be 0x01b5 (1 + 184/256). Frequency selection also is a vital aspect of CTCSS. In this project, a function is provided that sets the index increment value for the desired frequency. This function, SetCTCSSFreq(), is passed a 1-B argument that is the CTCSS tone number. That tone number is manipulated (subtract 1 and multiply by 2) to convert it into an index for a 38-entry, 16-b LUT. The LUT contains index increment values. Phase coherence may sometimes become an issue for waveform generation. In this application, when the output frequency is changed, the accumulated index variable is not cleared. This approach has a beneficial side effect. The sine wave then exhibits no discontinuity when the frequency changes. Although this isn't critical for CTCSS generation, it may be required in other waveform applications. |
|||||||||||||||
|
|
|||||||||||||||
|
[Reader Comments] CTCSS Unclutters Receiver Sound |
|
|
|
|
|
Electronic Design Europe Electronic Design China EEPN Microwaves & RF Schematics ![]() Electronic Design Military Electronics Featured Vendors EE Events Free Design Resources |
|
|
Planet EE Network Home |
Contact Us |
Editorial Calendar |
Media Kit |
Headlines |
Site Feedback & Bugs Copyright © 2008 Penton Media, Inc., All rights reserved. Legal | Privacy |