User manual
Consumer-band BPSK 7.2 kbps PLM PICtail™ Plus Daughter Board User’s Guide
DS70656A-page 22 © 2011 Microchip Technology Inc.
PLM_MOD_IMP
This setting selects the number of OC channels dedicated for PWM-based signal
generation. Available options are:
• MOD_DDS: Directly calculates sine samples. No real-world output (for
demodulator testing with internal loopback)
• MOD_PWM: Uses single OC channel (not recommended)
• MOD_2PWM: Uses two OC channels
• MOD_4PWM: Uses four OC channels (default)
PLM_SOFT_AGC
This setting enables software automatic gain control. In most cases it should be
enabled. It may be disabled if the hardware gain guarantees that the working signal will
always touch power supply rails. If the input signal is small and the software AGC is
disabled, the Costas loop will not get enough feedback and the digital PLL may fall out
of synchronization.
PLM_COSTAS_FB
This setting allows the selection of a Costas loop feedback filter implementation. The
filter is actually implemented as a regulator. Three options are available:
• direct (equivalent to a P controller)
•PI
•PID
Tests show that the PI implementation brings the best performance. The proportional
term is responsible for the phase synchronization, while the integral term allows
tracking in the event of a constant frequency offset.
3.1.4 API Functions
The modem API allows for very low level access to the modulator and demodulator
code. The application communicates with the modem on a buffer level and the modem
itself does not impose any buffer sizes, frames or protocols. All of these features can
be freely implemented in the higher layers. All low-level API functions are declared in
the header file (
...modem\common\plm.h) and are C-callable. The following functions
are available:
plm_mod_start()
This function starts the modulator and configures the Output Compare channel(s),
starts Timer2 and enables the Timer2 interrupt. It is mandatory to call this function
before any calls to plm_xmit() are made.
plm_demod_start()
This function starts the demodulator and configures the selected ADC channel, starts
the timer that triggers ADC conversions and optionally enables a DMA channel to ser-
vice the selected ADC input. Either DMA or ADC and timer interrupts get enabled. It is
mandatory to call this function before any calls to plm_recv() are made.
plm_demod_sync()
This function forces a demodulator resynchronization and may be called in cases when
the demodulator keeps indicating bit and byte synchronization, but higher protocol lay-
ers decide that the patterns received do not form valid frames, thus suggesting that the
byte synchronization is misaligned.