User manual

© 2011 Microchip Technology Inc. DS70656A-page 23
plm_xmit()
This function transmits a buffer and is a zero copy operation, meaning the pointer
passed is used to access payload bytes directly when needed. The operation is double
buffered, meaning the transmission of a previous buffer may already be in progress. In
all cases, the buffer passed is added to a single-entry wait queue and a TX_buffer_full
(PLM_TX_BF) flag is set. As soon as transmission becomes possible, the pointer is
copied to a working register and the TX_buffer_full flag is cleared. The application must
not write to the buffer that was passed until the modem code has finished sending. It is
possible to determine whether the buffer is still in use by examining the PLM_TX_BF
and PLM_TX_ACTIVE status flags. This function must not be called unless the
PLM_TX_BF flag is clear.
plm_recv()
This function fetches a received buffer. The two parameters passed are the address
and the size of a new buffer to fill in. The function returns an address within a previously
passed buffer, pointing to the first free location in that buffer. If the address returned is
equal to the previously passed buffer start address, no data has been received
between the calls. If the address returned points outside the buffer (at previous
buf+size), the buffer has been fully filled and could possibly overflow, if it was allowed.
A NULL pointer is returned on the very first call.
plm_get_status()
This function returns the following modem status flags:
PLM_TX_ACTIVE – transmission is in progress
PLM_TX_BF – transmit buffer is full
PLM_BIT_SYNC – the receiver has found bit synchronization
PLM_BYTE_SYNC – the receiver has found byte synchronization
PLM_RESYNC – resynchronization has been requested
3.1.5 Resource Requirements
Any dsPIC33F DSC device with at least 2 Kbytes RAM, 16 Kbytes of Flash memory,
four Output Compare channels (PWM), one DMA channel, and one 12-bit ADC input
(at least 500 ksps), can be used with the daughter board. Using dsPIC33F DSC
devices without the DMA feature will result in a higher processing power requirement
for the modem software, potentially starving the application of execution time. Also,
using less than four Output Compare channels will result in reduced operational range
and performance.
When called, the modem API functions will claim and start to use the following
processor resources:
One ADC module (default: ADC1)
One ADC input (default: AN8)
One optional DMA channel for the ADC servicing (default: DMA0)
One timer to trigger the ADC conversion:
- Timer3 when ADC1 is selected
- Timer5 when ADC2 is selected
One DMA interrupt vector/ADC and its triggering timer interrupt vector
One to four Output Compare channels. Default:
- OC1 and OC2 when PWM2 modulator is selected
- OC1 through OC4 when PWM4 modulator is selected
Timer2 and its interrupt vector as PWM time base
The GPIO pin selected in the configuration for CS control (default: RF0)