SPRAC94D September 2018 – March 2022 AFE030 , AFE031 , TMS320F28075 , TMS320F28075-Q1 , TMS320F28076 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
The FSK signals being received follow a set of communication parameters that must be designed around within software.
The communication parameters of interest are illustrated in Figure 5-4. The labeled parameters represent the following:
For the example program the communication parameters being followed by default are stated in Table 4-1. Create a FSK_CORR_DETECTOR structure, declared in fsk_corr_detector.h, to hold the parameters necessary for accurate receiving.
volatile FSK_CORR_DETECTOR FSK_struct1; // FSK structure
The example software and fsk_corr_detect library are designed to detect a set of user specified frequencies, one mark frequency and one space frequency. These frequencies will have to be within the frequency band ranges of the AFE031's CENELEC A or CENELEC B,C,D configurations. The example program utilizes a mark frequency of 131.25 kHz and a space frequency of 143.75 kHz and is meant to be used with the CENELEC B,C,D configuration. Set the mark_freq and space_freq members of the FSK_CORR_DETECTOR structure with these frequencies.
FSK_struct1.mark_freq = 131250; // Mark Frequency Detected
FSK_struct1.space_freq = 143750; // Space Frequency Detected
The C2000's ADC is used to sample the FSK input signal. The sampling frequency, FS, must follow the Nyquist theorem; the input signal must be sampled at a rate of at least 2x the highest signal frequency trying to be detected. That is, if the highest signal frequency to be detected is 100 kHz, FS must be at least 200 kHz. In the example program the highest frequency being detected is a 143.75 kHz space frequency and the sampling rate is set to 300 kHz, which is more than the required rate. Set the isr_freq member of the FSK_CORR_DETECTOR structure to the acceptable FS.
FSK_struct1.isr_freq = 300000; // ADC Sampling frequency
A bit decision algorithm is intended to be run at three times the bit frequency. For example, if each bit period is 1 ms long, the bit frequency is 1 kHz making the desired bit decision frequency 3 kHz. The example program is detecting bits with a period of 5.12 ms making the bit frequency 195.3125 Hz and the desired bit decision frequency 585.9375 Hz. The bit decision frequency in software should be as close as possible to the desired frequency to prevent bit boundary issues. Set the bit_freq member of the FSK_CORR_DETECTOR structure with this bit decision frequency.
FSK_struct1.bit_freq = 586; // Bit decision frequency, 3x bit frequency
In summary, the frequency parameters set for the example program are shown in Table 5-4.
Parameter | Frequency |
---|---|
Detected Mark Frequency | 131.25 kHz |
Detected Space Frequency | 143.75 kHz |
Input Signal Sampling Frequency | 300 kHz |
Bit Decision Algorithm Frequency | 586 Hz (rounded up) |
Set the detection_threshold member of the FSK_CORR_DETECTOR structure. This value plays a role in tuning the bit detection senstivity.
#define FSK_BIT_DETECTION_THRESHOLD 0.1 // Bit detection threshold value
FSK_struct1.detection_threshold = FSK_BIT_DETECTION_THRESHOLD; // Set threshold
Complete the fsk_corr_detect library's initialization based on the member values inputted by calling the corresponding init function.
FSK_CORR_DETECTOR_INIT(&FSK_struct1); // Initialize FSK structure
Additionally, the format of received information is taken into account by setting the following parameters within software.