Home

MCF5407SWRM - Freescale Semiconductor

image

Contents

1. Arguments Table 3 14 V22 scramble bit arguments channel in Pointer to the channel control data structure bit in Bit to scramble Description Scrambles input bits according to the V 22 recommendation d nT d nT XOR d n 14 T XOR d n 17 T Scrambler register is stored in channel Tse control ptr data pump ptr scrambler register Returns Scrambled bit Code example uint8 temp current nbits current nbits struct channel t channel temp current nbits V22 scramble bit channel current nbits MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 25 Freescale Semiconductor Inc Data Pump V22 descramble bit Call s uint8 V22 descramble bit struct channel t channel uint8 bit Arguments Table 3 15 V22 descramble bit arguments channel in Pointer to the channel control data structure bit in Bit to descramble Description Descrambles input bits according to the V 22 recommendation d nT d nT XOR d n 14 T XOR d n 17 T Descrambler register is stored in channel Rx control ptr 2 data pump ptr descrambler register Returns Descrambled bit Code example uint8 temp current nbits current nbits struct channel t channel temp current nbits V22 descramble bit channel current nbits 3 26 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information O
2. The DAA module routines can be found in the s13044 daa cd file The DAA control data structure daa control t is defined in s13044 daa bh CCo ke e e e e ke ke ke ook e e e e ke ke ke o o sk e e e e e ke e o o ke e ee e o e o ke e e e e e e oe e e e e e e e ek States of DAA Rx amp Tx Interface kk ke e e e e oe e oe o o ok ke e e e oe e o o e e e e e o o e ok ke ee EE enum tx daa state t TX DAA NORMAL TX DAA PRE READ REG TX DAA PRE WRITE REG TX DAA READ REG TX DAA WRITE REG enum rx daa state t RX DAA NORMAL RX DAA READ REG RX DAA WRITE REG Feo ke e e e e oe ke ke ke k e e e e e ke ke ke o ke e e e e e ke o e ke e e e e e oe e e e ke e e e e e oe e e e e e e e e ek DAA Interface control Structure ko ke e e e e oe e o o o ok ke e e e ke e o ok e e e e e e e o ko ke e e e e e EE struct daa control t volatile enum tx daa state t tx state volatile enum rx daa state t rx state uint8 reg number volatile uint8 value volatile bool value is true uint8 delay volatile uint32 sample counter ds The daa control t structure parameter descriptions e x state Inner State of the Tx DAA It can be equal to TX DAA NORMAL Normal mode TX DAA PRE READ REG The mode before a Read register cycle TX DAA PRE WRITE REG The mode before a Write register cycle TX DAA READ REG Read register cycle 3 182 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTORO
3. void Rx V22bis change mode struct channel t channel enum v22bis mode t mode Arguments Table 3 32 Rx V22bis change mode arguments channel in Pointer to the channel control data structure mode in Specifies the mode to switch to either 2400 b s or 1200 b s Description Changes the mode of the Rx V22bis Data Pump to 1200 bit s or to 2400 bit s by assigning new values to n bits the number of bits in symbol n bits mask the mask for retrieving n bits from the byte and constellation phase quadrant the constellation points Returns None Code example struct channel t channel Rx V22bis change mode channel V22BIS MODE 1200 MOTOROLA Chapter 3 Module Descriptions 3 51 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 5 FSK The FSK Frequency Shift Keying module is used by the V 21 and V 23 modems This module consists of two blocks a FSK transmitter and receiver In the following subsections the operation of the FSK modem transmitter and receiver are described Binary FSK usually referred to simply as FSK is a modulation scheme used to send digital information between digital equipment The data is transmitted by shifting the frequency of a continuous carrier in a binary manner to one or the other of two discrete frequencies One frequency is designated as the mark frequency and the other as the space frequency The mar
4. Arguments Table 3 123 AT parser init arguments uint32 command code channel in Pointer to the Channel control data structure command code in The variable contains number and parameters of the current AT com mand Description Returns Code example This function stores the interpreted AT command and its parameters in the local at command buff buffer After processing all of the AT Command string and if no error has occurred the contents of at command buf buffer will be placed into the command buffer Zero struct channel t channel uint32 command code command buf write channel at parser control command code MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 239 Freescale Semiconductor Inc Miscellaneous Functions 3 8 3 Command Handler The Command Handler is a top level entity that is invoked by the scheduler to interpret AT commands and execute them It reads formatted commands from the command circular buffer that are written into it by the Command Parser The Command Handler implements the AT commands and controls the state of the Soft Modem It also passes the command responses and status messages to the DTE See section 3 7 2 Figure 3 50 Command Handler The Command Handler routines and definitions can be found in the at_handler h and at_handler c files 3 240
5. Figure 2 3 Global State Machine Chapter 2 General Architecture Go to www freescale com 2 21 For More Information On This Product Freescale Semiconductor Inc Global State Machine state machine init Call s void state machine init struct channel t channel struct state machine t sm Arguments Table 2 2 state machine init arguments channel in Pointer to the Channel control data structure sm in Pointer to the State Machine control data structure Description This function initializes the State Machine control data structure It must be called before calling the state machine function This function is called once in main Returns None Code example struct channel t channel struct state machine t sm state machine init amp channel amp sm 2 22 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Global State Machine state machine Call s void state machine struct channel t channel Arguments Table 2 3 state machine arguments channel in Pointer to the Channel control data structure Description This function implements the Global State Machine of the Soft Modem The description of each state is in Table 2 5 This function is called in main Returns None Code example struct channel t channel str
6. void DPSK demodulator struct channel t channel Arguments Table 3 40 DPSK demodulator arguments channel in Pointer to the channel control data structure Description This function performs all the operations of the DPSK receiver It gets samples from the Rx sample buffer processes them and places the resultant bits into the Rx data buffer It contains the input bandpass filters the automatic gain control AGC the demodulator the decision block the decoder the descrambler the carrier recovery and the clock recovery For more detailed information about these blocks refer to Section 3 1 6 3 This function is called by the Kr data pump function via channel Rx control ptr data pump call func Returns None Code example struct channel t channel DPSK demodulator channel MOTOROLA Chapter 3 Module Descriptions 3 79 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 7 QAM The Quadrature Amplitude modulation QAM technique is required to be used in the V 22bis modem This technique is implemented in the gam c module This module consists of two main blocks the QAM transmitter and the QAM receiver In the following subsections the operation of the modem transmitter and receiver are described The transmitter accepts data bits from the Data Terminal Equipment DTE It then performs the necessary processing to place this data into the
7. e f the Dial Tone is not detected during a fixed period of time SM INIT DIALING STATE Fills the Tx data buffer with dial digits initializes the DTMF dialer or the Pulse dialer if Pulse dialing is enabled in the S 13 register SM DIALING STATE MOTOROLA Chapter 2 General Architecture Go to www freescale com 2 17 For More Information On This Product Freescale Semiconductor Inc Global State Machine Table 2 1 The Global State Machine States continued Name of the State Activities Exit States SM DIALING STATE Calls the Tx Data Pump The DTMF or Pulse dialer and the Rx Data Pump Idle mode On the receipt of any character from the DTE it goes on hook and sends the NO CARRIER response to the DTE 1 SM DIALING STATE e By default 2 SM INIT ANSWERTONE DET STAT E e f dialing is completed and return to command mode after dialing H 2 register is disabled 3 SM RESET COMMAND STATE e On the reception of any character from the DTE e If dialing is completed and return to command mode after dialing H 2 register is enabled SM PRE PHISICAL HANDSHAKING STAT E Calls the Rx Data Handler Handshaker and the Rx Data Pump On the receipt of any character from the DTE and on the break of the line event it goes on hook and sends the NO CARRIER response to the DTE 1 SM PRE PHISICAL HANDSHAKING STATE e By default 2 S
8. 3 54 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Input Band Pass Filter AMPLITUDE Mark Space Filter Filter FREQUENCY F MARK FseACE Figure 3 18 Simplified demodulation spectrum of a binary FSK signal Also the Mark and Space filters are designed to make the signal complex The complex signal has two components a real I channel and an imaginary part Q channel The outputs of these filters are exactly 90 degrees out of phase with respect to each other The outputs of the Mark and Space filters are squared then I and Q energies are summerised R1 Q Ria On The powers of amplitudes of the two filter outputs R1 and RO are compared to determine whether the signal instantaneously falls mostly in the vicinity of the Mark R1 gt RO or is closer to the space RO gt R1 The resultant demodulated bits are then placed into the Rx data buffer The FSK Rx Data Pump is implemented in the FSK demodulator routine The FSK module routines can be found in the fsk c file The FSK Tx and Rx control data structures are defined in fsk h The Tx FSK control data structure CC e e ke e ke ke ke ke ko ke ko RR RRR kk RR kk ok kk ok e e ke e oe oe ob o He oe e e o o o ooo e e e e e e e e e ke FSK Transmitter control data structure HR KR RR RR kk kk e e e o e e oe oe oe
9. Call s void text to dte fixed struct channel t channel char str uint32 length Arguments Table 3 113 text to dte fixed arguments channel in Pointer to the Channel control data structure str in String length in The length of the str string Description This function writes the string str of the fixed length length into the Rx uart data buffer Returns None Code example struct channel t channel char tmp str 2 tmp str 0 O tmp str 1 K text to dte fixed amp channel tmp str 2 MOTOROLA Chapter 3 Module Descriptions 3 225 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules char to dte Call s void char to dte struct channel t channel char ch Arguments Table 3 114 char to dte arguments channel in Pointer to the Channel control data structure ch in Character Description This function writes one character ch into the Rx uart data buffer Returns None Code example struct channel t channel char to dte amp channel a 3 226 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc uint8 to str decimal Call s uint8 uint8 to str decimal char num str uint8 num Arguments Table 3 115 uint
10. Go to www freescale com 3 179 Freescale Semiconductor Inc Support Modules sample present codec Call s bool sample present codec void Arguments None Description This function checks the availability of a sample in UARTI Returns TRUE A sample is available in UARTI FALSE A sample is not available in UARTI Code example bool sample is available FALSE sample is available sample present codec 3 180 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules flow control Call s void flow control struct channel t channel Arguments Table 3 78 flow control arguments channel in Pointer to the Channel control data structure Description This function performs Data Flow Control according to the S 18 register settings The Soft Modem implements flow control by detecting that Tx uart data is full enough defined by the UART DATA FLOW STOP value in modem h and then negates the Request to Send RTS signal in the case of Hardware flow control or sends a special character XOFF into the data stream in the case of Software flow control to stop the flow of data When the buffer Tx uart data is empty enough again defined by the UART DATA FLOW START value in modem h it asserts the RTS signal in the case of Hardware flow cont
11. Sine wave Frequency for the amplitude modulated tone in Hz It is initialized in 7x tone init e amplitude ripple Sine wave Ripple Amplitude for the amplitude modulated tone in Q14 format It is initialized in 7x tone init e amplitude omega Sine wave Phase Shift during transferring from one generated sample to next for the amplitude modulated tone in Q15 format e amplitude phase Sine wave Current Phase for amplitude modulated tone in Q15 format It is initialized in 7x fone init to 0 3 200 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Tx tone init Call s void Tx tone init struct channel t channel struct Tx control tone t Tx control tone enum gen tone type t tone type Arguments Table 3 93 Tx tone init arguments channel in Pointer to the Channel control data structure Tx control tone in Pointer to the Tone Generator control data structure tone type in Type of tone for generation see table 3 6 3 1 Description This function initialises the Tone Generator control data structure according to the chosen type of the tone fone type It also initializes the fields of the Channel control data structure pointed to by channel that are responsible for the Tx Data Pump data pump ptr baud rate number samples data pump call f
12. bool tone all detected uint32 process count bool enabled JI The Rx tone t structure parameter descriptions MOTOROLA Chapter 3 Module Descriptions 3 205 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules frequency param Array of parameters of Double Biquad Filters detector state Determine the state of the Tone detector It can be equal to RS TONE ON DETECTION state of Tone ON detection RX TONE OFF DETECTION state of Tone OFF detection y out Output of the exponential filter based on the filtered signal It is initialized in Rx tone init to 0 x out Output of the exponential filter based on the global signal It is initialized in Rx tone init to 0 x out max Maximum value of x out determined during an ON detection phase It is initialized in Rx tone init to O tone on ms Minimum Tone ON duration in ms for true detection It is initialized in Rx tone init max tone on ms Maximum Tone ON duration in ms for true detection It is initialized in Rx fone init tone off ms Tone OFF duration in ms for true detection It is initialized in Rx tone init detection time Maximum time of detection process in ms It is initialized in Rx tone init tone on samples left Number of samples left for detecting tone ON It is initialized in Rx tone init to 0 max_tone_on_samples_left Maximum number of
13. buffer It controls the handshake process The inner state diagram for this routine during the handshake is shown in Figure 3 7 If handshake is completed successfully Rx control data handler state is set to RX DH STATE COMPLETED else to RX DH STATE FAILED This function is called by the Rx data handler function via the channel Rx control ptr data handler call func Figure 3 7 Handshake state diagram Returns None Code example struct channel t channel Rx V22 handshake routine channel 3 30 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Tx V22 handshake init Call s void Tx V22 handshake init struct channel t channel Arguments Table 3 20 Tx V22 handshake init arguments channel in Pointer to the channel control data structure Description This function initializes the transmitter to the V 22 handshake data handler control structure It fills the appropriate fields of Tx control t structure pointed to by channel Tx control ptr fields data handler call func data handler state number n bits It sets up the data handler for the transmitter to perform the 7x V22 handshake routine This function is called from state machine Returns None Code example struct channel t channel Rx V22 handshake init channel MOTORO
14. codec 8 codec 16 enum shift direction t msb first lsb first FC eoo kk e e e e e ke ke ko e e e e e oe e ok ke ok ke e e e e e e e o ke e ee e e oe e o e e e e e eo oe e e o e e e e e UART Parameters Structure oko ke e e e e e ke o ke o ok ke e e e o e e e o kk e e e e EE struct uart params t Only for UARTO and UART1 in UART mode uint8 uart_number uint32 bits_rate enum data_bits_t data_bits enum parity_t parity enum stop bits t stop bits enum channel mode t channel mode bool flow control transmit on off Only for UART1 uint8 rx fifo threshold uint8 tx fifo threshold enum uartl mode t mode Only for UART1 in modem mode enum shift direction t shift direction hi The uart params t structure parameter descriptions e uart number UART number The value must be equal to 0 for UARTO or 1 for UART I Initialized in mcf5407_uart_init bits rate Bit rate of the UART This is not used in modem mode Initialized in mcf5407 uart init data bits Bits per character This value does not include start parity or stop bits It can be equal to data bits 5 5 bits data bits 6 6 bits 3 166 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules data bits 7 7 bits data bits 8 8 bits This is not used in modem mode Initiali
15. define define define struct struct uint8 int16 uint8 uint32 DATA LENGTH 60 SAMPLE LENGTH 400 COMMAND LENGTH 40 UART DATA LENGTH 300 channel t channel Tx control t Tx control Tx data DATA LENGTH Tx sample SAMPLE LENGTH Tx uart data UART DATA LENGTH command COMMAND LENGTH Tx channel init amp channel amp Tx control Tx data DATA LENGTH Tx sample SAMPLE LENGTH Tx uart data UART DATA LENGTH command COMMAND LENGTH MOTOROLA Chapter 2 General Architecture For More Information On This Product Go to www freescale com 2 41 Interface Freescale Semiconductor Inc Rx channel init Call s void Rx channel init struct channel t channel struct Rx control t Rx control uint8 data uint32 data length intl6 sample uint32 sample length uint8 uart data uint32 uart data length Arguments Table 2 20 Rx channel init arguments channel in Pointer to the Channel control data structure Rx control in Pointer to the Receiver control data structure data in Pointer to the Rx data circular buffer data length in Length of the Rx data circular buffer sample in Pointer to the Rx sample circular buffer sample length in Length of the Rx sample circular buffer uart data in Pointer to the Rx uart data circular buffer uart data length in Length of the Rx uart data circular buffer Description This function initializes
16. det ones ms ms of binary 1 s RX V21 DH WAIT SEND The Handshaker remains silent for a wait send ms ms before transmitting binary 1 s RX V21 DH WAIT CARRIER The Handshaker remains in this state during wait carrier ms ms on the completion of the state the modem shall be ready to transmit and receive actual data It is initialized in Rx V21 handshake init to R amp V21 DH DETECT ONES MOTOROLA Chapter 3 Module Descriptions 3 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 8 4 det ones ms Duration of binary 1 detection in ms It is initialized in Rx V21 handshake init to 155 ms wait send ms Time before starting to transmit binary 1 s in ms It is initialized in Rx_V21_handshake_init to 456 ms if the receiver is in calling mode otherwise it is initialized to 0 wait_carrier_ms Time before the modem goes into the data mode ready to transmit and receive actual data in ms It is initialized in Rx_V21_handshake_init to 755 ms if the receiver is in calling mode otherwise it is initialized to 600 ms current_counter Counter used in the current state for the calculation of binaries conducive to completion of the current state For example number of detected binary 1 s in the RX_V21_DH_DETECT_ONES state It is initialized in Rx_V21_handshake_init to 0 global_counter Counter of bits received throughout the han
17. e PLUL1 Filter coefficient for the Carrier Recovery loop filter This field is initialized in function DPSK demodulator init e CPLLI Filter coefficient for the Clock Recovery loop filter This field is initialized in function DPSK demodulator init cerror sig Filtered error signal for Carrier Recovery and the state of the loop filter This field is initialized in function DPSK demodulator init to O clerror sig Filtered error signal for Clock Recovery and the state of the loop filter This field is initialized in function DPSK demodulator init to O clerror2 sig Indicates the false lock of baud clock for Clock Recovery This field is initialized in function DPSK demodulator init to Q e baud nrg3 Energy value of the 3rd sample This field is initialized in function DPSK demodulator init to O baud nrg7 Energy value of the 7th sample This field is initialized in function DPSK demodulator init to O signal present Indicates the carrier frequency signal presence This field is initialized in function DPSK demodulator init to FALSE clock corrected Indicates that the Clock was corrected during the current baud This field is initialized in function DPSK demodulator init to FALSE MOTOROLA Chapter 3 Module Descriptions 3 75 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump DPSK modulator init Call s void DPSK mod
18. v42bis data block comp buf input frame buffer comp buf len input buffer length decomp buf output buffer amp decomp len output buffer length if res C ERROR Disconnect code here MOTOROLA Chapier 3 Module Descriptions 3 135 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Overview v42bis Flush Call s int v42bis Flush v42bis t dp uint8 obuf Arguments Table 3 56 v42bis Flush arguments dp in pointer to the v42bis data structure obuf in pointer to the output buffer to flush remain data Description This function performs a FLUSH request according to the CCITT Recommendation V 42bis section 7 9 It flushes the outstanding bits from the encoder and returns the result as a byte aligned output ready for transmission Note that the user must specify an output buffer large enough otherwise the function can put data into an invalid memory location without reporting any error The size of this buffer should be at least 4 bytes on 2048 codewords dictionary All bytes in the buffer should be set to zero Returns The number of bytes that were put into the output buffer can be Code example void Tx data Zero V42bis t v42bis uint8 input data uint8 len uint8 flush_buf 6 uint8 nBytes uint16 encoded bytes 0 uint8 needed to send something 1 En
19. 2 44 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface H registers init Call s void H registers init void Arguments None Description This function initializes the global H hidden registers that are not directly accessible to the user via AT commands data array to the default values profile that are contained in the H FACTORY DEFAULTT data array Factory defined Configuration of H registers This function is called by the global structure init function and the Command Handler on ATZ or AT amp F commands Returns None Code example H registers init MOTOROLA Chapter 2 General Architecture 2 45 For More Information On This Product Go to www freescale com Interface Tx reset Call s Freescale Semiconductor Inc void Tx reset struct channel t channel Arguments Table 2 21 Tx reset arguments channel in Pointer to the Channel control data structure Description Returns Code example This function resets most of the used fields of the Transmitter control data structure sample head sample tail data head data tail command head command tail data pump ptr data pump call func state number samples baud rate process count n bits n bits mask pointed to by the channel Tx control ptrto the default values This
20. AT parser init arguments channel in Pointer to the Channel control data structure current k in Pointer to the element in the at command string that must to be proc essed min in Minimal value of parameter max in Maximal value of parameter command code in The variable contains the number and parameters of the current AT command Description This function determines whether the parameter following the command in at command string doesn t exceed the bounds of minimal and maximal parameter values If the parameter doesn t exceed these bounds the function stores it in the variable command code together with the stored command if not the function writes in the variable command code an ERROR Returns Pointer to the element in the at command string that must be processed Code example struct channel t channel intl6 k 0 define E RANGE MIN 0 define E RANGE MAX 1 k command parameter identification channel k E RANGE MIN E RANGE MAX at parser control command code MOTOROLA Chapter 3 Module Descriptions 3 237 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions 3 238 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions command buf write Call s uint32 command buf write struct channel t channel
21. Eight data bits plus one 1 stop bit follows this start bit So the receiver changes its state to VI4 SYMBOL GETTINGin order to get nine bits eight data bits plus one stop bit from the rx buffer and places the data bits into the Rx uart data buffer When it is finished the receiver returns back to the V14_1 GETTING state When the transmitter sends data according to the V 14 protocol it operates in the V14 DATA OUT state If there is no data to send there is no data in the Tx uart data buffer it sends a series of 1 bits Otherwise it takes one byte from the Tx uart data buffer puts a start bit 0 at the beginning and a stop bit 1 at the end of the sequence and places the resultant ten bits into the tx buffer 3 2 7 The V 42 module function description This chapter describes the functions implemented in the V 42 module Function arguments for each routine are described as in or inout An in argument means that the parameter value is an input only to the function An inout argument means that a parameter is an input to the function but the same parameter is also an output from the function nout parameters are typically input pointer variables in which the caller passes the address of a pre allocated data structure to a function The function stores its result within that data structure The actual value of the inout pointer parameter is not changed 3 118 MCF5407 LDR Soft Modem Software Developer s Reference
22. The remote modem issues a receiver ready RR request with the p bit set and just after that starts to send an information frame e g 23 The Soft modem receives the RR command and sends a reply RR with bit f set According to the ITU T V 42 recommendation the remote modem has to resend all unacknowledged I frames starting from I20 When the Soft modem receives I23 it sets the notify rej field for frames 20 21 and 22 As a result the transmitter issues the SREJ frame with the value 20 in its NR field When the first I frame with NS 20 is received which was sent by remote modem in reaction to the received RR reply variable VR is incremented by 1 and the xx last pointer moves to the next position When the remote modem receives SREJ it assumes that frame I20 was not received and resends it again The soft modem has to ignore this frame MOTOROLA Chapter 3 Module Descriptions 3 113 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction Another situation is shown below rx iframe V notify rej sent rej 0 0 18 1 rx last gt 14 i 15 0 Remote modem Soft modem RR p 1 RR p 1 I NS 18 gt gt RR f 1 NR 14 Ay RR f 1 NR 14 o I NS 18 I NS 14 I NS 14 I NS 15 gt I NS 15 I NS 16 gt I NS 16 I NS 17 I NS 17 I NS 18 gt I NS 18
23. Tx uart data Tx sample Cyclic buffer HH Figure 2 2 The Data Flow Diagram The Soft Modem uses a set of seven circular buffers Tx uart data Tx data Tx sample Rx uart data Rx data Rx sample and command as data interfaces between the functional blocks of the Soft Modem Circular in this instance means that the elements are accessed sequentially until the end of the buffer then wrap around to the beginning again Block descriptions Tx sample is a circular buffer that the Tx Data Pump writes the samples into The Tx DAA Interface reads these samples directly from Tx sample Tx data isa circular buffer from which the Tx Data Pump gets the transmit data symbols The Tx Data Handler writes the data symbols to be transmitted into this buffer Tx uart data is a circular buffer from which the Tx Data Handler gets the transmit data chars The Rx UART Interface writes data chars received from the DTE to be transmitted into this buffer Also this buffer is read by the Command Parser in order to detect AT commands entered by the user MOTOROLA Chapter 2 General Architecture 2 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The Basic Blocks of the Soft Modem 2 4 Rx sample is a circular buffer from which the Rx Data Pump reads samples The Rx DAA Interface writes these samples directly into Rx sample Rx data is a circular buffer int
24. V23 init 3 15 Rx V8 DH init 3 161 Rx V8 DH routine 3 162 S registers init 2 44 sample present codec 3 181 save data handler parameters 2 56 state machine 2 23 state machine init 2 22 text to dte 3 225 text to dte fixed 3 226 Tx channel init 2 40 Tx daa 3 196 Tx data handler 2 50 Tx data pump 2 48 Tx data read 2 30 Tx data write 2 29 Tx DTMF 3 217 Tx DTME init 3 216 Tx pulse 3 220 Tx pulse init 3 219 Tx reset 2 46 Tx sample read 2 26 Tx sample write 2 25 Tx silence gen 2 54 Tx tone 3 203 Tx tone init 3 202 Tx uart 3 174 Tx uart all 3 175 Tx uart data read 2 34 Tx uart data write 2 33 Tx VI4 DH init 3 141 Tx V14 DH routine 3 142 Tx V21 handshake init 3 7 Tx V21 handshake routine 3 8 Tx V21 init 3 5 Tx V22 handshake init 3 31 Tx V22 handshake routine 3 32 Functions 2 MCF5407 LDR Soft Modem Software Developer s Reference Manual Tx V22 init 3 27 Tx V22bis change mode 3 50 Tx V22bis handshake init 3 48 Tx V22bis handshake routine 3 49 Tx V22bis init 3 44 Tx V23 handshake init 3 16 Tx V23 handshake routine 3 17 Tx V23 init 3 14 Tx V8 DH init 3 154 Tx VS DH routine 3 155 uint8 to str decimal 3 228 uint8 to str hexadecimal 3 229 v14 get bits 3 151 v14 put bits 3 143 V22 descramble bit 3 26 V22 scramble bit 3 25 V22bis_descramble_bit 3 43 V22bis scramble bit 3 42 v42 getbits 3 121 v42 init 3 122 v42 putbits 3 124 v42 rx data 3 125 v42 tx data 3 126 v42 viewb
25. cz state Answering Mode case V8 DCE CJ In this case the V8 Data Handler will receive the CJ message detect the loss of carrier loss of connection and direct the Soft Modem to establish a connection according the chosen modulation protocol or to break the connection if the modulation protocol wasn t chosen 3 162 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module v8 get bits Call s uintl6 v8 get bits struct channel t channel Arguments Table 3 69 v8 get bits arguments channel in Pointer to the Channel control data structure Description This function gets data from the Rx data buffer Returns Data obtained from Rx data buffer Code example struct channel t channel uintl6 current data 0 current data v8 get bits channel MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 163 Freescale Semiconductor Inc V 8 Software Module 3 6 3 The V 8 start up procedure in calling mode The Soft Modem seeks to detect ANS or ANSam If ANSam is detected the Soft Modem transmits no signal for a period of at least 1s prior to transmitting the CM message If ANS is detected the Soft Modem will go into the physical handshake according to the preselected V series modulation mode After no signal trans
26. filter size The number of coefficients used by the BPF This field is initialized in FSK modulator init filter coef Coefficients of the BPF This field is initialized in QAM modulator init filter buf Cyclic buffer used by the filter algorithm of the BPF This field is initialized in FSK modulator init to 0 filter buf ptr Pointer to the current element of the filter buf This field is initialized in FSK modulator init MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc The Rx FSK control data structure CC e ke ke e ke ke ke kek kk RRR ook kk kk kk ok o ee oe ob o o o e e o o e e ooo o e e e e e e e e e ke FSK Receiver control data sructure HK KR RR RRR kk ke ke ke ke ke e e e oe oe o o o b EEGEN typedef struct Rx control FSK t uint32 uint32 f space f mark intl6 lpf coef uint32 intl6 intl6 intl6 intl6 intl6 uint32 uintl6 uintl6 uint 8 uint32 intl6 intl6 uint32 uint32 uint32 filter size filter space i FSK FILTER COEF NUMBER filter space q FSK FILTER COEF NUMBER filter mark i FSK FILTER COEF NUMBER filter mark q FSK FILTER COEF NUMBER filter buf FSK FILTER BUF SIZE filter buf ptr baud incr baud frac last bit filter bpf size filter bpf coef FSK BPF COEF NUMBER filter bpf buf FSK BPF B
27. void Tx channel init struct channel t channel struct Tx control t Tx control uint8 data uint32 data length intl6 sample uint32 sample length uint8 uart data uint32 uart data length uint32 command uint32 command length Arguments Table 2 19 Tx channel init arguments channel in Pointer to the Channel control data structure Tx control in Pointer to the Transmitter control data structure data in Pointer to the Tx data circular buffer data length in Length of the Tx data circular buffer sample in Pointer to the Tx sample circular buffer sample length in Length of the Tx sample circular buffer uart data in Pointer to the Tx uart data circular buffer uart data length in Length of the Tx uart data circular buffer command in Pointer to the command circular buffer command length in Length of the command circular buffer Description This function initializes all the fields of the Transmitter control data structure to the default values This function should be called before calling Tx data pump Tx data handler command parser command handler and Transmitter Protocols initialization functions This function is called once in main Returns None 2 40 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Interface Freescale Semiconductor Inc Code example define
28. 0 0625 pre smax The maximum I value over the baud in Q14 format This field is initialized in function QAM demodulator init to 0 e CPLLI CPLL2 Filter coefficients for the Carrier Recovery loop filter This field is initialized in function QAM demodulator init e BPLLI BPLL2 Filter coefficients for the Clock Recovery loop filter This field is initialized in function QAM demodulator init e BCNT The correction of the Baud Clock is performed once per BCNT baud This field is initialized in function QAM demodulator init e AGCPLLI AGCPLL2 Filter coefficients for the filter of the AGC block This field is initialized in function QAM demodulator init e cerror sig Filtered error signal for Carrier Recovery and the state of the loop filter This field is initialized in function QAM demodulator init to 0 clerror sig Filtered error signal for Clock Recovery and the state of the loop filter This field is initialized in function QAM demodulator init to 0 clerror2 sig Indicates false lock of the baud clock for Clock Recovery This field is initialized in function QAM demodulator init to 0 baud nrg4 Energy value of the 4th sample This field is initialized in function QAM demodulator init to 0 e baud nrg Energy value of the 8th sample This field is initialized in function QAM demodulator init to 0 signal present Indicates the carrier frequency signal presence This field is initialized in func
29. 1 4 5 3 1 4 6 3 1 4 7 3 1 5 3 1 5 1 3 L5 2 3 1 6 3 1 6 1 3 1 6 1 1 3 1 6 1 2 3 1 6 1 3 3 1 6 1 4 3 1 6 1 5 3 1 6 2 3 1 6 2 1 3 1 6 2 2 3 1 6 2 3 3 1 6 2 4 3 1 6 2 5 3 1 6 2 6 3 1 6 2 7 3 1 6 3 3 1 6 4 3 1 7 3 1 7 1 3 1 7 1 1 3 1 7 1 2 3 1 7 1 3 3 1 7 1 4 Freescale Semiconductor Inc Contents Page Title Number Establishment of connection esses ener 3 11 ro RF ERES 3 20 Scran TEE 3 21 Deserambl t 4 55 0 eite ret E DIR EN DIS 3 22 Handsh ake 4 acte t eerte tendis sans eed Ove e aban toads oes arse 3 22 Ire 3 24 RX V 22 Handshake data handler structure esseeeeeeeeeeeererrrrrerrrrrerrreees 3 24 NOBIS cdi uites fonds etd e c cS a saca t she arte 3 33 Scrambler eena Eeer 3 34 IR E E 3 35 Handshake dun evt IBID Ee 3 35 Retrain sequence 2400 bit s operation eee 3 38 eer enee eio acere eT pesetas 3 39 RX V 22bis handshake data handler structure 3 39 TX V 22bis handshake data handler structure ess 3 41 PSR ode fce clu dau Tu eg 3 52 ESK Ke EE 3 52 FSK eet ien tee eto notae ocio otii aliit eebe ted 3 53 MPS EE PEERS 3 64 DPSE transtnltter Ah eRe eC Ms e EN AE Cr a dt 3 64 Kiel 3 65 sevi cM 3 65 Mod lat r ie tvi hl shana te lege 3 65 Bandpass filter case eo aad a dte de ob ea eua t 3 65 G ard t ne generator enee ipeo ee a Nep d deen ee 3 66 DPSK receive i2 b uad dioc ades uen deioeten adag 3 66 Bandpass EE 3 66 Automatic Gain Control AO 3 67 Demodulator s
30. 600 1200 2400 2 V 22 DPSK 1200 600 1200 2400 2 600 600 1200 2400 1 V 23 FSK 75 1200 75 1200 420 1700 1 75 600 75 600 420 1500 1 V 21 FSK 300 300 1080 1750 1 e ITU T V 21 V 23 V 22 and V22bis Physical Handshake Sequences e ITU T V 42 Error Correction e ITU T V 42bis Data Compression e ITU T V 14 sync to asynchronous converter MOTOROLA Chapter 1 Introduction For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Related Files 1 2 AT command set Tone generation and detection DTMF and Pulse dialing DAA interface 813044 Modem Daughter Card via the on chip USART module DTE interface via the on chip UART module Related Files The following files are relevant to the Soft Modem main c entry point of the Soft Modem modem h high level functions and main data structure definitions modem c implementation of high level functions state machine h definition of state machine data structure state machine c implementation of main state machine v21 h definitions used by V 21 protocol v21 c initialization of V 21 data pump protocol and realization of physical handshake sequence for V 21 v23 h definitions used by V 23 protocol v23 c initialization of V 23 data pump protocol and realization of physical handshake sequence for V 23 v22 h definitions used by V 22 protocol v22 c initialization of V 22 d
31. Block diagram oue e Re aia 3 60 3 24 DPSK receiver decision DOTIS J ee o eet i tad ta eu ee NC D ELE 3 70 3 25 QAM transmitter block diagram sce oir iR tens ORE ED I RESI EHA EUREN 3 81 3 26 QAM modem receiver block diagram essen 3 82 3 27 Signal energies over EE 3 85 3 28 QAM Clock Recovery block diagram eese esee eene eene tnn 3 85 3 29 QAM Carrier Recovery block diagram esee 3 86 3 30 QAM rec iver GECISION POINtS deed Ee 3 87 3 31 External relationships of the V 42 module serene 3 100 MOTOROLA Figures vii For More Information On This Product Go to www freescale com Figure Number 3 32 3 33 3 34 3 35 3 36 3 37 3 38 3 39 3 40 3 41 3 42 3 43 3 44 3 45 3 46 3 47 3 48 3 49 3 50 viii Freescale Semiconductor Inc Figures Page Title Number General structure of the V 42 module eese nennen 3 103 State machine of the VAireceiver eene nnne 3 106 State machine of the V 42 transmitter eescessesseeeeeeeeneree eene enne 3 107 Structure of the V 42 receive iu dea deno up SP Vtech rue 3 108 Structure of the V 42 transmitter s eeesesssseseeeeeeee eene eene nennen enne nnne nen 3 116 V 42 bis CONNECH ONG o e ete ROG A Seb aE 3 128 Compression ere 3 132 Decompression Elementen cus phot pe bones ci eege eege 3 133 Tx V 14 Data Handler in the Tx channel cccccsssccccececeesesscecesececeesenseaeeeees 3 1
32. Figure 3 33 State machine of the V 42 receiver For More Information On This Product Go to www freescale com peziugooo1 Jou se qqv MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA Freescale Semiconductor Inc V 42 Error Correction ODP recognized ADP recognized Decision BOX St new portion transmission of of data to the current portion of data is completed first protocol flag received poued oum OOPL e upm pezriudooo jou se ddo send is prepared Send data V 42 poured our oor e urpis pezriudooor jou se qqV Send data V 14 Figure 3 34 State machine of the V 42 transmitter If the modem acts as an answerer the receiver detects an originator detection pattern an ODP sequence When an ODP sequence is received the receiver changes its state and waits for the first protocol flag This is done to change the transmitter to the correct state After receiving the first flag the receiver changes its state and waits for a frame opening flag If ODP was not recognized within a T400 time period it starts working according to the V 14 protocol or breaks the connection depending on the user s settings If the modem is the originator the transmitter sends an ODP sequence until an ADP sequence is recognized in the receiver The state machine of the transmitter is shown in Fig 3 2 4 When an ADP sequence is received the receiver cha
33. General Architecture 2 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Global State Machine Table 2 1 The Global State Machine States continued Name of the State Activities Exit States SM AFTER ANSWERTONE PAUSE STATE Calls the Rx Data Pump Idle mode and the Tx Data Pump Silence Generator On the receipt of any character from the DTE it goes on hook and sends the NO CARRIERF response to the DTE 1 9M AFTER ANSWERTONE PAUSE STATE e By default 2 SM INIT ON LINE STATE e f the Silence Generation is completed 3 SM RESET COMMAND STATE e On the reception of any character from the DTE SM INIT ANSWERTONE GEN STATE If V 8 is disabled S 19 register it initializes the Tone Generator as the Answer ANS tone generator otherwise as the ANSam tone generator 1 SM ANSWERTONE GEN STATE e f V 8 is disabled 2 SM INIT V8 HANDSHAKING STATE e f V 8 is enabled SM ANSWERTONE GEN STATE Calls the Tx Data Pump ANS or ANSam generator If V 8 is enabled it calls the Rx Data Handler V 8 and the Rx Data Pump V 21 otherwise it calls only the Rx Data Pump Idle mode If V 8 is enabled on the end of an Answer tone generation it initializes the V 21 Tx Data Pump On the receipt of any character from the DTE it goes on hook and sends the NO CARRIER response to the DTE 1 SM ANSWERTONE GEN STATE e By default
34. Inc Global State Machine IK The State Machine Structure Eokckckckckckckck ck RK kc kckckck kk ck KKK struct state machine t enum sm state t state yy The state machine t structure parameter descriptions e state Contains the current state of the Global State Machine It is initialized in state_machine_init to SM_INITIALIZATION_STATE Table 2 1 The Global State Machine States Name of the State Activities Exit States SM INITIALIZATION STATE Initialises the Command Parser and the SM RESET COMMAND STATE Command Handler SM RESET COMMAND STATE Resets the Receiver and the Transmitter SM COMMAND STATE Initialises the Ring Detector SM COMMAND STATE Calls the Command Parser the 1 5M COMMAND STATE Command Handler and the Rx Data e By default Pump Ring Detector 2 SM INIT PRE ANSWERTONE PAUS If a Ring is detected it sends a RING E STATE response to the DTE e f SO is less or equal to S1 e On an AT A command 3 SM INIT PRE DIAL STATE e On an AT D command 4 SM RESET COMMAND STATE e On an AT H command 5 SM INIT LOOPBACK STATE e On an AT amp T command 6 SM INITIALIZATION STATE e On an AT Z command SM INIT ON LINE COMMAND STATE Sends an OK response to the DTE SM ON LINE COMMAND STATE Sets the mode of the Rx amp Tx Data Handler and the Command Parser to the Online command mode SM ON LINE COMMAND STATE Calls the Tx amp Rx Data Pumps 1 9M ON LINE COMM
35. MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions AT handler init Call s void AT handler init struct channel t channel Arguments Table 3 124 AT handler init arguments channel in Pointer to the Channel control data structure Description This function initialises the channel Tx control ptr command handler call functothe AT handler routine It must be called before the command handler function This function is called in state machine Returns None Code example struct channel t channel AT handler init amp channel MOTOROLA Chapter 3 Module Descriptions 3 241 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions AT handler routine Call s void AT handler routine struct channel t channel Arguments Table 3 125 AT handler routine arguments channel in Pointer to the Channel control data structure Description This function implements the AT Command Handler Itreads commands interpreted by the AT Command Parser from the command buffer The format of the command buffer element is e 4 th byte is the command number Command numbers are specified in the at parser h file e 3 rd byte is the 1st parameter optional e 2 nd byte is t
36. Manual MOTOROLA For More Information On This Product Go to www freescale com V 42 Error Correction Freescale Semiconductor Inc ret connection code Call s void ret connection code struct channel t channel Arguments uint8 v42 established uint8 params Table 3 45 ret connection code arguments channel in Pointer to the Channel control data structure v42 established in TRUE if the V 42 protocol is established FALSE otherwise params in Contains a mask of negotiated optional functions of the V 42 protocol for established connection Description Returns Code example This function sets the connection code field of the channel Rx control ptr data structure according to the established connection As a result the appropriate answer codes appear in the terminal window with the description of the protocols used and the compression None ret connection code channel TRUE dp optional functions MOTOROLA Chapter 3 Module Descriptions 3 119 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction v42 getbits Call s uint32 v42 getbits V42 DATA STRUCT dp uint32 value uint32 n uint32 transparency Arguments Table 3 46 v42 getbits arguments dp in Pointer to the V42 data structure value inout Pointer to a section of memory where read bits are place
37. On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump V22bis scramble bit Call s uint8 V22bis scramble bit struct channel t channel uint8 bit Arguments Table 3 23 V22bis scramble bit arguments channel in Pointer to the channel control data structure bit in Bit to scramble Description Scrambles input bits according to the V 22bis recommendation d nT d nT XOR d n 14 T XOR d n 17 T Scrambler register is stored in channel Tse control ptr data pump ptr scrambler register Returns Scrambled bit Code example uint8 temp current nbits current nbits struct channel t channel temp current nbits V22bis scramble bit channel current nbits 3 42 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump V22bis descramble bit Call s uint8 V22bis descramble bit struct channel t channel uint8 bit Arguments Table 3 24 V22bis descramble bit arguments channel in Pointer to the channel control data structure bit in Bit to descramble Description Descrambles input bits according to the V 22bis recommendation d nT d nT XOR d n 14 T XOR d n 17 T Descrambler register is stored in channel Rx control ptr 2 data pump ptr descrambler register Returns Descrambled bit Code example ui
38. Overview v42bis Encode Call s int v42bis Encode v42bis t dp uint8 ch uint8 obuf Arguments Table 3 54 v42bis Encode arguments dp in Pointer to the v42bis data structure ch in Character to encode obuf in Output buffer for compressed data Description Returns Code example void Tx data 3 134 uint8 uint8 uint8 Performs input character encoding according to the CCITT Recommendation V 42bis section 7 1 The function encodes a single character ch into a sequence of X bits where O lt X lt 48 with a 2048 codeword dictionary and puts bytes of that sequence into the output buffer obuf Bits that do not align to bytes will be taken into account during further va2bis FlushOrv42bis Encoderoutine calls Note that the user must specify an output buffer large enough otherwise the function can put data into an invalid memory location without reporting any error The size of this buffer should be at least 6 bytes out of 2048 codewords All bytes in the buffer should be initialised to zero before calling this function The number of bytes put into the output buffer can be zero or C ERROR if an internal error has occurred dictionary was overwritten with invalid data v42bis t v42bis uint8 input data uint8 len comp buf 256 6 nBytes out comp buf memset comp buf 0 sizeof comp buf Perform compression from input data buffer char by char f
39. Recommendation V 22 The phase change is the actual on line phase shift in the transition region from the center of one signaling element to the center of the following signaling element Phase Quadrant 2 Phase Quadrant 1 e 6 n 01 3 10 11 a e 0 n n ee w Phase Quadrant 3 Phase Quadrant 4 Figure 3 8 V 22bis 16 point constellation diagram 3 1 4 1 Scrambler A self synchronizing scrambler which has the generating polynomial 1 x 14 x 17 shall be included in the modem transmitter The purpose of the scrambler is to randomize input binary data sequence which means that it converts this sequence in a pseudo random binary sequence This is required for the clock recovery module Considering d nT is the input to the scrambler the output d nT is given by d nT d nT XOR d n 14 T XOR d n 17 T 3 34 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump where T is the data period The signal flowchart of the modem scrambler is shown in Figure 3 9 Figure 3 9 V 22bis scrambler 3 1 4 2 Descrambler The descrambler is intended for recovering the originally transmitted quadbit The output of the descrambler is described by d nT d nT XOR d n 14 T XOR d n 17 T Where T is the data period The signal flowchart of the modem scrambler is shown in Figure
40. Si3044 Data Sheet R2 01 S13044 DS201 MOTOROLA About This Book XV For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Acronyms and Abbreviations Acronyms and Abbreviations Table i lists acronyms and abbreviations used in this document Table i Acronyms and Abbreviated Terms a eem ANS Answer tone see V 25 E xvi MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Chapter 1 Introduction This document describes the low data rate LDR Soft Modem with data rates up to 2400 bits second for the MCF5407 ColdFire processor The Soft Modem includes support for the Data Pump in real time software as well as the AT command set and other protocols see below The chosen development platform is the MCF5407C3 EVM with an additional Daughter card The Daughter card is used to provide the Data Access Arrangement codec and phone line interface such as Silicon Labs S13044 In this manual you will find the information required to use and maintain the LDR Soft Modem interfaces and algorithms 1 1 Key Features The LDR Soft Modem supports e Table 1 1 lists Data Pump Protocols implemented in the Soft Modem Table 1 1 Data Pump Protocols Supported by Soft Modem Wee dation Modulation m dais Deele pug bauds Hz V 22bis QAM 2400 600 1200 2400 4 1200
41. The incoming signal level may vary over a wide range due to attenuation in the telephone line However for clock and carrier recovery modules the signal level must be independent of the attenuation introduced by the communications channel and remain constant Automatic Gain Control performs this task It adjusts the envelope of the I and Q channels so that they are of the same magnitude The algorithm of AGC that is used in the current implementation is described below The AGC monitors the I channel of the receiver and calculates the gain correction factor The gain correction factor is calculated once every three baud in a two step process First the three maximum values of the signal each one corresponding to one baud 16 samples are monitored and added to each other The previous value of the average signal level is then added to this sum and divided by four to obtain the new average signal level The average signal level is then filtered by a first order IIR filter In the second step the gain correction factor is calculated The gain correction factor is the result of dividing the maximum allowed signal level or the middle value of the signal level window for 2400 bit s by the filtered average signal level For a transmission speed of 2400 bit s the AGC adjusts the signal to keep it in a certain window because its amplitude may vary Also the AGC block determines if a carrier is present in the received signal by comparing the average sig
42. This Product Go to www freescale com Interface Freescale Semiconductor Inc Tx silence gen Call s void Tx silence gen struct channel t channel Arguments Table 2 29 Tx silence gen arguments channel in Pointer to the Channel control data structure Description This function generates silence samples of 0 into the Tx sample buffer The number of generated samples per call is defined by Tx control number samples This function is the default value for the channel Tx control ptr data pump call func This function is called by the 7x data pump function via the channel Tx control ptr data pump call func Returns None Code example struct channel t channel Tx silence gen amp channel 2 54 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Interface Rx idle Call s Freescale Semiconductor Inc void Rx idle struct channel t channel Arguments Table 2 30 Rx idle arguments channel in Pointer to the Channel control data structure Description This function reads and discards samples from Rx sample The number of samples is defined by channel Rx control ptr number samples This function is the default value for Rx control data pump call func This function is called by the Kr data pump function via the channel Rx control pt
43. Tx sample buffer The number of generated samples per call is defined by Tx control 2 number samples This function is called by the 7x data pump function via channel Tx control ptr data pump call func Returns None Code example struct channel t channel Tx DTMF amp channel 3 216 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules 3 7 6 Pulse Dialer Pulse dialing is one of the methods for instructing a telephone switching system of the telephone number to be dialed Old style rotary dial phones use this method Pulse dialing is accomplished by going off and on hook to generate make and break pulses The nominal rate is 10 pulses per second It can dial numbers from 0 to 9 only The Pulse Dialer module routines can be found in the pulse c file The Pulse Dialer control data structure 7x pulse control t is defined in pulse h CC e e ke e ke ke ke ke ko kk ook ooo kk kk kk kk ok e oe oe e oe oe e ob ob o ob o o o o e ooo e e e e e e e e e e e Pulse dialer control data structure RRR RR RR ke kk kk ok ok e e oe oe oe oe oe EE typedef struct Tx pulse control t uint32 make ms uint32 break ms uint32 interval ms uint32 samples left uint32 pulse left bool next break 23 The 7x pulse control t structure parameter descriptions e make ms Durat
44. V 42bis are defined inside the V 42 module and have no relations with others so the integral operation of V 42 and V 42bis protocols is completely transparent to other parts of the system 3 4 2 Programming Interface The programming interface with the v 42bis module consists of the following set of primitives Table 3 52 V42bis Functions Function Description Reference v42bis Init Initialize v 42bis data compression 3 3 4 1 v42bis Encode Encode an input character 3 3 4 2 v42bis Decode Decode an buffer of characters 3 3 4 3 v42bis Flush Flush outstanding data from the encoder 3 3 4 4 The V 42bis module maintains its internal encoder and decoder states in the v42bis_t data structure The structure itself can be located in the V 42bis service user memory block The pointer to this structure must be specified to any interface function of this module Most of the functions return a value specifying the amount of data that was processed A special return value c_ERRoR is used to indicate a V 42bis algorithm error which may occur in the development phase only and is useful for developer V 42bis shouldn t return this value on a tested amp debugged product Note the routines do not verify input parameters for consistency Thus the code speed is increased and code size is minimized This is economical for embedded systems The parameter validity is assumed to be the responsibility of a V 42bis service user Invalid
45. V42_ FLAG SENDING After this is done the transmitter returns back into the V42 DECISION BOX state 3 2 5 6 Sending Information frames Outgoing I frames are stored in tx iframe storage Two flags are associated with each row in that storage v valid and retry If v is set it means that the frame has not been acknowledged yet and it should not be removed from tx iframe The retry flag indicates whether a frame should be retransmitted or not If the number of unacknowledged frames is equal to the window size a new frame will not be put into this storage 3 2 5 7 Sending Supervisor frames Transmission of m SREJ frames has to be described These frames implement an acknowledgement function So on the receiving side the NR field of these frames is used as acknowledgement of all previous frames Assume the Soft Modem is in the following state in rx iframe storage rx iframe V notify rej sent rej tx last 16 0 0 1 17 0 0 1 18 1 0 0 19 0 0 0 20 1 1 1 This means that frames starting from NS 16 are not acknowledged So all frames which have v bit cleared have to be added to the list of m SREJ frame regardless of their sent rej field this is done in the decision box by setting the notify rej field for all invalid frames without taking into account the sent rej field Otherwise the NR field will be equal to 18 incorrect having not received acknowledgement for frames 16 and 17 from the r
46. already transmitted and thus cannot be compressed could have been compressed increasing overall efficiency Conversely switching into the transparent mode is required when the already compressed and transmitted data is being compressed with negative efficiency It has to be pointed out that this switching from transparent to compressed modes is crucial to the efficient operation of the algorithm The standard itself does not define a compression efficiency estimation procedure for when the switch is possible or required Further details on this algorithm are included in section 3 3 2 of this document The Flush request is used to flush all outstanding data from the encoder The standard does not note when the Flush request should be issued but the assumption is made that it should be issued at least after a predefined timeout period in the case of a user working in the terminal mode The re initialization request can be issued by the V 42 function as a reaction to an external event or related to an inefficiency of compression with the current dictionary following an initialization For the transmitter this means that the string matching procedure must be terminated It is essential that the receiver s decoder understands this command 3 4 Implementation Overview The module implements the V 42bis data compression protocol used in conjunction with the error correction protocol V 42 according to the CCITT Recommendation V 42bis To enable V 42b
47. also be written as s n A cos cn cos n sin n sin n 2 The substitution of I n A cos n Q n A sin n into 2 results in 3 used to describe DPSK modulation systems s n I n cos n Q n sin on 3 Each value of the I n Q n sequence corresponds to one signaling element symbol transmitted The number of signaling elements transmitted per second is commonly referred to as the baud rate which for V 22 is set by the protocol to 600 The set of possible values of the sequence I n Q n determines the signal constellation which is given in two dimensional representation The signal constellation commonly referred to as the 3 64 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump constellation diagram is a geometric picture that emphasizes the fact that the two channels are 90 degrees Quadrature out of phase The V 22 with 600 baud rate accomplishes the transmission of 1200 bps by encoding two incoming bits dibit in a single baud Since there are four possible values for every dibit the constellation diagram for V 22 contains four points The overall block diagram for the DPSK transmitter is shown in Figure 3 19 The basic structural blocks are the scrambler encoder digital modulator and digital filter S nTs Sample Rate 9600 ANN Baud rate 600 Ts 1 Samp
48. amplitude ripple uint32 amplitude omega uint32 amplitude phase Tx control tone t structure parameter descriptions tone length ms Tone duration ON in ms It is initialized in 7x tone init tone pause ms The duration of silence or a pause OFF after tone generation in ms It is initialized in 7x fone init tone rev ms Interval of phase reversals in ms It is initialized in 7x tone init amplitude Amplitude of a generated tone in Q14 format It is initialized in Tx tone init tone frequency Frequency representing the current tone in Hz It is initialized in Tx tone init omega Phase shift of the cosine wave during transfer from one generated sample to next in Q15 It is calculated from tone frequency and Sample Rate It is initialized in 7x tone init phase Current phase in Q15 It is initialized in Tx tone init to 0 tone samples left Number of samples left to generate current tone only ON It is initialized in 7x tone init to Q samples left Number of samples left for generating current tone and pause ON 4 OFF It is initialized in 7x tone init to 0 tone samples rev left Number of samples left to generate the current phase reversed interval It is initialized in 7x tone init to 0 OROLA Chapter 3 Module Descriptions 3 199 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules e amplitude frequency
49. buffer Returns Data obtained from the Rx data buffer Code example struct channel t channel struct Rx V14 DH t dp uint32 value value v14 get bits channel dp 1 Code explanation while dp rx num bits n E data Rx data read Rx control data dp rx num bits dp rx buffer data dp rx num bits rx nbits Get data bits from Rx data buffer until the variable data by the v14 get bits function dp rx num bits number of data bits in the variable data dp rx buffer internal buffer for data bits ret val dp rx buffer contains n data bits required 3 150 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module ret val 32 n ret val 32 n dp rx buffer gt gt n dp rx num bits n return ret val When ap rx buffer contains the required number of data bits the data is stored in the variable ret vai and returned to Rx V14 DH routine function 3 6 V 8 Software Module The V 8 Software Module determines automatically prior to the initiation of modem handshake the best available operational mode between two DCEs connected via the PSTN It provides a timely indication to the Circuit Multiplication Equipment on the V series modulation to be employed in a new session of data transmission It
50. by the remote modem before frame 17 D iframe ns retry V 16 0 0 tx first c 17 1 1 18 0 1 19 1 1 20 1 1 tx last 21 0 0 The same has to be done if a valid SREJ frame is received MOTOROLA Chapter 3 Module Descriptions 3 115 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction If selective reject is not used transmission of the current I frame has to be stopped if its NS is not equal to the NR of the received reply Otherwise transmission of this I frame is continued and the retry flag should not be set up This increases protocol performance as well 3 2 5 4 The V 42 Transmitter The structure of the V 42 transmitter is shown in Fig 3 2 6 The following subsections give more detailed information about implementation of some of these blocks from from RX I Frame storage Frame handler Decision Bo TX I Frame storage V 42 Control and State unit Tx uart data g V 42bis d Bit level output amp FCS generation Figure 3 36 Structure of the V 42 transmitter 3 2 5 5 Frame Capsulation and Sending Data The transmitter operates in four states when it sends data according to the V 42 protocol V42 DECISION BOX V42 DATA SENDING V42 FCS SENDING and V42 FLAG SENDING When the decision box receives control it has to make a decision on what frame to send If there is no frame t
51. channel MOTOROLA Chapter 3 Module Descriptions 3 125 For More Information On This Product Go to www freescale com V 42 Error Correction Freescale Semiconductor Inc v42 viewbits Call s uint32 v42 viewbits V42 DATA STRUCT dp uint32 value uint32 n Arguments Table 3 51 v42 viewbits arguments dp in Pointer to the V42 data structure value inout Pointer to the memory space where read bits are placed in Number of bits to read Description Returns Code example This function reads n bits from the rx buffer but they remain in the rx buffer Read bits are placed into the Isb of the variable pointed to by value The rest of the bits of that variable are cleared V42 READ SUCCESS if the rx buffer contains the required number of bits and V42 RX BUFFER EMPTY otherwise uint32 status value V42 DATA STRUCT dp channel 5Rx control ptr data handler ptr status v42 viewbits dp amp value 17 if status V42 READ SUCCESS 3 126 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42bis Data Compression Protocol 3 3 V 42bis Data Compression Protocol 3 3 1 Protocol Background Information The V 42bis algorithm defines a loss less single pass real time compression scheme It uses a variant of the Lempel Ziv Welch LZ
52. eae deed 3 155 3 66 WS UNC DIES aro Unie mts ae ze soc oie drea ie hu bun Me et UE ave 3 157 3 67 RX VS DH Tilt EE 3 161 3 68 Rx V8 ENEE HE arguments tee EE te 3 162 3 69 VS get DitS ATOUMCIG Ts 3 164 3 70 1ncf5407 wart init atgutnents ses sc e eese da she sine cha Re eh desdantasdesaetoundoeets 3 170 3 71 mcf5407 uart parameters set arguments enne nennen enne 3 171 3 72 mcf5407 uart interrupt mask set argument 3 172 3 73 Rx Wart cuan ME m 3 173 3 74 dE EE 3 174 3 75 Tk Mart UE TT ET 3 175 3 76 out char Ee EEN 3 177 3 77 out sample codec arguments eegend UII specdeiaeedandaaussacneaseoead 3 180 3 78 hem Control arguments odie once petite aco ode qu ed eq ena 3 182 3 79 daas init argurtients io e dera eee tue esc AE fts 3 185 3 80 dau codntry s t areumehls et ch agri e edita addita acad E E ed ua tesa anti Rn 3 186 3 81 dau rX level Set are Wnelils EES 3 187 3 82 daa 1 level set arguments ee en LIEN Ie eS USA HER ERE T E A E aiat 3 188 3 83 daa aout level set ars mentS oec eerte rage ie adeo ie qe avv egeat n 3 189 MOTOROLA Tables xi For More Information On This Product Go to www freescale com Table Number 3 84 3 85 3 86 3 87 3 88 3 89 3 90 3 91 3 92 3 93 3 94 3 95 3 96 3 97 3 98 3 99 3 100 3 101 3 102 3 103 3 104 3 105 3 106 3 107 3 108 3 109 3 110 3 111 3 112 3 113 3 114 3 115 3 116 3 117 3 118 3 119 3 120 3 121 3 122 3 123 3 124 Xii Freescale Semiconductor Inc Tabl
53. ee ee kK struct Rx ring det t uintl6 number on uint16 number off be The Rx_ring_det_t structure parameter descriptions number on Current number of positive ringing signals It is initialized in Rx ring der init to 0 e number off Current number of negative ringing signals It is initialized in Rx ring det init to 0 3 210 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc Rx ring det init Call s void Rx ring det init struct channel t channel Arguments struct Rx ring det t Rx ring det Table 3 98 Rx ring det init arguments channel in Pointer to the Channel control data structure Rx ring det in Pointer to the Ring detector control data structure Description Returns Code example This function initialises the Ring detector control data structure It also initializes the fields of the Channel control data structure pointed to by channel that are responsible for the Rx Data Pump data pump ptr baud rate number samples data pump call func state process count After calling this function the Rx Data Pump is initialized to work according toV 23 This function is called in state_machine None struct channel t channel struct Rx ring det t Rx ring det Rx ring det init amp channel amp R
54. freescale com Data Pump Freescale Semiconductor Inc Tx V21 handshake init Call s void Tx V21 handshake init struct channel t channel Arguments Table 3 3 Tx V21 handshake init arguments channel in Pointer to the Channel control data structure Description Returns Code example This function initializes the fields of the Channel control data structure pointed to by the channel that are responsible for the Tx Data Handler data handler ptr data handler state data handler call func number n bits After calling this function the Tx Data Handler is initialized to perform the Tx V 21 Handshake sequence This function is called in state machine None struct channel t channel Tx V21 handshake init amp channel MOTOROLA Chapter 3 Module Descriptions 3 7 For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc Tx V21 handshake routine Call s void Tx V21 handshake routine struct channel t channel Arguments Table 3 4 Tx V21 handshake routine arguments channel in Pointer to the Channel control data structure Description This is the Tx V 21 Handshake Data Handler routine This function places OxFF values sequence of 1 s into the Tx data buffer This function is called by the 7x data handler function via the channel Tx control ptr data handler call func Re
55. from the variable value and stores only x nbits data bits to be put into the Tx data buffer Tx data write Tx control data Inline function Further description can be found in chapter 2 6 2 Circular Buffer Inline functions n tx nbits After sending x nbits data bits n must be decremented by x nbits value value tx nbits tx nbits data bits are subtracted from the variable value if n tx nbits amp amp n 0 for j 0 j tx nbits n j value value 1 nj If the remaining data bits are greater than O and less then tx_nbits the element must be filled up with 1 s to contain tx_nbits data bits MOTOROLA Chapter 3 Module Descriptions 3 143 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module 3 5 2 Rx V 14 Data Handler The Rx V 14 Data Handler takes encoded data from the Rx data buffer decodes it and puts the decoded data into the Rx uart data buffer The Rx data buffer contains rx nbits data bits in each element The Rx uart data buffer contains a data character 8 data bits in each element The Rx V 14 Data Handler gets the data from the Rx data buffer and stores it in the internal rx buffer using the vl4 get bits function decodes the data using the Rx V14 DH routine function and puts the encoded data into the Rx uart data buffer using the Rx uart data write function see
56. go to the ATP BUFFER HANDLING State case ATP_CR_WAIT This case is used for processing the second Enter symbol Enter symbol can contain two characters CR and LF their values are specified in the modem h file If the Enter symbol contains two characters the second character will be read from tx_uart data The AT Parser then goes to the aTP_BUFFER_HANDLING State case ATP_BUFER_HANDLING In this case the AT Parser at first determines the number of characters in the at_command_string and ignores all space characters Then the AT Parser interprets commands and parameters in the at_command_string according to the V 25ter ITU T specification stores the interpreted commands into the local at command buf buffer and if no error has occurred places the contents of the at command buf buffer into the command buffer for these commands to be handled by the AT Command Handler In the case of arp_onLINE_ DATA MODE the AT Parser only monitors the tx_uart_data buffer to determine the escape sequence 3 236 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions command parameter identification Call s int16 command parameter identification struct channel t channel int16 current k intl6 min intl6 max uint32 command code Arguments Table 3 122
57. guard tone which is then added to the main signal For V 22bis the frequency of the guard tone is 1800 Hz 20 Hz or 550 20 Hz and is only transmitted when the modem is transmitting in the high channel carrier frequency is 2400 Hz 3 1 7 2 QAM receiver This subsection describes the functional blocks required to implement a QAM receiver The receiver structure is more sophisticated than that of the transmitter An overall diagram of the modem receiver is shown in Fig 3 1 7 3 The basic structural blocks of the modem receiver are the input bandpass filters the fixed equalizer the automatic gain control AGC the demodulator the adaptive equalizer the decision block the decoder the descrambler the carrier recovery and the clock recovery I nTs S aTs BPFI M Figure 3 26 QAM modem receiver block diagram 3 1 7 2 1 Bandpass filters The input signal is bandpass filtered for the following reasons Rejection of out of band noise including the rejection of the transmit signal spectrum Introduction of 90 degree relative phase shift required for I and Q channel separation Fixed equalization for line distortion In the current implementation a 38 tap bandpass FIR filter is used 3 82 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 7 2 2 Automatic Gain Control AGC
58. handler parameters t data handler parameters Arguments Table 2 32 load data handler parameters arguments channel in Pointer to the Channel control data structure data handler parameters in Pointer to the Data handler parameters structure Description This function loads the parameters of channel Tx control ptr and channel Rx control ptr concerning the Data Handler data handler ptr data handler call func number n bits from the data handler parameters structure This function is called in state machine Returns None Code example struct channel t channel struct data handler parameters t data handler parameters save data handler parameters amp channel amp data handler parameters load data handler parameters amp channel amp data handler parameters MOTOROLA Chapter 2 General Architecture 2 57 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface 2 58 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Chapter 3 Module Descriptions The following sections describe each module associated with the Soft Modem including ITU T V series modems asynchronous synchronous converters general telephony call progress signal generators detectors and other support modules 3 1 Data Pump The data pump is the hea
59. if the receiver is in calling mode and FALSE if the re ceiver is in answering mode mode in Defines mode for the channel No 2 It can be equal to e V23 MODE 600 Mode 1 600 bauds e V23 MODE 1200 Mode 2 1200 bauds Description This function sets the fields of the FSK receiver control data structure pointed to by the Rx control FSK f space f mark lpf_coef filter size and calls FsK_demodulator_init It also initializes the fields of the Channel control data structure pointed to by the channel that are responsible for the Rx Data Pump data_pump_ptr baud_rate number_samples data_pump_call_func state n_bits n_bits_mask process_count After calling this function the Rx Data Pump is initialized to work according to V 23 This function is called in state_machine Returns None Code example struct channel t channel struct Rx control FSK t Rx control FSK bool calling TRUE Rx V23 init amp channel amp Rx control FSK calling V23 MODE 600 MOTOROLA Chapter 3 Module Descriptions 3 15 For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc Tx V23 handshake init Call s void Tx V23 handshake init struct channel t channel Arguments Table 3 9 Tx V23 handshake init arguments channel in Pointer to the Channel control data structure Description Returns Code example This function initializes th
60. is initialized in function QAM modulator init filter coef Coefficients of the BPF This field is initialized in function QAM modulator init filter buf I Cyclic buffer used by the filter algorithm of the I channel This field is initialized in function QAM modulator init to 0 filter buf Q Cyclic buffer used by the filter algorithm of the Q channel This field is initialized in function QAM modulator init to 0 filter buf ptr Pointer to the current element of the filter buf This field is initialized in function QAM modulator init 3 1 7 4 QAM demodulator control structure typedef struct Rx control QAM t uint32 f carrier uintl6 carrier phase uintl6 carrier phase incr uintl6 baud frac MOTOROLA Chapter 3 Module Descriptions 3 89 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump uintl6 baud incr uint32 filter size intl6 filter mark i RX QAM FIXED EQ COEF NUMBER intl6 filter mark q RX QAM FIXED EQ COEF NUMBER int16 filter buf RX QAM FILTER BUF SIZE uint32 filter buf ptr bool decision enabled scrambler call func t descrambler bool descrambler enabled uint32 descrambler register intl16 constellation phase quadrant uint8 phase quadrant change uint8 last quadrant intl6 constellation treshold intl6 noise threshold intl6 agc uint32 agcave int16 avecnt intl6 smax intl16 CPLL1 intl6 CPLL2 int
61. lo s lowest level routines for the MCF5407 vector s MCF5407 vector table int handlers c interrupt handlers sysinit c power on reset configuration of the MCF5407 ads 68K mw c linker command file mwerks h defines constants used by the CodeWarrior Preprocessor Quick Start Carefully follow these steps to prepare the LDR Soft Modem for operation Properly install and set up the Soft Modem daughter card The daughter card can be installed on the M5407C3 evaluation board the wrong way Please ensure thatthe daughter card is correctly fitted before applying power The Motorola logos on the two cards must be read the opposite way up to each other for correct operation When correctly installed the RJ11 connector will be towards the PCI socket of the main board and the speaker will be adjacent to the DIMM memory card Figure 1 1 shows the correctly installed daughter card and its jumper settings for correct communication with the M5407C3 evaluation board anh JP2 JP3 MOTOROLA L M5407C3 CF Modem Card Bjo10J0Yy W013 VNaIepbi DigitalDNA From Motorola VIOYOLC Figure 1 1 Modem Daughter Card Installation Jumper Settings Proper set up of the M5407C3 evaluation board To setup the M5407C3 evaluation board refer to the M5407C3 User s Manual R1 1 When you are preparing the board for the first time be sure to check that all jumpers are in the correct locations In practice the lo
62. nbits n tx nbits z0 Calculates how many elements in the Tx data buffer are required for n current data bits according to the current value of tx nbits As you can see on the Fig 1 2 each element in the Tx data buffer contains tx nbits data bits only in Fig 1 2 tx_nbits 3 The other bits in the Tx data buffer element are not used In this case the n 10 bits must be split into portions each 3 bits long so that each portion can be placed in a separate Tx data buffer element Example 1 n 10 tx nbits 3 There are 3 portions of 3 bits and one portion of 1 bit Portions of 3 bits must be put in elements 0 2 of the Tx data buffer the last portion of one bit must be filled up with 1 s see if n tx nbits amp amp n 0 in the v14 put bits function and must be put into element 3 of the Tx data buffer Filling up with 1 s is required to eliminate misunderstanding 0 s as the beginning of the character 3 142 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module Example 2 n 10 tx_nbits 2 There are 5 portions of 2 bits It isn t required to fill any portions with Us The data pump takes only tx nbits bits from each Tx data buffer element Example data value data 32 tx nbits data gt gt 32 tx nbits The variable data gets data bits
63. o EEGEN Rx V23 hadshake state t enum RX V23 DH DETECT ONES RX V23 DH WAIT SEND RX V23 DH WAIT CARRIER CC e e ke e ke ke ke ok ke ke kk ooo kk ke kk ok ok ok ok ok eee ob ob ee b b o o o o ooo o e e e e e e e e e e e Rx V 23 Handshake control data Structure RR RR RRR kk kk ok o e e oe ee oe o EEGEN struct Rx V23 DH handshake t 3 12 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump enum Rx V23 hadshake state t state uint32 det ones ms uint32 wait send ms uint32 wait carrier ms uint32 current counter uint32 global counter The Rx v23 DH handshake t Structure parameter descriptions state Current state of the Rx V23 Handshake Data Handler It can be equal to RX V23 DH DETECT ONES The Handshaker is trying to detect det ones ms ms of binary 1 s RX V23 DH WAIT SEND The Handshaker remains silent for a period of wait send ms ms before transmitting binary 1 s RX V23 DH WAIT CARRIER The Handshaker remains in this state during wait carrier ms ms on the completion of the state the modem shall be ready to transmit and receive actual data It is initialized in Rx_V23_handshake_init to R amp V23 DH DETECT ONBS det ones ms Duration of binary 1 s detection in ms It is initialized in Rx V23 handshake init to 155 ms wait s
64. parameters may cause incorrect V 42bis function behavior or a system crash The valid parameter conditions can be found in the Description subsection for each routine 3 132 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Overview v42bis Init Call s void v42bis Init v42bis t dp uintl6 pl uint8 p2 Arguments Table 3 53 v42bis Init arguments dp in pointer to the V 42bis control data structure pi in Maximum number of codewords p2 in Maximum V 42bis string length Initializes the data compression function according to the CCITT Recommendation V 42bis section 7 2 The function initializes the V 42bis data structure according to the negotiated parameters The routine shall be invoked immediately after XID negotiation by the V 42 protocol The correct v 42bis function behavior is expected to adhere to the following conditions e 512 lt pl lt 65535 e 6 lt p2 lt 250 according to the CCITT Recommendation V 42bis Description Returns None Code example v42bis t v42bis uint16 code words num uint8 max str length v42bis Init amp v42bis code words num max str length MOTOROLA Chapter 3 Module Descriptions 3 133 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation
65. protocol used the value of tx nbits can be changed Tx control n bits contains the number of tx nbits The v14 put bits function divides the encoded data by tx nbits data bits and puts the result into the Tx data buffer The general operation of the Tx V 14 Data Handler is shown in Figure 3 41 Figure 3 41 Tx V 14 Data Handler 3 138 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Freescale Semiconductor Inc The V 14 Software Module If the Tx uart data buffer doesn t contain any data the Tx V 14 Data Handler puts all 1 s into the Tx data buffer using the v14 put bits function according to the ITU V 14 Recommendation Transmitter Receiver qArHN Figure 3 42 General Data Flow According to the V 14 Recommendation The Tx V 14 Data Handler contains the following functions Tx_V14_DH_init Tx_V14_DH_routine and v14_put_bits MOTOROLA Chapier 3 Module Descriptions 3 139 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module Tx V14 DH init Call s void Tx V14 DH init struct channel t channel Arguments Table 3 58 Tx V14 DH init arguments channel in Pointer to the Channel control data structure Description Initialisation of the Tx V14 Data Handler The Tx V14 Dat
66. ring validation Preis fo ewm Ji PU I VW d Po For75ms i Ra AN UL NE Figure 3 1 Timing diagram of the V 21 Handshake sequence 3 2 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump The V 21 Handshake routines can be found in the v21 c file The Rx V 21 Handshake control data structure Rx V2 DH handshake t is defined in the v2 h file CC e e e ke ke ke ke ke ko ko koe kk kk ok kk ok ok ok ee He ob ob ee ee e o e e e o oo e e e e e e e e e e States of Rx V21 Handshake Data Handler RR RR RR kk kk ke kk e oe e oe oe oe oe ob ee b o ob b b o ok ok ok ok o o e ooo E EE e e e ee e e ee ee e oe e e e enum Rx V21 hadshake state t RX V21 DH DETECT ONES RX V21 DH WAIT SEND RX V21 DH WAIT CARRIER RC e e ke ke ke ke ke ke kk ko kk ooo kk kk kk oe o e e oe e e e ob ob oe o ee e o e ko e e e e e e e e e e e Rx V 21 Handshake control data Structure Hk RR RRR RR RR kk e o ke e e e oe oe oe oe ee EEGEN struct Rx V21 DH handshake t enum Rx V21 hadshake state t state uint32 det ones ms uint32 wait send ms uint32 wait carrier ms uint32 current counter uint32 global counter M The Rx v21 DH handshake t Structure parameter descriptions e state Current state of the Rx V21 Handshake Data Handler It can be equal to RX V21 DH DETECT ONES The Handshaker is trying to detect
67. samples for detecting tone ON It is initialized in Rx_tone_init to 0 tone_off_samples_left Number of samples left for detecting tone OFF It is initialized in Rx_tone_init to 0 detection_saples_left Number of samples left for the detection process It is initialized in Rx_tone_init to 0 tone_on_detected It is equal to TRUE if tone ON is detected and to FALSE otherwise It is initialized in Rx_tone_init to O tone_all_detected It is equal to TRUE if a tone is detected ON and OFF phases and to FALSE otherwise It is initialized in Rx_tone_init to TRUE process count Maximum number of phases ON OFF left for the whole tone detection It is initialized in Rx tone init enabled It is equal to TRUE if the Tone detector is enabled and to FALSE otherwise It is initialized in Rx tone init CCo ke ke e e e e e ok ke e ko e e e e e oe e e e ok ke e e e e e oe ke ek e e e e e e e o e e ke e e e e e e oe e e o e e e ee e 3 206 Tone detector Control Structure MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules ko ke e e e e ke ke e o ok ke e e e o e o ke o ke e ee e o ke o o ke e ee o e o ke ko e e e e e e ke e e ko e ee ee kK define DET TONE NUMBER 3 struct Rx control tone t struct Rx tone t tone DET TONE NUMBER Rx control tone tis a root structure
68. state State identifier It contains the current sub state of the Rx V8 Data Handler It is initialised in Rx V8 DH init to V8 TEN ONES e CM OK counter Counter of the received CM messages It is initialised in Rx VS DH init to 0 MOTOROLA Chapter 3 Module Descriptions 3 157 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module 3 158 ones counter Counter of the 1 s preceding each information sequence It is initialised in Rx V8 DH mc to 0 CJ counter Counter of the received CJ messages It is initialised in Rx VS DH init to 0 mod octet numb Contains 0 if the number of received modulation octets is modn1 and 1 if the number of received modulation octets is modn2 It is initialised in Rx_V8_DH_init to 0 null count Specifies the number of received 0 s to determine the carrier loss It is initialised in Rx_V8_DH_init to 0 zeros CJ Counter of the 0 s in the Synchronization sequence it contains 9 0 s and one 1 It is initialized in Rx V8 DH uinit to 0 modn0O oct Boolean variable The JM message will include the same octets as in the CM message modnO oct is TRUE if the received CM message contains the modnO octet It is initialised in Rx V8 DH init to TRUE if the Soft Modem is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode modnl oct Boolean variable The J
69. t channel Arguments Table 3 12 Rx V23 handshake routine arguments channel in Pointer to the Channel control data structure Description This is the Rx V 23 Handshake Data Handler routine This function reads data symbols from the Rx data buffer The function performs and controls the V 23 Handshake sequence see 3 1 2 2 After successful completion of the Handshake sequence it sets channel Rx control ptr 2data handler state to RX DH STATE COMPLETED otherwise to RX DH STATE FAILED This function is called by the Rx data handler function via the channel Rx control ptr data handler call func Returns None Code example struct channel t channel Rx V23 handshake routine amp channel MOTOROLA Chapter 3 Module Descriptions 3 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 3 V 22 The V 22 modem is intended for use on connections on the General Switched Telephone Network GSTN and on point to point circuits when suitably conditioned This is a full duplex modem with the receiver and transmitter sharing the available bandwidth of the communication channel This modem can operate in either originate or answer mode In the originate mode it initiates the communication process transmits with a carrier frequency of 1200 Hz and receives at the frequency of 2400 Hz At the other end of the communications chan
70. tab2 k k 0 The function is used for realization of the Finite Impulse Response FIR filters Returns Result of the S tabllk tab2jk Calculation k 0 Code example define TAB SIZE 16 int16 tabl TAB SIZE int16 tab2 TAB SIZE intl6 result convolution result convolution dsp convolution frac tabl tab2 TAB SIZE 3 230 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions memcpy mcf Call s void memcpy mcf void dest void src uint32 n Arguments Table 3 119 memcpy mcf arguments dest in Pointer to the destination src in Pointer to the source n in Number of bytes Description This function copies n bytes pointed to by src to the destination to pointed by dest Returns None Code example define TAB SIZE 16 intl6 dest TAB SIZE intl6 src TAB SIZE memcpy mcf dest src TAB SIZE sizeof intl6 3 8 1 AT command set support The LDR Soft Modem implements the AT command set The AT command set is the user interface and in an embedded application it is the basis of the API The AT commands allow the user to alter the operation of the Soft Modem in real time These commands are sent to the system via the UART from an RS 232 connected terminal device Please refer to the MCF5407 Low Data Rate Soft Modem AT Command refe
71. the DPSK transmitter and DPSK receiver In the following subsections the operation of the modem transmitter and receiver are described The transmitter accepts data bits from the Data Terminal Equipment DTE It then performs the necessary processing in order to place this data into the proper form for transmission through the Public Switched Telephone Network This process basically consists of the modulation of the baseband information logical 1 s and 0 s sent by the DTE into the passband of the communications channel for transmission The receiver collects the information from the telephone network and converts it back into its original form i e the bits sent by the DTE The dpsk c module consists of two main blocks the DPSK transmitter and the DPSK receiver These blocks are called the data pump They are executed every time the Tx sample buffer is almost empty the modulator or TX data pump is executed or when Rx sample is full enough the demodulator or RX data pump is executed They are called from the modem c module 3 1 6 1 DPSK transmitter In Differential Phase Shift Keying the information is encoded as the phase change of the transmitter carrier With n denoting the phase that contains the information to be transmitted the transmitted signal s n is represented mathematically by s n A cos n o n 1 Where is the carrier frequency The parameter A determines the amplitude of the transmitted signal It can
72. when it gets data according to the V 42 protocol V42 GETTING FLAG and v42 GETTING DATA In the v42_ GETTING FLAG State it monitors the rx buffer in order to recognize a frame opening flag 01111110 is a frame opening and a frame closing flag Each frame has to 3 108 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction be preceded with a frame opening flag and a frame closing flag must follow the frame The closing flag for one frame can serve as an opening flag for the next frame Until any flag is recognized the receiver extracts bit by bit from the xx buffer using the v42 getbits dp amp value 1 FALSE function If a flag is recognized but it is not a frame opening flag other flag follows this one the receiver gets it using the v42 getbits dp amp value 8 FALSE function The last parameter determines whether a read is performed discarding transparent bits TRUE or not FALSE When a frame opening flag is received index and size variables are initialized to their default values The receiver changes its state tO v42 GETTING DATA When the receiver gets a frame it places the contents of the value variable into the rx frame buffer Filling of the rx frame buffer with a frame starts from the end of buffer that is the first byte of the frame will be place into the last byte of the buffer t
73. write amp Tx control sample MOTOROLA Chapter 2 General Architecture 2 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx sample read Call s inline int16 Tx sample read struct Tx control t Tx control Arguments Table 2 6 Tx sample read arguments Tx control in Pointer to the Transmitter control data structure Description This function reads the value of the current element in the Tx sample circular buffer pointed to by 7x control sample tail then updates 7x control sample tail to the next position in the buffer Returns Value of the element pointed to by Tv control sample tail Code example struct Tx control t Tx control intl6 sample sample Tx sample read amp Tx control 2 26 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Interface Freescale Semiconductor Inc Rx sample write Call s inline void Rx sample write struct Rx control t Rx control intl6 sample Arguments Table 2 7 Rx sample write arguments Rx control in Pointer to the Receiver control data structure sample in Sample for writing to the Rx sample circular buffer Description This function writes the sample into the Rx sample circular buffer to the position pointed to by Rx_control gt sample_head then updates Rx con
74. 07 processors for use by software developers The information in this book is subject to change without notice as described in the disclaimers on the title page of this book As with any technical documentation it is the readers responsibility to be sure he is using the most recent version of the documentation To locate any published errata or updates for this document refer to the world wide web at http www motorola com coldfire Audience This manual is intended for system software developers who want to develop products with the MCF5407 It is assumed that the reader understands operating systems microprocessor system design basic principles of software and hardware and basic details of the ColdFire architecture Suggested Reading This section lists additional reading that provides background for the information in this manual as well as general information about the ColdFire architecture General Information The following documentation provides useful information about the ColdFire architecture and computer architecture in general ColdFire Documentation The ColdFire documentation is available from the sources listed on the back cover of this manual Document order numbers are included in parentheses for ease in ordering e ColdFire Programmers Reference Manual R1 0 MCF5200PRM AD e ColdFire MCF5407 User s Manual 0 1 MCF5407UM AD Motorola M5407C3 User s Manual R1 1 M5407C3UM AD Silicon Laboratories
75. 2 SM V8 HANDSHAKING STATE e At the end of Answer Tone generation if V 8 is enabled 3 SM INIT AFTER ANSWERTONE PA USE STATE e At the end of Answer Tone generation if V 8 is disabled 4 SM RESET COMMAND STATE e On the reception of any character from the DTE SM INIT ANSWERTONE DET STATE If AT X3 or X4 is set it adds the Busy tone detection to the Tone Detector It also adds the End of Answer ANS Tone detection to the Tone Detector If V8 protocol is enabled S 19 register it adds the ANSam tone detection to the Tone Detector SM ANSWERTONE DET STATE SM ANSWERTONE DET STATE Calls the Tx Data Pump Silence generator and the Rx Data Pump Tone Detector On the receipt of any character from the DTE it goes on hook and sends the NO CARRIER response to the DTE If the Busy Tone was detected it goes on hook and sends the BUSY response to the DTE If no tones were detected during a fixed period of time it goes on hook and sends the NO ANSWER response to the DTE 1 SM ANSWERTONE DET STATE e By default 2 SM INIT ON LINE STATE e When the End of Answer ANS Tone is detected 3 SM INIT V8 HANDSHAKING STATE e When the ANSam Tone is detected 3 SM RESET COMMAND STATE e On the reception of any character from the DTE e When no tones were detected during a fixed period of time e When the Busy tone is detected SM INIT V8 HANDSHAKING STATE Initialises the V 8 Rx a
76. 22bis Handshake Data Handler routine Writes sequences of 1 s or S1 into the TX data buffer depending on the state of the TX handshake data handler This function is called by the 7x data handler function via the channel Tx control ptr data handler call func Returns None Code example struct channel t channel Tx V22bis handshake routine channel MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 49 Freescale Semiconductor Inc Data Pump Tx V22bis change mode Call s void Tx V22bis change mode struct channel t channel enum v22bis mode t mode Arguments Table 3 31 Tx V22bis change mode arguments channel in Pointer to the channel control data structure mode in Specifies the mode to switch to either 2400 b s or 1200 b s Description Changes the mode of the Tx V22bis Data Pump to 1200 bit s or to 2400 bit s by assigning new values to n bits the number of bits in symbol n bits mask the mask for retrieving n bits from the byte and constellation phase quadrant the constellation points Returns None Code example struct channel t channel Tx V22bis change mode channel V22BIS MODE 1200 3 50 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V22bis change mode Call s
77. 2400 bit s When 32 consecutive scrambled binary Us at 2400 bit s have been detected in the low channel the modem shall be ready to receive data at 2400 bit s Handshake sequence for calling modem 1200 bit s operation The following handshake is identical to the Recommended V 22 handshake a b c d On connection to the line the calling modem shall be conditioned to receive signals in the high channel at 1200 bit s and transmit signals in the low channel at 1200 bit s The modem shall initially remain silent After 155 10ms of unscrambled binary 1 s have been detected the modem shall remain silent for a further 456 10ms then transmit scrambled binary 1 s at 1200 bit s On detection of scrambled binary 1 s in the high channel at 1200 bit s for 270 40ms the modem shall be ready to receive data at 1200 bit s 765 10ms after that the modem shall be ready to transmit data at 1200 bit s Handshake sequence for answering modem 1200 bit s operation The following handshake is identical to the Recommended V 22 handshake a On connection to the line the answering modem shall be conditioned to transmit sig nals in the high channel at 1200 bit s and receive signals in the low channel at 1200 bit s Following transmission of the answer sequence in accordance with V 25 the modem shall transmit unscrambled binary 1 s at 1200 bit s b On detection of scrambled binary 1 s in the low channel at 1200 bit s for 270 40ms M
78. 3 10 d m d nT Figure 3 10 V 22bis descrambler 3 1 4 3 Handshake The handshake sequence for achieving synchronization between calling and answering modems is shown in Figure 3 11 If both calling and answering modems are V 22bis modems the handshake will normally condition both modems to operate at 2400 bit s If however one or both of the modems has been set to operate at 1200 bit s then the handshake will condition both modems to operate at 1200 bit s If either the calling or answering modem is a V 22 modem the handshake will condition both the V 22bis and V 22 modem to operate at 1200 bit s MOTOROLA Chapter 3 Module Descriptions 3 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump pet Detect 32 i consecutive Le Begin 16 TT io wa Detect i i decisions Unscrambled Ones E 3 Aa od i i for 155ms 1 Le 3 w TA DU IM aes deeds gt Connect Silence i o Scrambled Es Scrambled Is mm 3 at 1200 bit s i at 2400 bius line amp dial 7 i Enablingof 7 i Adaptive i Connect S to line Scrambled 1 s Scrambled e after ring at 1200 bit s at 2400 bit s validation Detect 32 i consecutive IN i For 75ms e Figure 3 11 V 22bis handshake sequence Handshake sequence for calling modem 2400 bit s operation a b c d e 3 36 On connection to th
79. 38 Tx V T4 Data H ndlet uo eie orte tre ederet ie eco sese let eoi din 3 139 General data flow according the V 14 Recommendation esses 3 140 The Rx V4 Data handler eoa ctr t edi aliens eden 3 145 de 3 203 TONE sete Cts RM RO 3 210 Stages of the Tone Keeser 3 210 Ring Detector seien teres ae eee eta en cree ideas 3 213 KREE 3 217 PulSe dialet 5 iere atn teilte E OH te 3 220 Command Handler 1 2 ie est 3 241 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Tables Table Page Number Title Number i Acronyms and Abbreviated TermSs sse ssssesessseseseeeeseessersseeesseessseessressersseessseesssees xviii 1 1 Data Pump Protocols Supported by Soft Modem eee 1 1 2 1 The Global State Machine States eed eae RG Se 2 16 2 2 State ETH 2 22 2 3 state machine arguments enee dod euni ipea pios SER EU de 2 23 2 4 Global Data Structures eco ea EES EES 2 24 2 5 Tx sample ee 2 25 2 6 Tx_sample_read arguments E 2 26 2 7 Rx sample tte SEHR feet 2 27 2 8 Rx sampleszead arguments od e Rt 2 28 2 9 Tx data write arguments ost ea I e Pre d IRAE NER IR P Gee aeo SNO Eed 2 29 2 10 Tx data read At UTNE TUS EE 2 30 2 11 Rx data write arguments eee i dye SU EENHEETEN 2 31 2 12 Rx data redd ACS ISIN toa Ee 2 32 2 13 Tx_uart_data_write ate He ne
80. 8 to str decimal arguments num str in out Pointer to an output null terminated string num in Unsigned number Description This function converts the unsigned number num into a null terminated string in the decimal form and places it into the string pointed to by num str For example if num 128 then num_str 128 Returns The number of characters in the num_str string for representing the Code example char tmp_str 4 uint8 digit_num input number in the decimal form For the example above it returns 3 digit num uint8 to str decimal tmp str 100 MOTOROLA Chapter 3 Module Descriptions 3 227 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions uint8 to str hexadecimal Call s uint8 uint8 to str hexadecimal char num str uint8 num Arguments Table 3 116 uint8 to str hexadecimal arguments num str in out Pointer to an output null terminated string num in Unsigned number Description This function converts the unsigned number num into a null terminated string in the hexadecimal form and places it into the string pointed to by num str For example if num 43 then num_str 2B Returns The number of characters in the num_str string for representing the input number in the hexadecimal form For the example above it returns 2 Code example char tmp_str 3 uint8 digit num digit num uint8 to str he
81. AIN NOISE THRESHOLD This field is initialized in function QAM demodulator init to 0 MOTOROLA Chapter 3 Module Descriptions 3 95 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump QAM modulator init Call s void QAM modulator init struct channel t channel Arguments Table 3 41 QAM modulator init arguments channel in Pointer to the channel control data structure Description Initialization of the QAM transmitter control structure Tx control QAM t The pointer to this structure is contained in channel Tx control ptr data pump ptr Fills up the appropriate fields of this structure with default values carrier phase baud frac scrambler register and so on refer to Section 3 1 7 4 for more details This function is called by the Tx V22bis init functions of the v22bis c module Returns None Code example struct channel t channel QAM modulator init channel 3 96 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc QAM modulator Call s void QAM modulator struct channel t channel Arguments Table 3 42 QAM modulator arguments channel in Pointer to the channel control data structure Description This function performs all operations of the QAM transmitter It gets bits of data
82. AM modulator init amplitude carrier Amplitude of the output signal This field is initialized in function 7x V22bis init MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump amplitude guard Amplitude of the Guard tone signal This field is initialized in function 7x V22bis init scrambler Pointer to the scrambler function This field is initialized in function Tx_V22bis_init scrambler enabled Indicates if the scrambler is enabled This field is initialized in function QAM_modulator_init to TRUE scrambler_register Shift Register used by the scrambler This field is initialized in function QAM modulator init to 0 constellation phase quadrant Pointer to the signal constellation of the first quadrant This field is initialized in function Tx V22bis init phase quadrant change Quadrant change according to the first two bits of quadbit This field is initialized in function 7x V22bis init current I Current In phase signal for modulation This field is initialized in function QAM modulator init to 0 current Q Current Quadrature phase signal for modulation This field is initialized in function QAM modulator init to 0 current quadrant Current Phase Quadrant This field is initialized in function QAM modulator init to 0 filter size The number of coefficients used by the BPF This field
83. AND STATE Calls the Tx amp Rx Data Handlers e By default Calls the Command Parser and the 2 SM ON LINE STATE Command Handler e On an AT O command On the break of line event it goes 3 SM INITIALIZATION STATE on hook and sends the NO CARRIER e On an AT Z command response to the DTE 2 16 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Global State Machine Freescale Semiconductor Inc Table 2 1 The Global State Machine States continued Name of the State Activities Exit States SM INIT ON LINE STATE Initialises the Rx amp Tx Data Pumps and the Rx amp Tx Data Handlers Handshaker according to the chosen protocol and speed V 21 V 23 V 22 V 22bis 1 SM PRE PHISICAL HANDSHAKING STATE e f the Channel is in the calling mode 2 SM PHISICAL HANDSHAKING STAT E e f the Channel is in the answering mode SM ON LINE STATE Calls the Tx amp Rx Data Pumps Calls the Tx amp Rx Data Handlers Calls the Command Parser for the Escape Sequence detection On the break of line event it goes on hook 1 SM ON LINE STATE e By default 2 SM INIT RETRAIN STATE e On Retrain sequence detection 3 SM RESET COMMAND STATE e On the Break of the line 4 SM INIT ON LINE COMMAND STAT E e f the Escape sequence is detected and the Go to On line command mode on escape code is set i
84. Arguments None Description This function controls the value of the H 3 register Current Data Pump Protocol If the H 3 register is equal to H3 DP NONE Data Pump protocol is not chosen the function makes a decision about the Data Pump protocol on the basis of the S 19 register Data Pump protocol defined by user after that it changes the H 3 register to correspond to that Data Pump protocol This function is called in state machine Returns None Code example choose data pump protocol 3 244 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Alphabetical List of Functions AT handler init 3 242 AT handler routine 3 243 AT parser init 3 235 AT parser routine 3 236 char present uart 3 178 char to dte 3 227 choose data pump protocol 3 245 command buf write 3 240 command handler 2 53 command parameter identification 3 238 command parser 2 52 command read 2 38 command write 2 37 daa aout level set 3 189 daa aout mute 3 190 daa country set 3 186 daa go off hook 3 192 daa go on hook 3 193 daa init 3 185 daa read reg 3 194 daa ring detect 3 191 daa rx level set 3 187 daa tx level set 3 188 daa write reg 3 195 DPSK_demodulator 3 79 DPSK demodulator init 3 78 DPSK modulator 3 77 DPSK modulator init 3 76 dsp convolution frac 3 231 dep cos 3 230 flow control 3 182
85. DPSK modulator init baud frac Fractional part of the baud in Q14 format i e 0 5 the middle of the baud This field is initialized in function DPSK modulator init to 0 baud incr Increment to baud frac per sample in Q15 format This field is initialized in function DPSK modulator init omega ptr Pointer to Nbits to Phase Change Correspondence table This field is initialized in function 7x V22 init current nbits N bits of data for modulation This field is initialized in function DPSK modulator init to 0 amplitude carrier Amplitude of the output signal This field is initialized in function 7x V22 init amplitude guard Amplitude of the Guard tone signal This field is initialized in function 7x V22 init scrambler Pointer to the scrambler function This field is initialized in function Tx V22 init scrambler enabled Indicates if the scrambler is enabled This field is initialized in function DPSK modulator init to TRUE scrambler register Shift Register used by the scrambler This field is initialized in function DPSK modulator init to 0 filter size The number of coefficients used by the BPF This field is initialized in function DPSK modulator init filter coef Coefficients of the BPF This field is initialized in function DPSK modulator init filter buf Cyclic buffer used by the filter algorithm of the input BPFs This field is initialized in function DPSK modulator init to 0 filter bu
86. Description This function writes data into the Tx data circular buffer to the position pointed to by Tx control data head then updates Tx control data headto the next position in the buffer Returns None Code example struct Tx control t Tx control uint8 data 0 Tx data write amp Tx control data MOTOROLA Chapter 2 General Architecture 2 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx data read Call s inline uint8 Tx data read struct Tx control t Tx control Arguments Table 2 10 Tx data read arguments Tx control in Pointer to the Transmitter control data structure Description This function reads the value of the current element in the Tx data circular buffer pointed to by Tx contro1 data tail then updates Tx control data tail to the next position in the buffer Returns Value of the element pointed to by Tx control data tail Code example struct Tx control t Tx control uint8 data data Tx data read amp Tx control 2 30 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Hx data write Call s inline void Rx data write struct Rx control t Rx control uint8 data Arguments Table 2 11 Rx data write arguments Rx control in Pointer to th
87. F filters It contains the samples passed through the input BPF and AGC blocks It is initialized in FSK demodulator init to 0 s filter buf ptr Relative pointer to the current element in filter buf It is initialized in FSK demodulator init baud incr Increment to baud frac per sample in Q15 format It is initialized in FSK demodulator init baud frac Fractional part of the baud in Q15 format It is initialized in FSK demodulator init to O last bit Last demodulated bit of data 0 or 1 It is initialized in FSK demodulator init to 0 filter bpf size The number of coefficients used by the Input BPF filter It is initialized in FSK demodulator init filter bpf coef Array of coefficients of the Input BPF filter It is initialized in FSK demodulator init filter bpf buf Cyclic buffer used by the Input BPF filter It contains the samples received from the Rx sample buffer It is initialized in FSK demodulator init to Us filter bpf buf ptr Relative pointer to the current element in filter bpf buf It is initialized in FSK demodulator init agc The AGC gain correction factor in Q14 format It is initialized in FSK demodulator init to 1 in Q14 format COS BASE MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump agc average The current ave
88. FSK demodulator 3 63 FSK demodulator init 3 62 FSK modulator 3 61 FSK modulator init 3 60 global structure init 2 39 H registers init 2 45 in char uart 3 176 MOTOROLA in sample codec 3 179 load data handler parameters 2 57 mcf5407 uart init 3 170 mcf5407 uart interrupt mask set 3 172 mcf5407 uart parameters set 3 171 memcpy mcf 3 232 out char uart 3 177 out sample codec 3 180 print connect 3 224 print result code 3 222 print text response 3 223 QAM demodulator 3 99 QAM demodulator init 3 98 QAM modulator 3 97 QAM modulator init 3 96 ret connection code 3 120 Rx channel init 2 42 Rx daa 3 198 Rx data handler 2 51 Rx data pump 2 49 Rx data read 2 32 Rx data write 2 31 Rx 1dle 2 55 Rx reset 2 47 Rx ring det init 3 212 Rx ring detect 3 213 Rx sample read 2 28 Rx sample write 2 27 Rx tone 3 210 Rx tone init 3 209 Rx uart 3 173 Rx uart data read 2 36 Rx uart data write 2 35 Rx V14 DH init 3 147 Rx V14 DH routine 3 148 Rx VII handshake init 3 9 Rx V21 handshake routine 3 10 Rx V21 init 3 6 Alphabetical List of Functions Functions 1 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Rx V22 handshake init 3 29 Rx V22 handshake routine 3 30 Rx V22 init 3 28 Rx V22bis change mode 3 51 Rx V22bis handshake init 3 46 Rx V22bis handshake routine 3 47 Rx V22bis init 3 45 Rx V23 handshake init 3 18 Rx V23 handshake routine 3 19 Rx
89. Freescale Semiconductor Inc D I wy Q MOTO digital dna intelligence everywhere MCF5407SWRM D 1 2003 REV 0 MCF5407 Low Data Rate Soft Modem Software Developer s Reference Manual For More Information On This Product o to www freescale com Freescale Semiconductor Inc HOW TO REACH US USA EUROPE LOCATIONS NOT LISTED Motorola Literature Distribution P O Box 5405 Denver Colorado 80217 1 303 675 2140 or 1 800 441 2447 JAPAN Motorola Japan Ltd SPS Technical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 81 3 3440 3569 ASIA PACIFIC Motorola Semiconductors H K Ltd Silicon Harbour Centre 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 TECHNICAL INFORMATION CENTER 1 800 521 6274 HOME PAGE http motorola com semiconductors Information in this document is provided solely to enable system and software implementers to use Motorola products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document Motorola reserves the right to make changes without further notice to any products herein Motorola makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Motorola assume any liability arising out of the application or use of any product or circuit an
90. J messages The Rx V8 Data Handler takes data from the Rx data buffer using the v8 get buts function analyses received messages and transitions the Tx and Rx V8 Data Handlers into suitable states The Rx V8 Data Handler contains the following functions Rx V8 DH init Rx V8 DH routine and v8 get bits The rx vg pH t structure as defined in v8 h FC ook kk e e e e e ke ke e oo o e e e e e oe ke ke e o kk e e e e e oe e o e k e e e e oe ke ko ke e e e e e e o e e e e e e e e e Rx V 8 Data Handler Structure oko ke e e e e e e ke e ok ke e e e o e o ke e o e e e e e EE struct Rx V8 DH t enum v8 calling state type v8 calling state enum v8 state type v8 state enum v8 sub state type v8 sub state uint8 CM OK counter uint8 ones counter uint8 CJ counter uint8 mod octet numb uint8 null count uint8 zeros CJ bool modnO oct bool modnl oct bool modn2 oct bool Drot oct bool accessO0 oct bool V21 available bool V23 available bool V22 V22bis available 2 The gx vg pH t structure parameter descriptions e v8 calling state State identifier It contains the current mode of the Soft Modem It is initialized in Rx V8 DH init to CALLING TRUE if the Soft Modem is in Calling Mode and to CALLING FALSE if the Soft Modem is in Answering Mode e v8 state State identifier It contains the current state of the Rx V8 Data Handler It is initialized in Rx V8 DH init to V8 DCE CM e v8 sub
91. LA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules TX DAA WRITE REG Write register cycle It is initialized in daa_init to TK DAA NORMAL rx state Inner State of the Rx DAA It can be equal to RX DAA NORMAL Normal mode RX DAA READ REG Read register cycle RX DAA WRITE REG Write register cycle It is initialized in daa_init to RX DAA NORMAL e reg number Register number This can be a value from 1 to 19 the 813044 has 19 control registers It is initialized in daa init to 0 e value Register value It is initialized in daa init to 0 value is true Flag that the value is TRUE It is initialized in daa init to FALSE e delay Delay between sending a command and receiving a response It is initialized in daa init to 0 e sample counter Counter of received samples It is initialized in daa init to 0 MOTOROLA Chapter 3 Module Descriptions 3 183 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules daa init Call s void daa init struct channel t channel struct daa control t daa control Arguments Table 3 79 daa init arguments channel In Pointer to the Channel control data structure daa control In Pointer to the DAA Interface control structure Description This function initialises the structure pointed to by daa contr
92. LA Chapter 3 Module Descriptions 3 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Tx V22 handshake routine Call s void Tx V22 handshake routine struct channel t channel Arguments Table 3 21 Tx V22 handshake routine arguments channel in Pointer to the channel control data structure Description This is the TX V 22 Handshake Data Handler routine This function places OxFF values sequence of 1 s to the Tx data buffer This function is called by the 7x data handler function via the channel Tx control ptr data handler call func Returns None Code example struct channel t channel Tx V22 handshake routine channel 3 32 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 4 V 22bis The V 22bis modem is intended for use on connections on the General Switched Telephone Network GSTN and on point to point 2 wire leased telephone type circuits This is a full duplex modem with the receiver and transmitter sharing the available bandwidth of the communication channel This modem can operate in either originate or answer mode In the originate mode it initiates the communication process transmits with a carrier frequency of 1200Hz and receives at the frequency of 2400Hz At the other end of the
93. M PHISICAL HANDSHAKING STAT E e f the Rx Data Handler Handshaker current state is complete 3 SM RESET COMMAND STATE e On the reception of any character from the DTE e On the Break of line SM PHISICAL HANDSHAKING STATE Calls the Tx amp Rx Data Handlers Handshaker and the Tx amp Rx Data Pumps When the Rx Data Handler Handshaker current state is complete it initializes the V 14 or V 42 Data Handler and mutes the speaker on the modem daughter card On receiving any character from the DTE and on the break of the line event it goes on hook and sends the NO CARRIER response to the DTE 1 SM PHISICAL HANDSHAKING STAT E e By default 2 S5M PROTOCOL HANDSHAKING ST ATE e When the Rx Data Handler Handshaker current state is complete 3 SM INIT RETRAIN STATE e On the Retrain sequence detection 4 SM RESET COMMAND STATE e On the reception of any character from the DTE e On the Break of the line SM PROTOCOL HANDSHAKING STATE Calls the Tx amp Rx Data Handlers Handshaker and the Tx amp Rx Data Pumps When the Rx Data Handler Handshaker current state is complete it sends the CONNECT XXX response to the DTE On the receipt of any character from the DTE or on the break of the line event it goes on hook and sends the NO CARRIER response to the DTE 1 SM PROTOCOL HANDSHAKING ST ATE e By default 2 SM ON LINE STATE e When the Rx Data Handler Handshak
94. M message will include the same octets as in the CM message modn1_oct is TRUE if the received CM message contains the modn1 octet It is initialised in Rx V8 DH init to TRUE if the Soft Modem is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode modn2 oct Boolean variable The JM message will include the same octets as in the CM message modn2 oct is TRUE if the received CM message contains the modn2 octet It is initialised in Rx V8 DH init to TRUE if the Soft Modem is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode Drot oct Boolean variable The JM message will include the same octets as in the CM message Drot oct is TRUE if the received CM message contains the protO octet It is initialised in Rx V8 DH init to TRUE if the Soft Modem is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode access 0 oct Boolean variable The JM message will include the same octets as in the CM message access0 oct is TRUE if the received CM message contains the accessO octet It is initialised in Rx VS DH init to TRUE if the Soft Modem is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode V21 available Boolean variable V21 available is TRUE if the Soft Modem is in Calling Mode or if the Soft Modem is in Answering Mode and the Remote Modem supports V 21 Modulation protocol It is initialised in Rx V8 DH init to TRUE if the Soft Modem
95. More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 1 1 Establishment of connection The V 21 recommendation does not describe how a connection is established The procedure used by the LDR Soft Modem is described below and illustrated in Figure 3 1 Calling modem On connection to the line the calling modem shall be conditioned to receive signals in the high channel and transmit signals in the low channel After 155310 ms of binary 1 s have been detected the modem shall remain silent for a further 456 10 ms then it shall transmit binary 1 s 755 10 ms defined by 155ms S 9 100 ms later the modem shall be ready to transmit and receive data Answering modem On connection to the line the answering modem shall be conditioned to transmit signals in the high channel and receive signals in the low channel Following transmission of the answer sequence the modem shall transmit binary 1 s After 155 10 ms of binary 1 s have been detected the modem shall be ready to transmit and receive data after waiting a further 600 10 ms defined by S 9 100 ms Detect Ones God PU Wait oo Wait foriS5ms I dor4S ms 3 for755 ms usnanuussuuuuuus 7 2 S P uumumununuuusuuus 5 5 Saw wpe Connect to Silence line amp dial Connect to line after
96. None Code example struct channel t channel command parser amp channel 2 52 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface command handler Call s enum com handler result t TX COM HANDLER OK TX COM HANDLER NO COMMAND enum com handler result t command handler struct channel t channel Arguments Table 2 28 command handler arguments channel in Pointer to the Channel control data structure Description This is the Command Handler entry point A call to this function will execute if possible the function Tx control command handler call func associated with the current Command Handler The command handler function contains logic to check the condition of Tx control command head and Tx control command tailto determine the existence of elements in the commana buffer If the command buffer is not empty it calls the Tx control command handler call func This function is called in state machine Returns e TX COM HANDLER OK The Tx control command handler call func Was called TX COM HANDLER NO COMMAND The Tx control command handler call func Was not called because command is empty Code example struct channel t channel command handler amp channel MOTOROLA Chapter 2 General Architecture 2 53 For More Information On
97. OTOROLA Chapter 3 Module Descriptions 3 37 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump c the modem shall transmit scrambled binary 1 at 1200 bit s After scrambled binary 1 s have been transmitted at 1200 bit s for 765 10ms the modem shall be ready to transmit and receive data at 1200 bit s 3 1 4 4 Retrain sequence 2400 bit s operation A retrain sequence may be initiated during data transmission between two V 22bis modems if either modem incorporates a means of detecting loss of equalization Transmission of a retrain sequence shall be initiated either by detection a loss of equalization or by detection of unscrambled repetitive double dibit 00 and 11 at 1200 bit s from the remote modem S1 sequence The following sequence of events shall take place during the retrain a b c d Following detection of a loss of equalization or the end of detection of unscrambled repetitive double dibit 00 and 11 at 1200 bit s from the remote modem The modem shall transmit an unscrambled repetitive double dibit pattern of 00 and 11 at 1200 bit s for 100 3ms Following this signal the modem shall transmit scrambled bina ry 1 s at 1200 bit s 600 10ms after the end of detection of unscrambled repetitive double dibit 00 and 11 at 1200 bit s from the remote modem the modem shall begin transmitting scram bled binary 1 s at 2400 bit s 450 10ms after the end of t
98. R Array of Hidden Registers It is initialized by the global structure init function This array of registers is not accessed via AT commands directly and is internally used by the Soft Modem modules const uint8 H FACTORY DEFAULT H NUMBER Factory defined Configuration of H registers contains the default values used by the Soft Modem modules these are firmware and can be modified at compile time 2 6 2 Circular Buffer Inline Functions These functions introduce convenient access to the elements of the Soft Modem circular buffers Tx sample Rx sample Tx data Rx data Tx uart data Rx_uart_data and command 2 24 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx sample write Call s inline void Tx sample write struct Tx control t Tx control intl6 sample Arguments Table 2 5 Tx sample write arguments Tx control in Pointer to the Transmitter control data structure sample in Sample for writing to the Tx sample circular buffer Description This function writes the sample into the Tx sample circular buffer to the position pointed to by Tx control sample head then updates the Tx control sample headto the next position in the buffer Returns None Code example struct Tx control t Tx control intl6 sample 0 Tx sample
99. S 22 amp S22 M1 S 22 amp S22 ENABLE DETECTION S22 ENABLE DETECTION S 22 amp S22 SREJ BIT SREJ S 22 amp S22 FCS 32 S22 FCS 32 S 22 amp S22 TEST FRAMES S22 TEST FRAMES S 23 amp S23 COMPRESSION For More Information On This Product Go to www freescale com MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA Freescale Semiconductor Inc V 42 Error Correction v42 putbits Call s uint32 v42 putbits V42 DATA STRUCT dp uint32 value uint32 n uint32 transparency Arguments Table 3 48 v42 putbits arguments dp in Pointer to the V42 data structure value in Data to write into the tx buffer n in Number of bits to write transparency in If TRUE a 0 bit will be inserted after 5 contiguous 1 bits as a trans parent bit Description This function writes n bits from value to the tx buffer If transparency TRUE the function inserts a 0 bit after each sequence of 5 contiguous 1 bits Returns V42 WRITE SUCCESS if the tx_buffer contains enough space to place the required amount of bits including insertion of transparent bits and V42 TX BUFFER FULL otherwise Code example uint32 status value V42 DATA STRUCT dp channel Tx control ptr data handler ptr status v42 putbits dp value 8 TRUE if status V42 WRITE SUCCESS 3 2 8 5 MOTOROLA Chapter 3 Module Descrip
100. S UU BUR RUE ER ae M Rr URS 3 84 Carer RECOVERY M 3 85 QAM modulator control structure sese 3 87 QAM demodulator control structure ssenseeeeesseoeesseseessssereesseeeesssseessssees 3 89 V42 Error e EE 3 100 General structure of the V 42 module seen 3 102 Accessing the data buffers cc o ei Hot ede Eee CREE e RERUEER ENSE ES 3 103 Timing control sinuses teli e arse eee ded Ge ted ie uae eee 3 105 Detection lip Dm 3 105 KE RE 3 108 lumWiesme e M 3 108 FES CHECK C 3 110 Frame Handler MP 3 111 Information frame handling esee 3 111 Supervisor frame handling eese 3 115 The Ee Eu 3 116 Frame capsulation and sending data 3 117 Sending Information frames irri ee ies a eae dE ede dec ee usd dea 3 117 Sending Supervisor frames a i ep edet Enea eie beca ive EA pa 3 117 Support of the V 14 protocol ttt rene thee di tto IR de eee ponens 3 118 The V 42 module function descrpton 3 119 V 42bis Data Compression Protocol 5 eee rdi 3 128 Protocol Background Information esee 3 128 Implementation IEN eer 3 130 Communication with V 42 eege Dee 3 131 Programming EE 3 133 Compression balls cono a terna tbat spgea dea iech 3 138 THE V I Software e TEE 3 138 VIA Data E 3 138 Rx V 14 Data Handler ses ee nde ese eset bee ba Da canes 3 145 NS Software EE 3 152 V8 Data Handler eii
101. T Commands string they are then stored in the command buffer In these cases the AT Parser operation depends on the parser_state state identifier MOTOROLA Chapter 3 Module Descriptions 3 235 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions case ATP WAIT A 6699 Monitors the tx_uart_data buffer to determine an a or A character If this character has occurred the AT Parser goes to the ATP var rstate If another character was occurred the AT Parser will ignore it case ATP WAIT T Monitors the tx uart data buffer to determine a t T or character If a t or T character has occurred the AT Parser goes to the ATP wRrTE BUFFER State HVT character has occurred the AT Parser goes to the ATP BUFFER HANDLING State to repeat the execution of the previous AT Command string If another character has occurred the AT Parser goes back to the ATP war A state case ATP WRITE BUFFER In this case the AT Parser stores all the characters received from the tx uart data buffer after receiving the AT characters until receiving the Enter symbol in the at command string If the Enter character has occurred the AT Parser goes to the ATP CR WAIT State The received AT command string can t be more than 40 character END STRING 40 The characters following the 40 character in the string will be ignored and AT Parser will
102. TOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Rx uart data write Call s inline void Rx uart data write struct Rx control t Rx control uint8 uart data Arguments Table 1 Rx uart data write arguments Rx control in Pointer to the Receiver control data structure uart data in Symbol for writing to the Rx uart data circular buffer Description This function writes the uart_data into the Rx data circular buffer to the position pointed to by Be control uart data head then updates Rx control uart data headto the next position in the buffer Returns None Code example struct Rx control t Rx control uint8 character a Rx uart data write amp Rx control character MOTOROLA Chapter 2 General Architecture 2 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Rx uart data read Call s inline uint8 Rx uart data read struct Rx control t Rx control Arguments Table 2 15 Rx uart data read arguments Rx control in Pointer to the Receiver control data structure Description This function reads the value of the current element of the Rx uart data circular buffer pointed to by Rx control uart data tail then updates Rx control uart data tail to the next position in the buffer Returns Value of the element pointed to by Rx control uart dat
103. The remote modem issues a RR request with the p bit set and just after that starts to send an information frame e g 18 The Soft modem receives the RR command and sends a reply RR with bit f set According to the ITU T V 42 recommendation the remote modem has to resend all unacknowledged I frames starting from I14 to I18 inclusive Assume I18 was properly received along with I14 I15 I16 and I17 When frame I17 is received the VR variable becomes equal to 19 instead of 18 The xx last pointer is increased by 2 instead 1 because I18 is already in rx iframe storage So when the I18 frame is received again the Soft modem has to ignore it 3 114 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction As a result only when the appropriate position is found is data from the recently received frame placed there notify rej and sent rej fields of all previous not received frames are processed appropriately Along with receiving frames the receiver puts data from rx iframe storage into the Rx uart data buffer This is shown as independent Process B on Fig 3 2 5 Also the receiver handles the situation there when the xx iframe buffer becomes empty The soft modem can issue an early REJ frame if selective reject is not used This is done to improve protocol performance If a frame was not received prope
104. UF SIZE filter bpf buf ptr agc agc average intl6 agc cnt intl6 signal max intl6 signal present L The Rx control FSK t structure Member Descriptions f space Space frequency in Hz It is used to represent binary 0 It is initialized in Rx V21 init or Rx V23 init MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 57 Freescale Semiconductor Inc Data Pump 3 58 f mark Mark frequency in Hz It is used for to represent binary 1 It is initialized in Rx V21 init or Rx V23 init Ipf coef Pointer to coefficients of the FIR LPF low pass filter It is used for calculation of coefficients for Space and Mark BPF filters It is initialized in Rx V21 init or Rx V23 init filter size The number of coefficients used by the Space and Mark BPF filters It is initialized in Rx V21 init or Rx V23 init filter space i Array of I channel coefficients of the Space BPF filter It is initialized in FSK demodulator init filter space q Array of Q channel coefficients of the Space BPF filter It is initialized in FSK demodulator init filter mark i Array of I channel coefficients of the Mark BPF filter It is initialized in FSK demodulator init filter mark q Array of Q channel coefficients of the Mark BPF filter It is initialized in FSK demodulator init filter buf Cyclic buffer used by the Mark and Space BP
105. V22bis MODE 1200 MOTOROLA Chapter 3 Module Descriptions 3 45 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Hx V22bis handshake init Call s void Rx V22bis handshake init struct channel t channel struct Rx V22bis DH handshake t Rx V22bis handshake bool calling bool retrain Arguments Table 3 27 Rx V22bis handshake init arguments channel in Pointer to the channel control data structure Rx V22bis handshake in Pointer to RX handshake data handler structure calling in Indicates either modem in call or answer mode retrain in Indicates retrain mode mode in Specifies 1200 bit s V22BIS MODE 1200 or 2400 bit s V22BIS MODE 2400 mode Description This function initializes the receiver V 22bis handshake data handler control structure It fills the appropriate fields of Rx control t structure pointed to by channel Kr control ptr fields data handler call func data handler state number n bits and the Rx V22bis handshake structure fields retrain state send sl ms det sl ms send scr ones 2400 ms det scr ones 2400 ms wait adaptive equalizer ms det scr ones 1200 ms det unscr ones ms wait send ms wait data 1200 ms wait 16 way decision ms wait scr ones 2400 ms current sl ones counter current counter global counter It sets up the data handler for the receiver to perform the Rx V22bis handshake routine Th
106. V8 DH init to 1 if the Soft Modem is in Calling Mode and to 0 if the Modem is in Answering Mode CJ counter Counter of the CJ messages sent It is initialised in Tx V8 DH init to 0 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com V 8 Software Module Tx V8 DH in Freescale Semiconductor Inc it Call s void Tx V8 DH init struct channel t channel struct Tx V8 DH t tx s bool calling Arguments Table 3 64 Tx V8 DH init arguments channel in Pointer to the Channel control data structure D s in Pointer to the Tx V8 Data Handler data structure calling in Boolean variable Contains TRUE if the Soft Modem is in Calling Mode and FALSE if the Soft Modem is in Answering Mode Description Initialisation of the Tx V8 Data Handler The Tx V8 Data Handler takes control of the data structure The user must call this function before calling the Tx V8 DH routine and v8 put bits functions It is only necessary to call it once before Data Handler operation Returns None Code example struct channel t channel static struct Tx V8 DH t Tx V8 DH bool calling calling TRUE Tx V8 DH init channel amp Tx V8 DH calling Tx control data handler call func Tx V8 DH routine MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 153 F
107. W algorithm The encoder translates 8 bit character sequences strings into a number of short transmission tokens codewords The algorithm uses adaptive dictionaries to store the most encountered strings along with codewords which are used to represent those strings on either side of a V 42bis connection The transmitter dictionary assembles itself from the input data file while the receiver dictionary is assembled from the transmission tokens The size of the dictionary can vary the CCITT standard defines the minimal dictionary size as 512 nodes strings The actual dictionary size is established between modems at the V 42 negotiation time Both the soft modem and the remote modem exchange information on the size of dictionary they can support The lower value is then selected Both modems also negotiate a maximum string length which can be stored in the dictionary in the range from 6 to 250 characters DATA DATA p FILE FILE Adaptive Dictionary m Adaptive Dictionary Figure 3 37 V 42bis Connection The dictionary can be represented as a tree network where each root node represents a single alphabet character and vice versa each character corresponds to the tree in the dictionary All the trees represent a set of known strings that break out with a root node character Each tree node corresponds to a set of strings of the dictionary and a leaf node corresponds to a single kno
108. a Handler takes control of the data structure The user must call this function before calling the Tx V14 DH routine and v14 put bits functions It is only necessary to call it once before Data Handler operation Returns None Code example struct channel t channel Tx Vi4 DH init channel Tx control data handler call func Tx V14 DH routine 3 140 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module Tx V14 DH routine Call s void Tx V14 DH routine struct channel t channel Arguments Table 3 59 Tx V14 DH routine arguments channel in Pointer to the Channel control data structure Description This function gets the data from the Tx_uart_data buffer using the Tx uart data read function encodes it and puts the encoded data into the Tx data buffer using the v14 put bits function Returns None Code example struct channel t channel Tx control data handler call func channel Code explanation switch Tx control data handler state default case TX DH STATE NORMAL Tx control data handler state contains the current state of the tx data handler If itis set to TX DH STATE NORMAL the tx data handler can transmit the data if Tx control uart data tail Tx control uart data head value 0x200 Tx_uart_dat
109. a tail Code example struct Rx control t Rx control uint8 character character Rx uart data read amp Rx control 2 36 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface command write Call s inline void command write struct Tx control t Tx control uint32 command Arguments Table 2 16 command write arguments Tx control in Pointer to the Transmitter control data structure command in Command number and its three parameters for writing to the command circular buffer 4 th byte is the command number 3 rd byte is the 1 st parameter 2 nd byte is the 2 nd parameter 1 st byte is the 3 rd parameter Description This function writes the command into the command circular buffer to the position pointed to by Tx control command head then updates Tx control command head to the next position in the buffer Returns None Code example define COMMANDAT 1 struct Tx_control_t Tx_control uint32 command COMMANDAT command write amp Tx control command MOTOROLA Chapter 2 General Architecture 2 37 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface command read Call s inline uint32 command read struct Tx control t Tx control Arguments Table 2 17 command read arguments Tx co
110. a_read Tx_control lt lt 1 v14 put bits channel value 10 If the Tx uart data buffer contains data take the data character 8 bits from the Tx uart data buffer add start and stop bits and store the result in the variable value then call the v14 put bits function to put 10 data bits from value into the Tx data buffer else v14 put bits channel OxFF 8 If the Tx uart data buffer doesn t contain data put 8 1 s into the Tx data buffer MOTOROLA Chapter 3 Module Descriptions 3 141 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module v14 put bits Call s uint32 vi4 put bits struct channel t channel uint32 value uint8 n Arguments Table 3 60 v14 putbits arguments channel in Pointer to the Channel control data structure value in Contains the data bits being put into the Tx data buffer n in Contains the number of data bits being put into the Tx data buffer Description This function puts data into the Tx data buffer Returns None Code example struct channel t channel value 0x200 Tx uart data read Tx control lt lt 1 vi4 put bits channel value 10 Code explanation tx nbits Tx control n bits Gets the value of n bits number of bits per baud specified during data pump protocol initializa tion from the Tx control structure number n bits n tx
111. ain Indicates the retrain mode This field is initialized in function Rx_V22bis_handshake_init det_unscr_ones_ms Duration of unscrambled binary 1 s detection in ms This field is initialized in function Rx_V22bis_handshake_init det_scr_ones_1200_ms Duration of the scrambled binary 1 s on 1200 b s detection in ms This field is initialized in function Rx_V22bis_handshake_init wait_send_ms Specified time before starting to transmit scrambled binary 1 s in ms This field is initialized in function Rx_V22bis_handshake_init wait data 1200 ms Specified time before Carrier Detect Response in ms This field is initialized in function Rx V22bis handshake init MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump e send sl ms Duration of the S1 sequence This field is initialized in function Rx V22bis handshake init det sl ms Detection time of the S1 sequence This field is initialized in function Rx V22bis handshake init current s1 Contains one or zero Is used for S1 detection This field is initialized in function Rx V22bis handshake init to 0 e ones counter Counter used in the S1 detection state This field is initialized in function Rx V22bis handshake init to O e wait adaptive equalizer ms Time period after which the Adaptive equalizer is enabled This field i
112. ale Semiconductor Inc Support Modules Tx uart all Call s void Tx uart all struct channel t channel Arguments Table 3 75 Tx uart all arguments channel in Pointer to the Channel control data structure Description This function reads all available characters from Rx uart data and sends them to the UART module using out char uart Returns None Code example struct channel t channel Tx uart all amp channel 3 174 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules in char uart Call s uint8 in char uart void Arguments None Description This function gets a character from UARTO Returns The character obtained from UARTO Code example uint8 character character in char uart MOTOROLA Chapter 3 Module Descriptions 3 175 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules out char uart Call s void out char uart uint8 ch Arguments Table 3 76 out char uart arguments ch in Character for sending to UARTO Description This function sends the character ch to the UARTO Returns None Code example uint8 character a out_char_uart character 3 176 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For Mor
113. also provides a means to enable a PSTN call to be passed on automatically to an appropriate DCE 3 6 1 V8 Data Handler The Tx V8 Data Handler is used for transmission of CM JM or CJ messages to the Remote Modem The Tx V8 Data Handler composes CM JM or CJ sequences and puts them into the Tx data buffer The Tx V8 Data Handler contains the following functions Tx V8 DH mi Tx V8 DH routine and v8 put bits The Tx v8 pH t structure as defined in v8 h FC RR RR ke e e e e e ke ke e oo o e ee e oe ke ke e o kk e e e e e oe ke o e k e e oe oe e ok e e e e e e e oe e e e e e e eee Tx V 8 Data Handler Structure KEE struct Tx V8 DH t enum v8 state type v8 state enum v8 sub state type v8 sub state uint8 JM success uint8 CJ counter d MOTOROLA Chapter 3 Module Descriptions 3 151 For More Information On This Product Go to www freescale com V 8 Software Module Freescale Semiconductor Inc The rx vg pH t structure parameter descriptions 3 152 v8 state State identifier It contains the current state of the Tx V8 Data Handler It is initialized in Tx V8 DH init to V8 DCE CM v8 sub state State identifier It contains the current sub state of the Tx V8 Data Handler It is initialized in Tx V8 DH init to V8 TEN ONES JM success This variable allows the Tx V8 DH routine function to write data into the Tx data buffer and to send it to the other modem It 1s initialized in Tx
114. ames 3 102 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc V 42 Error Correction Rx_uart_data V 42bis decoder pep me and state ions m rre eL T V 42bis encoder l Tx_uart_data Figure 3 32 General structure of the V 42 module o Error ae injector i V 42 control For demo and test purposes an error injector can be used Once per each period of time it inverts one bit of received and or transmitted data This simulates a noisy line The time period between injections is a pseudorandom value The time periods are derived from the pseudorandom generator based on the feedback shift register feedback shift register is the name of a register type that register can be shifted and has a feedback link To enable the error injector in each direction constants v42 TX ERROR INJECTOR and V42 RX ERROR INJECTOR have to be defined in the v 42 h file A more detailed description of the receiver and transmitter is given in the following sections 3 2 2 Accessing the data buffers Each byte of the Rx_data and Tx_data buffers contains only nbits of useful data This data occupies the least significant bits of the byte The rest of the bits are useless MOTOROLA Chapter 3 Module Descriptions 3 103 For More Information On This Product Go
115. and Q nTy are the points used to make a decision E nT The error E nTy is a geometrical distance from the point used to make the decision and the optimum decision point This error is then lowpass filtered by the oop filter first order IIR filter and used to adjust the current value of the local carrier phase either delay or advance the phase of the local carrier So as a result the Clock Recovery block rotates the constellation diagram to match the one shown in Figure 3 30 The filter coefficients and thresholds change depending on the state of the receiver handshake mode or data mode The phase correction is made once per baud and is performed in the middle of the baud 3 86 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Phase Quadrant 2 Phase Quadrant 1 e e e 11 01 3 10 11 e D e e 1 10 3 01 11 Phase Quadrant 3 Phase Quadrant 4 Figure 3 30 QAM receiver decision points 3 1 7 3 QAM modulator control structure typedef struct Tx control QAM t uint32 f carrier uint32 f guard uintl6 carrier phase uintl6 guard phase uintl6 carrier phase incr uintl6 guard phase incr uintl6 baud frac uintl6 baud incr intl6 amplitude carrier intl6 amplitude guard MOTOROLA Chapter 3 Module Descriptions 3 87 For More Information On This Produc
116. and on the CONNECT result code 3 224 TOKE TO dte PSU TIED EE 3 225 text to dte Tixed tee 3 226 chat to die arg umet s o ceo adn oed a ntu aia diu M equus ies Uds dul cud 3 227 WINS tO ste decimal arguments sso e eco Pe UHEBNEM rt DAE ee ea ek e Opes tege US 3 228 uint8 to str hexadecimal argument 3 229 dsp cos arg E CT 3 230 dsp convolution frac arguments 5 essi ese eene e Ree Re EY RS SERRE S HR FERRE RE e E eedeeE 3 231 Te ET argumelils eebe eege 3 232 AT parser Tnit areumells oerte eu idiots 3 235 AL parsers qnit arguments uo ed eds tdi a nc ere Rae ee ee 3 236 AT parser amt arguments ads Eeer sea Oa Di gard oe wl scat eat cle 3 238 AL Parser mut arguments see dede tecti ieee eee Weer eared 3 240 AT handler mit dte e 3 242 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Tables Table Page Number Title Number 3 125 AAT handler eege eege 3 243 MOTOROLA Tables xiii For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Tables Table Page Number Title Number xiv MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc About This Book The primary objective of this user s manual is to define the functionality of the MCF54
117. annel 3 196 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Rx daa Call s void Rx daa struct channel t channel Arguments Table 3 91 Rx daa arguments channel in Pointer to the Channel control data structure Description This function is responsible for receiving data from the DAA States of operation RX DAA NORMAL It reads the received sample from the DAA by using in sample codec and writes it into the Rx sample circular buffer RX DAA READ REG If daa control delay is equal to 0 it reads the received sample from the DAA by using in sample codec and writes it into daa_control gt value sets daa control value is true TRUE and changes the Rx DAA state to RX_ DAA NORMAL otherwise it decrements daa_control gt delay and reads the received sample from the DAA by using in_sample_codec and writes it into the Rx_sample circular buffer RX DAA WRITE REG If daa_control gt delay is equal to 0 it reads the received sample from the DAA by using in sample codec sets daa control value is true TRUE and changes the Rx DAA state to RX DAA NORMAL otherwise it decrements daa control delay and reads the received sample from the DAA by using in sample codec and writes it into the Rx sample circular buffer This
118. arams Arguments Table 3 71 mcf5407 uart parameters set arguments uart params in Pointer to the UART parameters structure Description This function sets the parameters of the UART module according to the values contained in the structure pointed to by uart params This function is called in mcf5407_uart_init and state_machine Returns None Code example struct uart params t uart control mcf5407 uart parameters set amp uart control 3 170 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc mcf5407 uart interrupt mask set Call s void mcf5407 uart interrupt mask set uint8 uart number bool cos bool db bool rx rdy bool tx rdy Arguments Table 3 72 mcf5407 uart interrupt mask set arguments uart number in UART number This value must be equal to 0 for UARTO or 1 for UART1 cos in Interrupt on change of state Not used by UART1 in modem mode FALSE disabled TRUE enabled db in Interrupt on detection of a break Not used by UART1 in modem mode FALSE disabled TRUE enabled rx rdy in Interrupt on receiver ready FALSE disabled TRUE enabled tx rdy in Interrupt on transmitter ready FALSE disabled TRUE enabled Description This function sets the fields of the UART Interrupt Mask Registers UIMR ac
119. ata pump protocol and realization of physical handshake sequence for V 22 v22bis h definitions used by V 22bis protocol v22bis c initialization of V 22bis data pump protocol and realization of physical handshake sequence for V 22bis fsk h FSK data pump definitions fsk c realization of FSK data pump dpsk h DPSK data pump definitions dpsk c realization of 2 4 DPSK data pump gam h QAM data pump definitions gam c realization of 4 16 QAM data pump v14 h definitions used by V 14 protocol v14 c realization of V 14 data handler V42 h definitions used by V 42 protocol V42 c realization of V 42 protocol MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Related Files V42bis h definitions used by V 42bis protocol V42bis c realization of V 42bis protocol v8 h definitions used by NS protocol v8 c realization of V 8 protocol dtmf h DTMF dialer definitions dtmf c DTMF dialer realization pulse h pulse dialer definitions pulse c pulse dialer realization tone gendet h definitions used by tone generator and detector tone gendet c realization of tone generator and detector ring det h definitions used by ring detector ring det c realization of ring detector at parser h definitions used by AT command parser at
120. ate t state uint32 det unscr ones ms uint32 det scr ones ms uint32 wait send ms uint32 wait carrier ms uint32 current counter uint32 global counter js state Current state of the Rx V22 Handshake Data Handler The list of possible states can be seen in Fig 3 1 3 12 det unscr ones ms Duration of the unscrambled binary 1 s detection in ms This field is initialized in function Rx V22 handshake init det scr ones ms Duration of the scrambled binary 1 s detection in ms This field is initialized in function Rx V22 handshake init e wait send ms Specified time before starting to transmit scrambled binary 1 s in ms This field is initialized in function Rx V22 handshake init e wait carrier ms Specified time before Carrier Detect Response in ms This field is initialized in function Rx V22 handshake init e current counter The counter that is used for counting the different data sequences e g for detecting consecutive 1 s This field is initialized in function Rx V22 handshake init to 0 global counter Counter of the bits received throughout the handshake phase This field is initialized in function Rx V22 handshake init to Q 3 24 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data Pump F reescale Semiconductor Inc V22 scramble bit Call s uint8 V22 scramble bit struct channel t channel uint8 bit
121. bit tx buffer buffer It is important to understand that the number of bits to be written n parameter should not be grater than the size of the buffer 32 bits minus nbits and minus the number of any inserted transparent bits if the v2 putbits function is called with the transparent parameter set to TRUE 3 2 3 Timing control Four timers are implemented in the V 42 module T400 T401 T403 and TI A description of the first three timers is given in Section 9 System parameters of the ITU T V 42 Recommendation TI is an interval timer It is described in Appendix II Data forwarding conditions paragraph c of the ITU T V 42 Recommendation These timers are clocked by the v42 getbits and v42 putbits functions When a correspondent function is called it adds the number of bits requested to read send to the counter of a timer T400 T401 and T403 timers are clocked by both functions This is done in order to take into account different baud rates of the transmitter and receiver which takes place for example in the V 23 protocol The thresholds of these three timers are oriented on a fixed amount of sent received bits regardless of the data pump protocol used This means that for example the T400 timer overruns when its counter contains a value greater than r400 THRESHOLD This value corresponds to different values of absolute time when V 21 300 bps and V 22 1200 bps are used The Interval Timer TI calculates absolute tim
122. by four to obtain the new average signal level In the second step the gain correction factor is calculated The gain correction factor is the result of dividing the maximum allowed signal level by the average signal level The AGC block also determines if a carrier is present in the received signal by comparing the average signal level with the threshold 3 1 6 2 3 Demodulator With Iy nT and Q T as inputs to the demodulator the outputs I nT and Q nT are given by l nT Int cos 9 nT Q nT sin gt Q nT OT sin T Q nT cos tat Where 6 is the local carrier phase 3 1 6 2 Decision block and Decoder The decision block calculates the current phase from the values of the baseband I and Q The phase change is then calculated by subtracting the previous value of the phase from the current value of the phase The decoder then finds the dibit that corresponds to the last phase change according to table 3 1 3 MOTOROLA Chapter 3 Module Descriptions 3 67 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 6 2 5 Descrambler The descrambler is intended to recover the originally transmitted dibit For more detailed information about the descrambler refer to section 3 1 3 3 3 1 6 2 6 Clock Recovery The purpose of Clock Recovery is to detect the middle of a baud The decision block makes decisions exactly in the middle of the baud The ene
123. case V8 MODN1 case V8 MODN2 case V8 ACCESSO The V8 Data Handler sends modn0 modn1 modn2 and access0 messages The Boolean variables in vs_mopNo v8 MwopNi v8 MODN2 and v8 ACCESSO are used to allow these messages to be sent they are always sent in the CM message Calling Mode and they are sent in the JM message if these messages occurred in the received CM message Answering Mode according to the ITU T V 8 Recommendation case V8 DCE CJ In this case the V8 Data Handler will send the CJ message MOTOROLA Chapter 3 Module Descriptions 3 155 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module v8 put bits Call s uintl6 v8 put bits struct channel t channel uinti6 current data Arguments Table 3 66 v8 put bits arguments channel in Pointer to the Channel control data structure current data in Contains data being put into the Tx data buffer Description This function puts the data into the Tx data buffer Returns None Code example struct channel t channel define TEN ONES 1023 1111111111 v8 put bits channel TEN ONES 3 156 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc V 8 Software Module 3 6 2 Rx V8 Data Handler The Rx V8 Data Handler is used to receive CM JM or C
124. cations of J21 J22 J23 and J24 are incorrect by default The settings can be MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Quick Start determined by allowing the board to boot up under dBUG control Since dBUG drives the configuration data on PP 0 3 the data will be seen on the LEDs D1 D4 If the LED is on then the corresponding jumper should be OFF and if the LED is off then the jumper should be in position 2 3 see M5407C3 User s Manual RI 1 Chapter 3 1 12 SDRAM DIMM e Use the RS 232 male female DB 9 serial cable to connect the PC to the M5407C3 e Plug in the Modem daughter card to the telephone line through the RJ 11 socket if you want to make a connection to another modem e Power up the board e Invoke the Hyper Terminal or similar terminal program on the PC to which the evaluation board is connected and configure it to Bits per second 19200 Data bits 8 Parity none Stop bits 1 Flow control Hardware CTS RTS e Load SoftMod mcp onto Metrowerks CodeWarrior and build the target e Run project e In your terminal program window you should see the Soft Modem welcome message LDR Soft Modem The Soft Modem is now ready to accept your AT commands see MCF5407 Low Data Rate Soft Modem AT Command reference User Manual MOTOROLA Chapter 1 Introd
125. chapter 2 6 2 Circular Buffer Inline functions The Rx V 14 Data Handler contains the following functions R V14 DH init Rx V14 DH routine and v14 get bits vd SS rd ta Figure 3 43 The Rx V 14 Data handler The rx vi4 DH t structure is defined in v14 h FCRC e ke ke ke ke ke ko ook o ok kk kk kk ee oe oe o ob ee b ob b ob o o ke o ke e EE EE e e ke e e e e e e e e e e e Rx V 14 Data Handler Structure kk RR kk ok ok oe e oe oe oe o oe oe EEGEN struct Rx V14 DH t 3 144 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module uint32 rx buffer uint32 rx num bits enum V14 state t rx substate uintl6 rx null count The zx via pH t structure parameter descriptions are as follows e rx buffer Internal buffer for the Rx Data Handler into which the Rx Data Handler accumulates bits from the Rx data buffer and from which the Rx Data Handler takes data and puts it into the Rx uart data buffer It is initialised in Rx V14 DH init to 0 e rx num bits number of data bits in the rx buffer It is initialised in Rx V14 DH init to 0 rx substate State identifier It contains the current state of the Rx Data Handler It is initialised in Rx_V14_DH_init to VI4 DH 1 GETTING e rx null count Specifies the number of received zeros to dete
126. coding goes here encoded bytes v42bis Encode if encoded bytes 0 amp amp needed to send something int nBytes memset flush buf 0 sizeof flush buf nBytes v42bis Flush v42bis flush buf 3 136 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module 3 4 3 Compression Ratio This section describes a V 42bis compression ratio comparison for several files provided by the ITU T V 56ter Recommendation The results are obtained with the following V 42bis negotiation values Maximum Number Of Codewords 2048 Maximum String Length 32 These default values are used by most modems and placed into the scope of the recommendation However it is useful to know that changing the above parameters has a great effect on the compression ratio which depends very much on the characteristics of the data Table 3 57 Compression Ratio Comparison Compressed Compression V 56ter capability ius V 56ter spec V 42bis module Size Ratio Size Ratio 1x30 TST Excellent 982 040 156 546 84 05 154 897 84 22 2x10 TST Good 327 680 135 950 58 51 135 844 58 54 3x06 TST Poor 196 608 142 125 27 71 141 827 27 86 4x04 TST Catastrophic 131 072 131 268 0 15 131 072 096 3 5 The V 14 Software Module The V 14 Software mo
127. communications channel there is a remote modem in answer mode This remote modem receives at 1200Hz and transmits at 2400Hz The Quadrature Amplitude modulation QAM technique is used for each channel with synchronous line transmission at 600 baud implemented in the gam c file The constellation could be either 16 points 4 bits baud supporting an input bit rate of 2400 bit s See Fig 3 1 4 1 or 4 point 2 bit baud supporting 1200 bit s It is compatible with a V 22 modem at the 1200 bit s signalling rate and includes automatic bit rate recognition A scrambler is included in the input to the transmitter and a descrambler at the output of the receiver A guard tone of 1800 20 Hz or 550 20 Hz may be used while transmitting only in the high channel transmitter of the answering modem Fixed compromise equalization and adaptive equalization shall be incorporated in the modem For 2400 bits per second the data stream to be transmitted shall be divided into groups of four consecutive bits quadbits The first two bits of a quadbit shall be encoded as a phase quadrant change relative to the quadrant occupied by the preceding signal element See Fig 3 1 4 1 and Table 3 1 4 1 The last two bits of each quadbit define one of four signalling elements associated with the new quadrant see Fig 3 1 4 1 Example The first dibit is encoded as a phase change according to table 3 1 4 1 as in V 22 The second dibit defines the signalling element the p
128. cording to the input parameters This function is called in mcf5407_uart_init Returns None Code example mcf5407 uart interrupt mask set 1 FALSE FALSE TRUE TRUE MOTOROLA Chapter 3 Module Descriptions 3 171 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Hx uart Call s void Rx uart struct channel t channel Arguments Table 3 73 Rx uart arguments channel in Pointer to the Channel control data structure Description This function writes a character received from the UART module to the Tx uart data circular buffer using in char uart Returns None Code example struct channel t channel Rx uart amp channel 3 172 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Tx uart Call s void Tx uart struct channel t channel Arguments Table 3 74 Tx uart arguments channel in Pointer to the Channel control data structure Description This function reads a character from the Rx uart data and sends it to the UART module using out char uart Returns None Code example struct channel t channel Tx uart amp channel MOTOROLA Chapter 3 Module Descriptions 3 173 For More Information On This Product Go to www freescale com Freesc
129. ctional type Q14 okckckckckckckckck ck RR RR kk k k k kk kk ck ck ck ck ck ck ckckckckck ck ck ck ck KK KK KR ck ckck ck ck ck ck k k k k kk k sk sk ke ke ke ke define CFF x int16 x COS BASE S EE KR RR RR RK RR KK KR KR kk kckckckck ck ck ck ck kckckckckckckckckckckckckckckck ck k k k k k k k k k k k k ck ck ck k ck ck ck KK Get fractional multiplication of Q14 Eokckckckckckckck ck ck ck A k k ck ck ck kk kk k k k k kk ck ck ck ck ck ck ckckckckck ck ck ck ck kckckckckckck ck ck ck ck ck k k k k k kk k ck ck ke ke ke ke f define MULT FRAC x y x y 22COS BITS S E E KR RR RR RR RK RK KK RR kc kckckck ck ck k ck ck kckckckckckckckckckckckckckck ck k k k k k k k k k k k k k ck ck ck k ck ck ck RK Get fractional division of Q14 Eokckckckckckckck RR RK kk kckckckckck KKK define DIV FRAC x y x COS BITS y 2 4 Channel The Channel is the main control data structure and is a mandatory parameter for most of the Soft Modem functions It is actually a union of the control structures that contains pointers to the Transmitter Receiver DTE and DAA control structures associated with this Channel In other words the Channel is the root of the Soft Modem Through the Channel data structure it is possible to get any current parameter of the Soft Modem The channe1 t structure is defined in modem h BOR KR RR RR RK RK RR KK kk kk kc kckck ck ck ck ck ck ck kckckckckckck ckckckckckckckckck ck k k k k k k
130. ctor Inc Data Pump Tx V22bis handshake init Call s void Tx V22bis handshake init struct channel t channel struct Tx V22bis DH handshake t Tx V22bis handshake Arguments Table 3 29 Tx V22bis handshake init arguments channel in Pointer to the channel control data structure Tx V22bis handshake in Pointer to the TX V 22bis handshake data handler structure Description This function initializes the transmitter V 22bis handshake data handler control structure It fills the appropriate fields of Tx control t structure pointed to by channel Tx control ptr fields data handler ptr data handler call func data handler state number n bits and the Tx V22bis handshake structure fields state current bit It sets up the data handler for the receiver to perform the Tx V22bis handshake routine This function is called from state_machine Returns None Code example struct channel t channel Rx V22bis handshake init channel 3 48 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc Tx V22bis handshake routine Call s void Tx V22bis handshake routine struct channel t channel Arguments Table 3 30 Tx V22bis handshake routine arguments channel in Pointer to the channel control data structure Description This is the TX V
131. current Rx Data Pump control structure Every Data Pump module can have its own control data structure Initialized in Rx channel init to NULL data pump call func Pointer to the function call associated with the current Rx Data Pump The Rx data pump function simply calls whatever function this MOTOROLA Chapter 2 General Architecture 2 13 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Global State Machine pointer is pointing to It is initialized in Rx channel init to Kr idle Discards samples from the Rx sample e number samples Specifies the number of samples that should be in Rx sample before an Rx data pump call It is initialized in Rx channel init to DEFAULT NUMBER SAMPLES defined in modem h n bits Number of bits per symbol for the current demodulator Initialized in Rx channel init to 1 e n bits mask Bit mask corresponding to 1 lt lt n bits 1 Can be used to mask for valid bits when converting to symbols from Rx data Initialized in Rx channel init to 1 e baud rate Demodulator baud rate Itis initialized in Rx channel init to 0 process count Specifies the maximum number of demodulator specific operations for completion of the current state For example Ring detector uses it as number of Ring cadence to be detected It is initialized in Rx channel init to 1 data handler ptr Pointer to current Rx Data Handle
132. cy used is 9600Hz The 9600Hz sampling rate is practical for several reasons Itis higher than the Nyquist sampling frequency of approximately 8KHz for the telephone channel tisaconvenient multiple of the popular modem baud rates 75 300 600 1200 and 2400 baud etc 2 3 Numeric Formats The Source code uses integer math functions only no floating point operation this allows the algorithms to be optimized to the target processor for speed A lot of variables used in the modem are 16 bit signed fractional integers in Q14 and Q15 formats In the case of Q14 this means that the msb is a sign bit the bit before the msb is to the left of the decimal point and the remaining 14 bits are to the right of the decimal point Therefore the numeric range is 32768 to 32767 corresponding to 2 000000 to 1 999939 with a quantization step of 1 32768 For example Q14 format is used by the data pump modules to represent a PCM signal The header file init h contains a set of useful macros for operation with fractional data Samples type representation define COS BITS 14 Q14 define COS BASE 1 COS BITS One in Q14 BR KR RR RR RR RRR KK KK RR kk k k A k ck ck ck ck ck ck ck kckckckckckckckckckckckckck ck ck k k k k k k ck RR k ck k ck RK MOTOROLA Chapter 2 General Architecture 2 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel Conversion from float to fra
133. d n in Number of bits to read transparency in If TRUE each 0 bit that follows 5 contiguous 1 bits will be dis carded as transparent Description This function gets n bits from the rx buffer These bits are placed into the Isb of the variable pointed to by value The remaining bits of that variable are cleared If transparency TRUE the function discards transparent bits from the bit stream Returns V42_READ_SUCCESS if the rx_buffer contains the required number of bits and V42 RX BUFFER EMPTY otherwise Code example uint32 value V42 DATA STRUCT dp channel gt Rx_control_ptr gt data_handler ptr v42 getbits dp amp value 8 TRUE 3 120 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction v42 init Call s void v42 init struct channel t channel V42 DATA STRUCT data ptr uint8 originator uint8 ec mode uint8 dphase enabled uint8 srej uint8 extended fos uint8 test frames uint8 compression Arguments Table 3 47 v42 init arguments channel in Pointer to the channel control data structure data ptr in Pointer to initialise the V 42 data structure originator in TRUE if the modem acts as the originator of the connection FALSE if the modem acts as an answerer ec_mode in Error correction mode 0x00 no error correc
134. d specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters which may be provided in Motorola data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Motorola does not convey any license under its patent rights nor the rights of others Motorola products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur Should Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part MOTOROLA Motorola and the Stylized M Logo are registered in the U S Patent and Trademark O
135. damaging the flag except one If the flag is placed in the second byte bits 8 to 15 inclusive reading the first byte has to be performed without discarding any transparent zeroes After such a reading the frame closing flag will be appropriately aligned in the buffer Any error will be disclosed after checking the FCS 3 2 5 2 FCS check This implementation supports 16 and 32 bit FCS Calculation of the frame check sequence is performed during the reception of a frame This means that this checksum is updated 3 110 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction upon receiving each byte from the bit stream Such an approach reduces the peak load of the processor and improves overall system performance Depending on which sequence is used 16 or 32 bit the appropriate checksum is calculated In some cases calculation of both checksums is required Section 8 10 2 of ITU T V 42 Recommendation When a whole frame is received the calculated check sum s is examined The receiver only handles a frame if it has a valid FCS Otherwise the frame is discarded and the receiver changes its state to va2 cgTTING FLAG 3 2 5 3 Frame handler The frame handler receives control if the FCS check passed successfully Depending on the control field of the frame it identifies the corresponding parser to handle
136. de for channel No 2 It can be equal to e V23 MODE 600 Mode 1 600 bauds e V23 MODE 1200 Mode 2 1200 bauds Description Returns Code example This function sets the fields of the FSK transmitter control data structure pointed by 7x control FSK f space f mark amplitude and calls par modulator init It also initializes the fields of the Channel control data structure pointed to by the channel that are responsible for the Tx Data Pump data pump ptr baud rate number samples data pump call func state n bits n bits mask process count After calling this function the Tx Data Pump is initialized to work according to V 23 This function is called in state_machine None struct channel t channel struct Tx control FSK t Tx control FSK bool calling TRUE Tx V23 init amp channel amp Tx control FSK calling V23 MODE 600 3 14 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V23 init Call s void Rx V23 init struct channel t channel struct Rx control FSK t Rx control FSK bool calling enum v23 mode t mode Arguments Table 3 8 Rx V23 init arguments channel in Pointer to the Channel control data structure Rx control FSK in Pointer to the FSK receiver control data structure calling in Contains TRUE
137. dshaking process It is initialized in Rx_V21_handshake_init to 0 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Tx V21 init Call s void Tx V21 init struct channel t channel struct Tx control FSK t Tx control FSK bool calling Arguments Table 3 1 Tx V21 init arguments channel in Pointer to the Channel control data structure Tx control FSK in Pointer to the FSK transmitter control data structure calling in Contains TRUE if the transmitter is in calling mode and FALSE if the transmitter is in answering mode Description This function sets the fields of the FSK transmitter control data structure pointed to by 7x control FSK f space f mark amplitude and calls Fsk_modulator_init It also initializes the fields of the Channel control data structure pointed to by the channel that are responsible for the Tx Data Pump data_pump_ptr baud_rate number_samples data_pump_call_func state n_bits n_bits_mask process_count After calling this function the Tx Data Pump is initialized to work according to V 21 This function is called in state_machine Returns None Code example struct channel t channel struct Tx control FSK t Tx control FSK bool calling TRUE Tx V21 init amp channel amp Tx control FSK calling MOTOROLA Chapt
138. ductor Inc Support Modules omega row Row frequency Phase Shift per sample in Q15 It is initialized in Tx DTMFE init to 0 omega column Column frequency Phase Shift per sample in Q15 It is initialized in Tx DTMF init to 0 e phase row Row frequency Phase in Q15 It is initialized in 7x_DTMF_init to 0 phase column Column frequency Phase in Q15 It is initialized in Tx DTMF init to 0 e samples left Number of samples left to generate the current digit or a pause It is initialized in Tx DTMF init to 0 e amplitude Amplitude of the generated signal in Q14 It is initialized in Tx DTMF _init 3 214 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Tx DTMF init Call s void Tx DTMF init struct channel t channel struct Tx DTMF control t Tx DTMF control Arguments Table 3 101 Tx DTMF init arguments channel in Pointer to the Channel control data structure Tx DTMF control in Pointer to the DTMF generator control data structure Description This function initialises the DTMF generator control data structure It also initializes the fields of the Channel control data structure pointed to by channel that are responsible for the Tx Data Pump data pump ptr baud rate number samples data pump call func state After calling
139. dule implements asynchronous to synchronous conversion according to the ITU T V 14 recommendation The V 14 Software module contains two parts theTx V 14 Data Handler and the Rx V 14 Data Handler 3 5 1 V 14 Data Handler Tx channel Tx uart data ao Figure 3 40 Tx V 14 Data Handler in the Tx channel MOTOROLA Chapier 3 Module Descriptions 3 137 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module The Tx V 14 Data Handler takes data from the Tx uart data buffer encodes it and puts it into the Tx data buffer Each buffer element in the Tx uart data buffer contains 8 data bits character If the Tx uart data buffer contains data the Tx V 14 Data Handler takes the character from the Tx uart data using the Tx uart data read function see chapter 2 6 2 Circular Buffer Inline functions The Tx V 14 Data Handler then encodes the data according to the V 14 Recommendation each character 8 data bits is preceded by a Start bit Start bit 0 and is followed by a Stop bit Stop bit 1 The general data flow according to the V 14 Recommendation is shown in Fig 3 4 3 The Tx V 14 Data Handler then puts the encoded data into the Tx data buffer using the v14 put bits function In the Tx data buffer each element contains tx nbits used bits tx nbits contains the number of bits per baud Depending on the modulation
140. e It determines a period during which characters are accumulated to be sent in a single information frame So the threshold for this timer is set up in v42_init function and depends on the data pump protocol used 3 2 4 Detection phase The V 42 receiver is a state machine shown in Fig 3 2 3 It works mainly in two states get data according to the V 42 protocol and get data according to the V 14 protocol The initial state is set up in the v42_init function depending on the user s settings If V 42 is desired and the detection phase is enabled the receiver determines the role of the modem via an originator variable If it acts as the originator the receiver detects an answerer detection pattern ADP sequence If this sequence is recognized within a T400 MOTOROLA Chapter 3 Module Descriptions 3 105 For More Information On This Product Go to www freescale com V 42 Error Correction Freescale Semiconductor Inc time period the receiver changes its state and waits for a frame opening flag Otherwise it starts working according to the V 14 protocol or it breaks the connection depending on the user s settings 3 106 poued oum gor e upm poezriudooo jou se ddo Detect ODP Detect ODP ADP recognized ADP recognized Detect first flag first protocol flag received Detect opening opening flag received closing flag detected poued oum gor e upm
141. e AT Xn command to the format of the CONNECT result code For printing the CONNECT result code the print result code function is used Table 3 111 Effect of the AT Xn command on the CONNECT result code AT X0 AT X1 X2 X3 X4 Result code CONNECT CONNECT lt text gt If the result code is equal to CONNECT text the function prints the speed of the Tx and Rx Data Pumps and the parameters of the correction and compression protocols The Global State Machine calls this function upon entering the online data state Returns None Code example struct channel t channel print connect amp channel MOTOROLA Chapter 3 Module Descriptions 3 223 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules text to dte Call s void text to dte struct channel t channel char str Arguments Table 3 112 text to dte arguments channel in Pointer to the Channel control data structure str in Null terminated string Description This function writes the null terminated string str into the Rx uart data buffer Returns None Code example struct channel t channel text to dte amp channel Text message 3 224 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Support Modules text to dte fixed
142. e Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules char present uart Call s bool char present uart void Arguments None Description This function checks the availability of a character in UARTO Returns TRUE A character is available in UARTO FALSE A character is not available in UARTO Code example bool character is available FALSE character is available char present uart MOTOROLA Chapter 3 Module Descriptions 3 177 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules in sample codec Call s int16 in sample codec void Arguments None Description This function gets a sample from UARTI Returns The sample obtained from UARTI Code example intl6 sample sample in sample codec 3 178 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc out sample codec Call s void out sample codec int16 sample Arguments Table 3 77 out sample codec arguments sample in Sample for sending to UARTI Description Returns Code example lntl6 sample 0 This function sends the sample to UARTI None out sample codec sample MOTOROLA Chapter 3 Module Descriptions For More Information On This Product
143. e Receiver control data structure data in Symbol for writing to the Rx data circular buffer Description This function writes the data into the Rx data circular buffer to the position pointed to by Rx control data head then updates Rx control data headto the next position in the buffer Returns None Code example struct Rx control t Rx control uint8 data 0 Rx data write amp Rx control data MOTOROLA Chapter 2 General Architecture 2 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Rx data read Call s inline uint8 Rx data read struct Rx control t Rx control Arguments Table 2 12 Rx data read arguments Rx control in Pointer to the Receiver control data structure Description This function reads the value of the current element in the Rx data circular buffer pointed to by Rx control data tail then updates Rx control data tail to the next position in the buffer Returns Value of the element pointed to by Se control data tail Code example struct Rx control t Rx control uint8 data data Rx data read amp Rx control 2 32 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx uart data write Call s inline void Tx uart data write struct Tx control t Tx control ui
144. e Tx control t structure parameter descriptions 2 8 state State identifier It contains the current state of the transmitter It is initialized in 7x channel init to TX SILENCE STATE sample ptr Pointer to the Tx sample circular buffer Users should not modify this pointer It is initialized in Tx channel init to the start of Tx sample MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel e sample head The Tx sample circular buffer write pointer The Data Pump modules modify this pointer when writing their samples into Tx sample It is initialized in Tx channel init to the start of Tx sample e sample tail The Tx sample circular buffer read pointer The Tx DAA Interface modifies this pointer when reading samples from Tx sample The Data Pump modules don t modify this pointer It is initialized in Tx channel init to the start of Tx sample e sample end Pointer to the end ofthe Tx sample circular buffer Users should not modify this pointer It is initialized in Tx channel init to the end of Tx sample e sample length Length of the Tx sample circular buffer Initialized in Tx channel init The user must ensure that the sample_length is large enough to hold all of the samples generated per call as specified by the value of number samples data ptr Pointer to th
145. e Tx data circular buffer Users should not modify this pointer It is initialized in Tx channel init to the start of Tx data e data head The Tx data circular buffer write pointer The Data Handler modules modify this pointer when writing symbols to Tx data It is initialized in Tx channel init to the start of Tx data data tail The Tx data circular buffer read pointer The Data Pump modules modify this pointer when reading symbols from Tx data for modulation It is initialized in 7x channel init to the start of Tx data e data end Pointer to the end of the Tx data circular buffer Users should not modify this pointer Itis initialized in Tx channel init totheendof Tx data data length Length of the Tx data circular buffer Initialized in Tx channel init Users must ensure that the data 1engthis large enough to hold all of the symbols that will be modulated by the current Data Pump uart data ptr Pointer to the Tx_uart_data circular buffer Users should not modify this pointer It is initialized in Tx channel init to the start of Tx uart data e uart data head The Tx uart data circular buffer write pointer The UART interface modifies this pointer when writing characters into Tx uart data It is initialized in 7x channel init to the start of Tx uart data e uart data tail The Tx uart data circular buffer read pointer The Data Handler or Command Parser modifies
146. e command circular buffer Initialized in Tx channel init data pump ptr Pointer to the current Tx Data Pump control structure Every Tx Data Pump module can have its own control data structure It is initialized in Tx channel init to NULL data pump call func Pointer to the function call associated with the current Tx Data Pump The 7x data pump function simply calls whatever function this pointer is pointing to It is initialized in 7x channel init to Tx silence gent Generates silence number samples Specifies the number of samples generated by Tx sample per call to the Tx data pump It is initialized in Tx channel init to DEFAULT NUMBER SAMPLES defined in modem h n bits Number of bits per symbol for the current modulator It is initialized in Tx channel init to 1 n bits mask Bit mask corresponding to 1 lt lt n bits 1 Can be used to mask for valid bits when converting to symbols for Tx data It is initialized in Tx channel init to 1 baud rate Modulator baud rate It is initialized in Tx channel init to 0 process count Specifies the maximum number of modulator specific operations for completion of the current state For example the DTMF generator uses it as a number of modulated digits It is initialized in Tx channel init to 1 data handler ptr Pointer to the current Tx Data Handler control structure Every Tx Data Handler module can have its own control structure It i
147. e fields of the Channel control data structure pointed to by the channel that are responsible for the Tx Data Handler data handler ptr data handler state data handler call func number n bits After calling this function the Tx Data Handler is initialized to perform the Tx V 23 Handshake sequence This function is called in state machine None struct channel t channel Tx V23 handshake init amp channel 3 16 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Data Pump Tx V23 handshake routine Call s void Tx V23 handshake routine struct channel t channel Arguments Table 3 10 Tx V23 handshake routine arguments channel in Pointer to the Channel control data structure Description This is the Tx V 23 Handshake Data Handler routine This function places OxFF values sequence of 1 s into the Tx_data buffer This function is called by the 7x data handler function via the channel Tx control ptr data handler call func Returns None Code example struct channel t channel Tx V23 handshake routine amp channel MOTOROLA Chapter 3 Module Descriptions 3 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V23 handshake init Call s void Rx V23 handshake init struct chan
148. e geheekelt 3 152 RX V8 Data Handler iade tea eee Ba eae ee 3 158 Contents V For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Contents Paragraph Page Number Title Number 3 6 3 The V 8 start up procedure in calling mode sess 3 165 3 6 4 The VS start up procedure in answering mode sse 3 165 3 7 S pport Module S serie debeo eU e Br sees Eaa E a loc Ep uo NINE SES 3 166 3 7 1 LBE H Rei 3 166 3 7 2 DAA Interface iet eee ee eei ade des qe RETINERI D DE esos 3 183 3 7 3 Tone Generator and Detector cccccccccccccccecessensecececcescessessseeeseeseeesensaaes 3 199 3 7 3 1 TONE Generatot 3 ar ee eege de de Sad e eed eve Gre ooh 3 199 3 7 3 2 Tone Detector steterit eut rnm 3 204 3 7 4 Ring DELO CLOT T 3 211 3 7 5 DIME Dialek entenien nnn a aoa a AE 3 213 3 7 6 Pulse Dale tm 3 or ire e dave sr a toco Case An EE 3 218 3 7 1 Text Eeer 3 221 3 8 Miscellaneous Functions eese eene entere eene nnne nen 3 229 3 8 1 AI Command ee 3 232 3 8 2 Command Par EE us iei cet ertet etii ete ie uie ieee as 3 233 3 8 3 Command Hand lets 5 nm tabudeimce uci DANH 3 241 vi MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Figures Figure Page Number Title Number 1 1 Modem Daughter Card Installation Jumper Senge 1 4 2 1 Bas
149. e line the calling modem shall be conditioned to receive signals in the high channel at 1200 bit s and transmit signals in the low channel at 1200 bit s The modem shall initially remain silent After 155 10ms of unscrambled binary 1 s have been detected the modem shall remain silent for a further 456 10ms then transmit an unscrambled repetitive dou ble dibit pattern of 00 and 11 at 1200 bit s for 100 3 ms Following this signal the modem shall transmit scrambled binary 1 s at 1200 bit s If the modem detects scrambled binary 1 s in the high channel at 1200 bit s for 270 40ms the handshake shall continue according to the 1200 bit s Handshake se quence for a calling modem However if unscrambled repetitive double dibit 00 and 11 at 1200 bit s are detected in the high channel then the end of receipt of this signal should be detected 600 10ms after detection of the end of repetitive double dibit 00 and 11 at 1200 bit s in the high channel the modem shall begin transmitting scrambled binary 1 s at 2400 bit s and 450 10ms after detecting this double dibit signal the receiver may begin making 16 way decisions Following transmission of scrambled binary 1 s at 2400 bit s for 200 10ms the modem shall be ready to transmit data at 2400 bit s When 32 consecutive scrambled 1 s at 2400 bit s have been detected in the high MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Pr
150. e seo ehh ed eed eeu 3 32 Bits encoding in V 22bis modem oe eee ib EENEG 3 33 V22bis_scramble_bit arguments EE 3 42 V22bis_descramble_bit arguments iei ient tn ane eh seien Pee SNE repens 3 43 Tx V22b1is Ttt APP URIe DIS Lu ooo ooh hoped eiui id obl dn odii ated ditas 3 44 Rx2V22BIS Init arPutHe DIS eg aieo oae tected gua ora peii endi uet 3 45 Rx V22bis handshake anit argumenhts z eei pet opel deer dee 3 46 Rx V22bis handshake routine argument 3 47 Tx V22bis handshake init argument 3 48 Tx V22bis handshake routine arguments esee nene 3 49 Tx V22bis change mode arguments cueste telcos cece asia 3 50 Rx V22bis change DOEMER eege dee e pee ni eget eee 3 51 PSK modulatof Uu arguments ee et reto pen Qa Urt ERN AIR a EUH 3 60 Pak modulator arguments gegen Eed NER RSS PRR SIR RE Uo Roa PRU ra gn UH ENEE 3 61 Pak demodulator iit arguments oec idet ete teen eei dente n bore nne aee ed Poe eene age 3 62 PSK demodulator arguments eese netta eire RS eee EY ego e eR Reed dn Cose oaa e Red qose 3 63 DPSK modulator nit argutnelits 21 needed o lesu ied dd poat i ae us 3 76 DPSK modulator arguments 5c eee edit aa 3 77 DPSK _demodulator_init arguments Je entero ERANT ERR nal oe eas 3 78 DPSK demodulator argUmehits ic onore eee avs e nodo o cera iden kar quee nds EE 3 70 QAM modulator init arguments eene eene enne ennt enne nenne 3 96 QAM modulator at gUITQEbs EE 3 97 MCF5407 LDR Soft Modem Software Devel
151. e switching system of the telephone number to be dialed The DTMF system uses eight different frequency signals transmitted in pairs to represent sixteen different numbers symbols and letters Table 3 100 shows how the frequencies are organized Table 3 100 Frequencies used by the DTMF generator Column Frequency Group 1209Hz 1336H 1477Hz 1633H z z 697Hz 1 2 3 A Row Frequency Group 770Hz 4 5 6 852Hz 7 8 9 941Hz 0 The DTMF Dialer module routines can be found in the dtmf c file The DTMF control data structure Tx DTMF control tis defined in dtmf h FC ek kk e e e e e ke e ko e ee e e e ke o ok ke e e e e ke e e o e e e e e e e ke e o e e e e e e e oe e e e e e e e e e e DTMF generator control data structure oko ke e e e e o e o e o ok ke e e e oe e ok e o o ke e ee o e oe ke o e e ee EE typedef struct Tx DTMF control t uint32 digit length ms uint32 digit pause ms uintl6 omega row uint16 omega column uintl6 phase row uint16 phase column uint32 samples left intl6 amplitude PG The 7x DTMF control t structure parameter descriptions e digit length ms Duration of digit in ms It is initialized in Tx DTMF init digit pause ms Duration of the pause between digits in ms It is initialized in Tx DTMF init MOTOROLA Chapter 3 Module Descriptions 3 213 For More Information On This Product Go to www freescale com Freescale Semicon
152. e the AT parser routine function This function is called by the Global State Machine Returns None Code example struct at parser control t at parser control struct channel t channel AT parser init channel amp at parser control 3 234 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Miscellaneous Functions AT parser routine Call s void AT parser routine struct channel t channel Arguments Table 3 121 AT parser init arguments channel in Pointer to the Channel control data structure Description This function implements the AT Command Parser It gets characters from the tx uart data buffer interprets the AT Commands and writes the interpreted AT Command into the command buffer This function is called by the command handler routine Returns None Code example struct channel t channel AT parser init channel amp at parser control AT parser routine amp channel Code explanation The state identifier sm parser state can be in one of three modes ATP coMMAND MODE ATP ONLINE COMMAND MODE ATP ONLINE DATA MODE In the case of ATP_COMMAND_MODE and ATP ONLINE COMMAND MODE the AT Parser can process the AT Commands received from the tx uart data buffer and store them at first in the local at command buf buffer After processing all the A
153. e to the Terminal UART or Universal Asynchronous Receiver Transmitter is an integrated circuit that converts parallel input into serial output The MCF5407 contains two independent UARTS e UARTO e UARTI can operate as a standard UART identical to UARTO or in modem mode as a USART In the LDR Soft Modem it works in modem mode 16 bit CODEC In the LDR Soft Modem UARTO is responsible for the DTE interface and UARTI is responsible for the interface to the 813044 DAA The UART module routines can be found in the mcf5407_uart c file The UART parameters structure uart params t is defined in the mcf5407_uart h FC ook ko e e e e e ke ke ke oo o e e e e e e ke ok ok ke e e e e e o e o e e ee e e oe e kk e e e e e e e oe e e e e e e e e e Enumeration type definitions used by Parameters of UART module ko e e e e e o ke ke ke ok ke e e e o o o ke o e ke e e e e EE enum data bits t data bits 5 data bits 6 data bits 7 data bits 8 MOTOROLA Chapter 3 Module Descriptions 3 165 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules enum parity t parity none parity even parity odd parity mark parity space enum stop bits t stop bits 1 stop bits 1 5 stop bits 2 enum channel mode t channel mode normal channel mode automatic echo channel mode local loopback channel mode remote loopback Only for UART1 enum uartl mode t fuart mode
154. eceive the CM message in Answering Mode or JM message in Calling Mode The state identifier va sub state can be in one of the following states case V8 TEN ONES In this case the V8 Data Handler receives ten binary 1 s and goes to the va PRE sue state case V8 PRE SYNC In this case the V8 Data Handler determines the beginning of the sync message and goes to the va svwc state case V8 SYNC In this case the V8 Data Handler interprets the sync message and goes to the V8 CALL FUNCTION State If the sync message wasn t received the V8 Data Handler will go back to the va TEN owes state MOTOROLA Chapter 3 Module Descriptions 3 161 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module case V8 CALL FUNCTION case V8 MODN1 In these cases the V8 Data Handler interprets the call function modn0 modn1 and modn2 messages stores the TRUE value into the corresponding Boolean variables if the corresponding message was interpreted and stores the TRUE value into the corresponding Boolean variables if the corresponding modulation protocol is supported by the remote modem After receiving two interpreted CM Answering Mode or JM Calling Mode messages the V8 Data Handler stores the available modulation protocols in hidden registers and allows the CJ message to be sent Calling Mode or allows the JM message to be sent and goes to the va pcg amp
155. ed in init h The most important benefit of using the SM is the ability to upgrade the modem purely via software Upgrades are typically provided to add new features fix bugs or enhance modem performance The features of the LDR Soft Modem architecture are Flexible addition of new Data Pump and Data Handler protocols with minimum modification required to the current source code e There is a potential for use in multi channel systems The data interface between the Soft Modem modules uses a set of Circular Buffers It is better to implement circular buffers for the interface This approach insulates the modem blocks running at different synchronous and asynchronous rates e There is a well defined division of data processing between the Data Pump the Data Handler and others modules of the Soft Modem Separate modules can work synchronously by detecting the level to which the Circular Buffers are filled 2 2 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The Basic Blocks of the Soft Modem 2 1 The Basic Blocks of the Soft Modem This section is important for understanding how the LDR Soft Modem works Figure 2 2 shows the Basic Blocks of the Soft Modem and the general flow of data between them sESEEHEEREEERRRERENE RRRR RA ne Rx UARTI Control behavior of the Soft Modem
156. ee e oe e o ke e e e e e e oe e e e e e eee Biquad Filter parameters Structure oko e e e e oe ke ke ke o o ke e e e o o ok ke o ke e e e e c oe e ke e e e e e e oe e oo e e e e e e e e ok e ee eoo define DET FILTER A NUMBER 5 define DET FILTER X NUMBER 2 define DET FILTER Y NUMBER 2 struct biquad param t int16 a DET FILTER A NUMBER int16 x DET FILTER X NUMBER int16 y DET FILTER Y NUMBER hi The biquad filter is represented as Filter output a 0 input sample a 1 x 0 a 2 x 1 a 3 y 0 a 4 y 1 The biquad param t structure parameter descriptions e a Array of biquad filter coefficients It is initialized in Rx one init to values from the filter coef group depending on the type of tone e x Array of biquad filter inputs It is initialized in Rx tone init to 0 s 3 204 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules e y Array of biquad filter outputs It is initialized in Rx tone init to O s FC KR RR ko e e e e ke ke ke e k e e ee e oe ok ok ko kk e e e e e oe e o e e e ee e oe e kk e e e e e e e oe e e o e e e ee e Double Biquad Filter parameters Structure oko e e e e e oe e oe e o ok ke e e e oe e ok ke e ke e e e e ce o e o e e ee e e o ke o o e e e e e ke e e ok e ee ee kK struct double biquad param t bool enabled st
157. ee ee o b b o o ke ok ok ok ke kk oko ko e e ee e e eoe ee ee ke o e e typedef struct Tx control FSK t uint32 f space uint32 f mark MOTOROLA Chapter 3 Module Descriptions 3 55 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump uintl6 phase uintl6 phase incr 21l uintl6 baud frac uintl6 baud incr uint8 current bit intl6 amplitude The rx control FSK t structure parameter descriptions 3 56 f space Space frequency in Hz It is used to represent binary O It is initialized in Tx V21 init or Tx V23 init f mark Mark frequency in Hz It is used to represent binary 1 It is initialized in Tx V21 init or Tx V23 init phase Current phase of the frequency generator in Q15 format It is initialized in FSK modulator init to 0 phase mer Frequency phase increment per sample in Q15 format phase incr 0 is used for Space frequency and phase incr 1 is used for Mark frequency It is initialized in FSK modulator init baud frac Fractional part of the baud in Q15 format It is initialized in FSK modulator init to 0 baud incr Increment to baud frac per sample in Q15 format It is initialized in FSK modulator init current bit Current bit of data for modulation It is initialized in FSK modulator init to O amplitude Amplitude of the output signal in Q14 It is initialized in Tx V2 init or Tx V23 init
158. eescale com Data Pump Freescale Semiconductor Inc uintl6 carrier phase MOTOROLA uintl6 uint16 uint16 uint16 uint16 uinti6 uint8 int16 int16 guard phase carrier phase incr guard phase incr baud frac baud incr omega ptr current nbits amplitude carrier amplitude guard scrambler call func t scrambler bool scrambler enabled uint32 uint32 int16 int16 uint32 scrambler register filter size filter coef DPSK FIXED EQ COEF NUMBER filter buf DPSK FILTER BUF SIZE filter buf ptr e f carrier Carrier frequency in Hz This field is initialized in function Tx V22 init f guard Guard tone frequency in Hz This field is initialized in function Tx V22 init carrier phase Current phase of the carrier frequency generator in Q15 format This field is initialized in function DPSK modulator init to 0 e guard phase Current phase of the guard tone generator in Q15 format This field is initialized in function DPSK modulator init to 0 carrier phase incr Carrier frequency phase increment per sample in Q15 format This field is initialized in function DPSK modulator init Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 71 Freescale Semiconductor Inc Data Pump guard phase incr Guard tone frequency phase increment per sample in Q15 format This field is initialized in function
159. el control data structure Description This is the Transmitter Data Handler entry point A call to this function will execute if possible the function Tx control data handler call func associated with the current Tx Data Handler The Tx data handler function contains logic to check the condition of Tx contro1 data head and Tx control data tail to determine if the number of symbols specified by Tx control number n bits can be placed into the Tx data buffer yet If the distance between the two pointers is equal to or less than the value Tx control number n bits it calls the Tx control data handler call func This function is called in state machine Returns TX DH OK The Tx control data handler call func Was called e TX DATA BUF FULL The Tx control data handler call func was not called because Tx data is already full Code example struct channel t channel Tx data handler amp channel 2 50 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Rx data handler Call s enum Rx DH result t RX DH OK RX DH NO DATA enum Rx DH result t Rx data handler struct channel t channel Arguments Table 2 26 Rx data handler arguments channel in Pointer to the Channel control data structure Description This is the Receiver Data Handl
160. emote modem This situation causes a protocol error MOTOROLA Chapter 3 Module Descriptions 3 117 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction 3 2 Support of the V 14 protocol The V 42 module supports data transfer according to the V 14 protocol This protocol is used when the error correcting protocol cannot be established The V 14 protocol cannot guarantee that data will be delivered to the remote modem correctly Also it cannot guarantee that received data was not damaged because of noise on the line The V 42 module falls back to the V 14 protocol when the V 42 error correcting protocol cannot be established between two modems or when use of the V 42 protocol is denied by the user The transition to the V 14 protocol is shown in the Figures 3 2 3 and 3 2 4 When the receiver receives data by the V 14 protocol it operates in the V14 DATA IN state The receiver moves to the V14_EMPTY BUFFER sub state if the attempt to establish the V 42 protocol fails During the V 42 detection phase the modem could have received data in which it did not recognize the ADP ODP patterns In this sub state it outputs all that data to the Rx uart data buffer After that it changes its state to V14 1 GETTING Inthe V14 1 GETTING state the receiver gets data bit by bit from the rx buffer until it identifies a 0 bit This bit in the V 14 protocol acts as a start bit of a byte
161. end ms Time before starting to transmit binary 1 s in ms It is initialized in Rx_V23_handshake_init to 456 ms if the receiver is in calling mode otherwise it is initialized to 0 wait_carrier_ms Time before the modem goes into the data mode ready to transmit and receive actual data in ms It is initialized in Rx_V23_handshake_init to 755 ms if the receiver is in calling mode otherwise it is initialized to 600 ms current_counter Counter used in the current state for the calculation of binaries conducive to completion of the current state For example number of binary 1 s in the RX_V23_ DH DETECT ONES state It is initialized in Rx_V23_handshake_init to 0 global_counter Counter of bits received throughout the handshaking process It is initialized in Rx_V23_handshake_init to 0 MOTOROLA Chapter 3 Module Descriptions 3 13 For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc Tx V23 init Call s void Tx V23 init struct channel t channel struct Tx control FSK t Tx control FSK bool calling enum v23 mode t mode Arguments Table 3 7 Tx V23 init arguments channel in Pointer to the Channel control data structure Tx control FSK in Pointer to the FSK transmitter control data structure calling in Contains TRUE if the transmitter is in calling mode and FALSE if the transmitter is in answering mode mode in Defines mo
162. er 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 0 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 21 3 22 3 23 3 24 3 25 3 26 3 27 3 28 3 29 3 30 3 31 3 32 3 33 3 34 3 35 3 36 3 37 3 38 3 39 3 40 3 41 3 42 Freescale Semiconductor Inc Tables Page Title Number BY 2 IME arg MEMES TEE 3 6 Tx VAI handshake anit arg tmerits ie eats eels eng ee aca 3 7 Tx_V21_handshake_routine arguments nennen enne 3 8 Rx V21 handshake init arguments 5 5 5 ettet tenerte epu a sn nk ee eh de eda Pt ne eS ae Eeer 3 9 Rx VII handshake routine arguments ssssseeseeeeeeeeenee enne ennemi 3 10 TX Ee E 3 14 RXx V23 rae WIE MS ss bete itae oe nets de petet tee LUE 3 15 Tx V23 handshake init 3rgurielits e leen podes rote Mdses li Qe ada ul Redit 3 16 Tx V23 handshake routine arguments esee ener 3 17 Rx V23 handshake init arguments enne enne enne eene 3 18 Rx V23 handshake routine arguments essssesseseeeeeeeeenee enne enne ennt 3 19 Bits eneoding qi EE 3 2 N22 scramble bit arguments sca e unt 3 25 3527 GEST AMID EE ee 3 26 1xV22 AME e 3 27 Rx V22 init EE 3 28 Rx V22 handshake init arguments 5 ie ches diene deed ages e deet 3 29 Rx V22 handshake routine arguments scio ooo estees toa siepe aee sokipi Sieg 3 30 Tx_V22_handshake_init argutelits ooo oberen oa e Ce va doo oett eeuiva ode egit s 3 31 Tx V 22 handshake routine arguments 5e dan ha eee yer
163. er s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump CO DUT BEEN SEENEN Detect HM Wait HE Detect sU Wait i UnscrambledOnes i i for456ms 7 7 i ScrambledOnes for765ms or 13505 GE SC E E a GE a gt lt Connect to Silence i i line amp dial Scrambled e DATA 1800Hz or 550Hz Guard Tone Connect to i line ailer GN 2100Hz Answer Tone Unscrambled ses Scrambled T s validation C de K ch i er k P oq E Do i Diteci L Xem For2150ms HIRED DEDERE Do Senn H Wait amaxaniuuaR iaa For3300ms 5 77 For75ms 77 Scrambled Ones S HTC for 270ms M for 765 ms j Figure 3 6 Handshake sequence Handshake sequence for calling modem a b c Once the calling modem has connected to the line it shall be conditioned to receive signals in the high channel The modem shall remain silent until unscrambled binary 1 s are detected for a period of 155 50 ms After waiting for a further 456 10 ms it shall transmit scrambled binary 1 s in the low channel Upon detecting scrambled binary 1 s in the high channel for a period of 270 40 ms the modem shall wait a further 765 10 ms then it is ready to transmit and re ceive data Handshake sequence f
164. er current state is complete 3 SM INIT RETRAIN STATE e On the Retrain sequence detection 4 SM RESET COMMAND STATE e On the reception of any character from the DTE e On the Break of the line 2 18 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Global State Machine Table 2 1 The Global State Machine States continued Name of the State Activities Exit States SM INIT RETRAIN STATE If the current Data Pump is in the 2400bps V 22bis mode it initializes V 22bis Handshake in the Retrain mode 1 SM RETRAIN STATE By default 2 SM PHISICAL HANDSHAKING STAT E fthe variable return sm state is equal to SM PHISICAL HANDSHAKING STATE 3 The state is equal to the value of the return sm state variable f the current Data Pump is not in the 2400bps V 22bis mode SM RETRAIN STATE Calls the Tx amp Rx Data Handlers Handshaker and the Tx amp Rx Data Pumps When the Rx Data Handler Handshaker current state is complete it loads the saved parameters of the old Data Handler If the variable return sm stateis equal to SM ON LINE STATE it calls the Command Parser for Escape Sequence detection otherwise on the receipt of any character from the DTE it goes on hook and sends the NO CARRIER response to the DTE On the break of the line event it goes o
165. er text and trailer are determined by a user setting Table 3 109 shows the effect of setting the AT Vn command to the Information text format All references to cr mean the character with the ordinal value specified in parameter S3 all references to If likewise mean the character with the ordinal value specified in parameter S4 Table 3 109 Effect of AT Vn command on Text response format AT VO AT V1 Information lt text gt lt cr gt lt lf gt lt cr gt lt lf gt responses lt text gt lt cr gt lt lf gt Information text returned in response to manufacturer specific commands may contain multiple lines and the text may therefore include CR LF and other formatting characters to improve readability This function is used by the AT Command handler Returns None Code example struct channel t channel print text response amp channel LDR SoftModem 3 222 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules print connect Call s void print connect struct channel t channel Arguments Table 3 110 print connect arguments channel in Pointer to the Channel control data structure Description This function writes the CONNECT result code according to V 25ter to the Rx uart data buffer Table 3 111 shows the effect of setting th
166. er 3 Module Descriptions 3 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V21 init Call s void Rx V21 init struct channel t channel struct Rx control FSK t Rx control FSK bool calling Arguments Table 3 2 Rx V21 init arguments channel in Pointer to the Channel control data structure Rx control FSK in Pointer to the FSK receiver control data structure calling in Contains TRUE if the receiver is in calling mode and FALSE if the re ceiver is in answering mode Description This function sets the fields of the FSK receiver control data structure pointed to by the Rx control FSK f space f mark Int coef filter size and calls Fs amp demodu1ator init ltalso initializes the fields of the Channel control data structure pointed to by the channel that are responsible for the Rx Data Pump data pump ptr baud rate number samples data pump call func state n bits n bits mask process count After calling this function the Rx Data Pump is initialized to work according to V 21 This function is called in state_machine Returns None Code example struct channel t channel struct Rx control FSK t Rx control FSK bool calling TRUE Rx V21 init amp channel amp Rx control FSK calling 3 6 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www
167. er entry point A call to this function will execute if possible the function Rx control data handler call func associated with the current Rx Data Handler The ge data handler function contains logic to check the condition of Rx control data head and Rx control data tailto determine if the number of symbols specified by Rx control number n bits are present in the Rx data buffer yet If the distance between the two pointers is equal to or more than the value Rx control number n bits itcalls the Rx control data handler call func This function is called in state machine Returns e RX DH OK The Rx control data handler call func Was called normally RX DH NO DATA The Rx control data handler call func was not called because Rx data is not full enough Code example struct channel t channel Rx data handler amp channel MOTOROLA Chapter 2 General Architecture 2 51 For More Information On This Product Go to www freescale com Interface Freescale Semiconductor Inc command parser Call s void command parser struct channel t channel Arguments Table 2 27 command parser arguments channel in Pointer to the Channel control data structure Description This is the Command Parser entry point This function calls the function Tx control command parser call func associated with the current Command Parser only This function is called in state machine Returns
168. eriod This is required for the clock recovery module For more detailed information about the scrambler refer to Section 3 1 4 2 3 1 7 1 2 Encoder The encoder implements encoding of the incoming sequence d n into the values of the sequence I n Q n i e its function is to map every two incoming bits of the incoming sequence d n to a total phase The total phase is then represented by the values of the sequence I n Q n and the latter is transmitted The mapping rule can be seen in Section 3 1 4 1 In the current implementation of the encoder it finds the appropriate I and Q values for the incoming quadbit or dibit and is executed once per baud 3 1 7 1 3 Modulator The modulator moduLates the cosine wave The output of the modulator is given by s n I n cos 6 n Q n sin o n Where n is the current carrier phase and s n is the sample ready for transmission The modulating frequency for V 22bis is 1200 Hz for a calling modem and 2400 Hz for an answering modem MOTOROLA Chapter 3 Module Descriptions 3 81 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 7 1 4 Transmit filter The transmit lowpass filters are implemented using 48 tap FIR structures whose frequency responses exhibit a raised cosine shape The raised cosine response is used since it minimizes the intersymbol interference 3 1 7 1 5 Guard tone generator This module generates the
169. es Page Title Number daa_aout_mute EE 3 190 daa Tine detect argurie ls o cocta eet decisio qu eet ae i onec dtque 3 191 dad BO OFT hook ar PUEDE Sus Sask gaa E SEO RU Eecher ee INE goes nen 3 192 daa go om hook argumentis rere nen er nected cade rae ione e ue da edd pedea 3 193 dau ead reg arguments sce ia EE 3 194 daa write Teg er 3 195 KE e c n elaine ed etna Baoan 3 196 Rx uad are uments E 3 198 Tones that are supported by the Tone Generator 3 199 Fe eum MT aEPUTHEHES oosina S KEE Geet SE 3 202 Tx to e eins cte TR 3 203 Tones that are supported by Tone Detector nne dritten oerte etes 3 204 Rx Aone int ate rielits 2d eae oa ne tone ee eee tek 3 209 Rx lotie GEMET e ee ea ae eee ee 3 210 Rx_ring_det_init Ar SUNS TNS acs eisdem vidit etiem iaa Gass aita quet MEHR HD UMS 3 212 Rx ring detect arguments i125 aieo Fed tecti I treat De Re OE TEL epa cda 3 213 Frequencies used by the DTMF generator ene 3 214 Tx ENEE e 3 216 T3 KE ee 3 217 Tx PULSE E een 3 219 Tx pulse arguments EE 3 220 Correspondence of dial digits to the number of Make Break pulses 3 220 print result code argumients errem tenen eara RI ERR OP ap aea V Ue Eee eeu Rd R 3 222 Effect of the AT V command on the Result code format 3 222 print text EE 3 223 Effect of AT Vn command on Text response format eseeeeeeeee 3 223 printconnect arguments EE 3 224 Effect of the AT Xn comm
170. es of compression function transparent and compressed In the compressed mode as mentioned above the transmission is based on codewords In the transparent mode there is no codeword transmission and the characters entering the 3 128 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Overview encoder are not translated being sent as a normal character The transparent mode is very useful when a very mixed character stream is input to the encoder There is a high probability that each of the incoming characters will not be matched such a situation often exists immediately after dictionary initialization With every incoming unmatched character the encoder outputs a byte however the minimal codeword size is equal to 9 so in such a case the compression efficiency will be negative to a considerable percentage The V 42bis module contains a Data Compression Test that determines when data compression will be effective Basically the test performs a comparison of bits before and after compression and calculates the efficiency of the mode used The compression efficiency request is used to switch from the transparent to the compressed mode and vice versa depending upon the characteristics of the transmitted data According to the ITU standard switching to compression mode is necessary when previous data which was
171. ess ssi tete cei te te iiic ts 3 67 Decision block and Decoder eese 3 67 escrambler z es ea b Ee EE e teer Ted 3 68 CIOCIGROCOVELY EE 3 68 Carrier Recovery eus i ADR S TS ASSERIT A INS Ho rage nH A Td MuR 3 69 DPSK modulator control structure cccccccccceccceseessnsecececececessesssseceeeeees 3 70 DPSK demodulator control structure 3 72 UAM teo obest oda desees d edibus E 3 80 OAM KEE dee oS neh a ee Rls Medan 3 80 Scramblet 52 e eee oe e ARE 3 81 n rdlech tee ee E ette tute Dre ebrios ee DEEP DAS VEN 3 81 Modua OE are ttt eite emnes tese eite 3 81 Transmit filter EE 3 82 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Paragraph Number 3 1 7 15 3 1 7 2 3 1 7 2 1 3 1 7 2 2 3 1 7 2 3 3 1 7 2 4 3 1 7 2 5 3 1 7 2 6 3 1 7 2 7 3 1 7 2 8 3 1 7 3 3 1 7 4 3 2 3 2 1 3 2 2 3 2 3 3 2 4 3 2 5 3 2 5 1 3 2 5 2 3 2 5 3 S221 3 2 5 3 2 3 2 5 4 3 2 5 5 3 2 5 6 3 2 5 7 3 2 6 3 2 7 3 3 3 3 1 3 4 3 4 1 3 4 2 3 4 3 3 5 3 5 1 Ee fe 3 6 3 6 1 3 6 2 MOTOROLA Freescale Semiconductor Inc Contents Page Title Number Gu artd tone SeneEatots ostessde egene 3 82 QAM KEIER 3 82 Bandpass EE 3 82 Automatic Gain Control AO 3 83 RE 3 83 Decision block and Decoder ie eie eed ee 3 83 Brent NIE 3 84 Adaptive Equalizer sun tent it pe ree teria urget 3 84 Clock RECOVERY 1 55 nr HR VHEXR E ARUAT KENN TY SUBE SVASUN MES
172. et interpretation e Scrambling descrambling Dialing e Synchronous asynchronous conversion Modem configuration control e Protocol initialization The Modem Daughter Card is based on the Silicon Laboratories S13044 Data Access Arrangement DAA combined 813021 and Si3015 chipset shown in Fig 2 this provides a programmable line interface to meet global telephone line interface requirements see Si3044 Data Sheet R2 01 Si3044 DS201 Modem communication is a real time process where data must be communicated in both directions within a fixed period of time If the modem does not meet real time requirements then the modem might drop the connection In the SM data is sampled at 9 6KHz so the SM must process data every 0 00010416 Seconds The LDR Soft Modem is capable of performing a full suite of modem functions in real time on the MCF5407 Data buffering is used to accommodate stress conditions The modem accumulates a number of samples in a buffer and processes those samples while gathering the next set of samples Code optimization is also important as optimization has architectural dependencies The most critical parts of the source code have been rewritten in assembler taking into account the abilities of the MCF5407 especially the MAC module These assembly implementations also include a C interface To enable the optimized assembler source code it is required to define USE OPTIMIZED ASSEMBLER CODE By default this is defin
173. f ptr Pointer to the current element of the filter buf This field is initialized in function DPSK modulator init 3 1 6 4 DPSK demodulator control structure typedef struct Rx control DPSK t 3 72 uint32 f carrier uintl6 carrier phase uintl6 carrier phase incr uintl6 baud frac MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump uintl6 baud incr uintl6 omega ptr uintli6 total phase uint32 filter size intl6 filter mark i DPSK FIXED EQ COEF NUMBER intl6 filter mark q DPSK FIXED EQ COEF NUMBER int16 filter buf DPSK FILTER BUF SIZE uint32 filter buf ptr uintl6 arbitrary phase bool decision enabled scrambler call func t descrambler bool descrambler enabled uint32 descrambler register intl6 noise threshold intl6 agc uint32 agcave int16 avecnt intl6 smax intl6 carrier locked intl6 PLL1 int16 CPLL1 int32 cerror sig MOTOROLA Chapter 3 Module Descriptions 3 73 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump int32 clerror sig int32 clerror2 sig uint32 baud nrg3 uint32 baud nrg7 intl6 signal present intl6 clock corrected 3 74 f carrier Carrier frequency in Hz This field is initialized in function Rx V22 init carrier phase Current phase o
174. f the Soft Modem is in Calling Mode and FALSE if the Soft Modem is in Answering Mode Description Initialisation of the Rx V8 Data Handler The Rx V8 Data Handler takes control of the data structure The user must call this function before calling the Rx V8 DH routine and v8 get bits functions It is only necessary to call it once before Data Handler operation Returns None Code example struct channel t channel static struct Rx V8 DH t Rx V8 DH bool calling calling TRUE Rx V8 DH init channel amp Rx V8 DH calling Rx control data handler call func x V8 DH routine 3 160 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com V 8 Software Module Freescale Semiconductor Inc Rx V8 DH routine Call s void Rx V8 DH routine struct channel t channel Arguments Table 3 68 Rx V8 DH routine arguments channel in Pointer to the Channel control data structure Description This function gets data from the Rx data buffer using the v8 get bits function analyzes CM JM or CJ messages and transitions the Tx and Rx V8 Data Handlers into suitable states Returns None Code example struct channel t channel Rx control data handler call func channel Code explanation The state identifier v8 state can be in the following state case V8 DCE CM In this case the V8 Data Handler will r
175. f the carrier frequency generator in Q15 format This field is initialized in function DPSK demodulator init to 0 carrier phase incr Carrier frequency phase increment per sample in Q15 format This field is initialized in function DPSK demodulator init baud frac Fractional part of the baud in Q15 format i e 0 5 the middle of the baud This field is initialized in function DPSK demodulator init to 0 baud incr Increment to baud frac per sample in Q15 format This field is initialized in function DPSK demodulator init omega ptr Pointer to Nbits to Phase Change Correspondence table This field is initialized in function Rx V22 init total phase The phase transmitted during the previous baud interval in Q15 format This field is initialized in function DPSK demodulator init to 0 filter size The number of coefficients used by the input BPF This field is initialized in function DPSK demodulator init filter mark I Coefficients of the BPF for I channel in Q14 format This field is initialized in function DPSK demodulator init filter mark q Coefficients of the BPF for Q channel in Q14 format This field is initialized in function DPSK demodulator init filter buf Cyclic buffer used by the filter algorithm of the input BPFs This field is initialized in function DPSK demodulator init to Q filter buf ptr Pointer to the current element of the filter buf This field is initialized in function DPSK demodulato
176. fective dictionary modification appending a new string and removing a node in the dictionary recovery mode The V 42bis algorithm constantly monitors the current compression ratios If the ratio becomes negative then the compression estimation function is switched off and communication changes to standard eight bit character codes transparent mode If the ratio becomes positive communication changes to codeword transmission The compression estimation function is used to measure the difference between the amount of bits transferred to an encoder output ignoring control codewords and the amount of bits of all bytes accepted by an encoder input The transmitter can be in the transparent mode and transfer bytes to an output as is however the encoder can internally call the Data Compression Test If this function becomes positive it means that transmission using the transparent mode the bits transferred is more than the bits accepted is more effective otherwise it is more useful to work in the compression mode If the compression estimation function falls below a negative threshold then a decision is made to switch over Similarly if the compression estimation function exceeds a positive threshold while still in the transparent mode the transmitter is switched to the compression mode The threshold for switching into the transparent mode is selected to be higher to avoid continual switching away from compression mode for minor negative exc
177. ffice digital dna is a trademark of Motorola Inc All other product or service names are the property of their respective owners Motorola Inc is an Equal Opportunity Affirmative Action Employer Motorola Inc 2003 For More Information On This Product Go to www freescale com Paragraph Number 1 1 1 2 1 3 2 1 2 2 2 5 2 4 2 4 1 2 4 2 2 5 2 6 2 6 1 2 6 2 3 1 3 1 1 3 1 1 1 3 1 2 MOTOROLA Freescale Semiconductor Inc Contents Title About This Book Audience need eb Basse es Suggested Readmg u EE General Intormatpon nennen nennen ColdFire Documentation cccccccccecessssscccesececeesessnseeeeeeees Acronyms and Abbreviations eese eere Chapter 1 Introduction Key Pe atures eege Related e OUICI EE Chapter 2 General Architecture The Basic Blocks of the Soft Modem eI Sampling Frequency etit tei te ret oe dede denen Numeric Formats ete ie tede eei Channel bU ROBBIE ed NNI HERENNIUM ie BW So ee Sec BAY EE Global State Machme sse Interface sitters tesi tee ena Eet Global Data Structures Circular Buffer Inline Functions seen Chapter 3 Module Descriptions EE Contents For More Information On This Product Go to www freescale com Page Number Paragraph Number 3 1 2 1 3 1 3 3 1 3 1 3 1 3 2 3 1 3 3 3 1 3 4 3 1 3 5 3 1 4 3 1 4 1 3 1 4 2 3 1 4 3 3 1 4 4 3
178. fined This function is called in state machine Tx pulse and AT handler routine Returns None Code example struct daa control t daa control daa go off hook amp daa control MOTOROLA Chapter 3 Module Descriptions 3 191 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules daa go on hook Call s void daa go on hook struct daa control t daa control Arguments Table 3 87 daa go on hook arguments daa control in Pointer to the DAA Interface control structure Description This function causes the line side chip to go on hook It generates an on hook command by applying a logic 1 to the OFHK pin if DAA HW HANG UP is defined or by resetting the OH bit in Register 5 if DAA HW HANG UP is not defined This function is called in state machine Tx pulse and AT handler routine Returns None Code example struct daa control t daa control daa go on hook amp daa control 3 192 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc daa read reg Call s uint8 daa read reg struct daa control t daa control uint8 reg number Arguments Table 3 88 daa read reg arguments daa control in Pointer to the DAA Interface control structure reg n
179. from the Tx data buffer processes them and places the resultant samples into the Tx sample buffer The number of generated samples per call is defined by channel Tx control ptr number samples This function contains the scrambler the encoder digital modulator and digital filter For more detailed information about these blocks refer to Section 3 1 7 2 This function is called by the 7x data pump function of modem c module via the channel Tx control ptr data pump call func Returns None Code example struct channel t channel QAM modulator channel MOTOROLA Chapter 3 Module Descriptions 3 97 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump QAM demodulator init Call s void QAM demodulator init struct channel t channel Arguments Table 3 43 QAM demodulator init arguments channel in Pointer to the channel control data structure Description Initialization of the QAM receiver control structure Rx control QAM 1t The pointer to this structure is contained in channel Rx control ptr 2data pump ptr Fills up the appropriate fields of this structure with default values carrier phase carrier phase incr total phase baud frac descrambler register filter buf and so on refer to Section 3 1 7 5 for more details This function is called by the Rx V22bis init functions of the v22bis c module Returns None Code exam
180. function is called by the Interrupt Service Routine of UARTI on a Receiver ready event Returns None Code example struct channel t channel Rx daa amp channel MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules 3 7 3 Tone Generator and Detector The Tone Generator amp Detector module provides generation and detection of a variety of signals associated with call progress 3 7 3 4 Tone Generator The signals that are produced by the Tone Generator are represented in Table 3 92 CC e e ke e ke ke ke ke ke ko ko RRR RRR RRR kk kk kk kk e ee He ob oe He ee ke ke kek e e RR RRR o RR e e e e e e e e e e Types of tones RR RRR RR kk kk ke e e e e oe oe oe oe oe ee EE enum gen tone type t GEN ANS TONE GEN ANSAM TONE GEN ANS REV TONE GEN CALLING TONE GEN SILENCE TONE Table 3 92 Tones that are supported by the Tone Generator Correspondence with Signal Description gen tone type ttype GEN ANS TONE Answering tone The tone transmitted from the answering end ANS The answering tone is a continuous 2100 15 Hz tone with a duration of 3 3 0 7 s GEN ANS REV TONE Answer tone with The tone transmitted from the answering end phase reversals It consists of a sine wave signal at 2100 15 Hz ANS with phase reversals at an interval of 450 25ms GEN_ANSAM_TONE Modified answer The tone transmitted from the answeri
181. function is called in state_machine None struct channel t channel Tx reset amp channel 2 46 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Interface Rx reset Call s Freescale Semiconductor Inc void Rx reset struct channel t channel Arguments Table 2 22 Rx reset arguments channel in Pointer to the Channel control data structure Description This function resets most of the used fields in the Receiver control data structure sample head sample tail data head data tail data pump ptr data pump call func state number samples baud rate process count n bits n bits mask connection code pointed to by the cnanne1 Rx control ptrto the default values This function is called in state machine Returns None Code example struct channel t channel Rx reset amp channel MOTOROLA Chapter 2 General Architecture 2 47 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx data pump Call s enum Tx result t TX OK TX SAMPLE BUF FULL TX STATE COMPLETED enum Tx result t Tx data pump struct channel t channel Arguments Table 2 23 Tx data pump arguments channel in Pointer to the Channel control data structure Description This is the Transmitter Tx Data Pump entry point A call to th
182. further processing It is initialized in Rx channel init to the start of Rx data e data end Pointer to the end of the Rx data circular buffer Users should not modify this pointer Itis initialized in Rx_channel_init to the end of Rx data data length Length of the Rx_data circular buffer Initialized in Rx channel init Users must ensure that the data_length is large enough to hold all of the symbols that will be demodulated by the current Data Pump e uart data ptr Pointer to the Rx uart data circular buffer Users should not modify this pointer It is initialized in Rx channel init to the start of Rx uart data e uart data head The Rx_uart_data circular buffer write pointer The Data Handler modules modify this pointer when writing characters into Rx uart data It is initialized in Rx channel init to the start of Rx uart data e uart data tail The Rx uart data circular buffer read pointer The UART Interface modifies this pointer when reading characters from Rx uart data for sending to the DTE It is initialized in Rx channel init to the start of Rx uart data e uart data end Pointer to the end of the Rx uart data circular buffer Users should not modify this pointer It is initialized in Rx channel init to the end of Rx uart data e uart data length Length of the Rx uart data circular buffer Initialized in Rx channel init data pump ptr Pointer to the
183. hake bool calling TRUE Rx V21 handshake init amp channel amp Rx V21 handshake calling MOTOROLA Chapter 3 Module Descriptions 3 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V21 handshake routine Call s void Rx V21 handshake routine struct channel t channel Arguments Table 3 6 Rx V21 handshake routine arguments channel in Pointer to the Channel control data structure Description This is the Rx V 21 Handshake Data Handler routine This function reads data symbols from the Rx data buffer The function performs and controls the V 21 Handshake sequence see 3 1 1 2 After successful completion of the Handshake sequence it sets channel Rx control ptr data handler state to RX DH STATE COMPLETED otherwise to RX DH STATE FAILED This function is called by the Rx data handler function via the channel Rx control ptr data handler call func Returns None Code example struct channel t channel Rx V21 handshake routine amp channel 3 10 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 2 V 23 The V 23 module implements the ITU V 23 recommendation for speeds of 600bps and 1200bps it also supports a backward channel of 75bps for use in the GSTN The V 23 implementa
184. he 2nd parameter optional e l stbyte is the 3rd parameter optional Using parameters is optional and depends on a concrete command Depending on the AT commands the Command Handler can e Modify S registers Control minimum and maximum values of the S registers Change the Global State Machine s current state e Change the H registers e Send informative messages to the DTE e Send command response to the DTE If the command number or any of the parameters is wrong the Command Handler breaks commands handling clears the command buffer and sends an ERROR response to the DTE This function is called by the command handler function via channel Tx control ptr command handler call func For more information about AT Command Handler actions on AT commands please refer to the MCF5407 Low Data Rate Soft Modem AT Command reference User Manual Returns None 3 242 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions Code example struct channel t channel AT handler init amp channel AT handler routine amp channel MOTOROLA Chapter 3 Module Descriptions 3 243 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions choose data pump protocol Call s void choose data pump protocol void
185. he same takes place with the v42 tx data function It is called only if the amount of data in the Tx data buffer is less than a preset threshold These thresholds are also set in the v42 mm function void v42 init struct channel t channel MOTOROLA Chapter 3 Module Descriptions 3 101 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction channel Tx control ptr number n bits 8 channel Rx control ptr number n bits 8 3 2 1 General structure of the V 42 module The structure of the V 42 module is shown in Fig 3 2 2 A received block of data is checked for the FCS first except if it is not a flag or if it is data according to the V 14 protocol then it is passed to the receiver if the check sum is correct The receiver handles that frame in compliance with the state of the V 42 module Additionally it can change the state of the V 42 module If it is an information frame the user data will be passed to the terminal Rx_uart_data buffer The data can be decompressed in the V42bis decoder if the V 42bis protocol was negotiated with the remote modem The transmitter takes data from the terminal Tx_uart_data buffer encodes it with the use of V 42bis compression forms an I frame calculates the FCS and passes it to the Tx data buffer Depending on the state of the V 42 module the transmitter can also issue supervisor and unnumbered fr
186. he second byte of the frame goes into the next to last position and so on Before a byte is placed into the rx frame buffer some analysis of the received data is required Reading the data from the rx bufferis performed by discarding any 0 bits that directly follow five consecutive 1 bits If noise occurred on the line some bits bytes can change their value There is a probability that some false transparent bits can occur or some true transparent bits can be inverted to 1 in the bit stream As a result a frame has an incorrect length at the receiving modem after the transparent bits are discarded from the bit stream So on the receiving side the frame closing flag can be misaligned from a byte boundary In the same way seven consecutive 1 bits or greater may occur in the bit stream Such situations have to be eliminated and data already received should be ignored 17 bits have to be examined at once If there is a flag in the Isb or the flag is placed as shown in the diagram below and zx count1 current amount of last consecutive 1 bits is equal to five it is assumed that the frame closing flag has been received Bit number 0 contains a transparent bit not a data bit because the rx count variable is equal to five According to the specification the transmitter must insert a 0 bit after 5 consecutive 1 bits regardless of the following bit and the receiver must discard any 0 bits that fol
187. his double dibit detection the receiver may begin making 16 way decisions Following transmission of scrambled binary 1 s at 2400 bit s for 200 10ms the modem shall be ready to transmit data at 2400 bit s When 32 consecutive scrambled binary 1 s at 2400 bit s have been detected from the remote modem the modem shall be ready to receive data at 2400 bit s A retrain between two modems is shown in Figure 3 12 3 38 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump LAE i Detect 32 i consecutive For450ms Modem 1 Scrambled 1 s 3 at 2400 bi s Modem 2 Detect end of S1 Detect 32 consecutive Is Figure 3 12 V 22bis retrain sequence If a modem has transmitted a retrain signal and has not received unscrambled repetitive double dibit 00 and 11 at 1200 bit s immediately prior or during or within a time interval equal to the maximum expected two way propagation delay the modem shall return to the beginning of the retrain signal as defined above and repeat the procedure until unscrambled repetitive double dibit 00 and 11 is received from the remote modem A time interval of 1 2 seconds is recommended for the maximum expected two way propagation delay If the modem fails to synchronize on the received retrain sequence the modem sha
188. ic Architecture of the Standalone Version of the LDR Soft Modem 2 1 2 2 The Data EIow Teh SAAN isa soc ods esta cpt das ge esta etg derent M esos det eda 2 3 2 3 Global State Machine visi ieee eke AAs eee lade een 2 21 3 1 Timing diagram of the V 21 Handshake sequence see 3 2 3 2 Timing diagram of the V 23 Handshake sequence eene 3 12 3 3 Signal Constellation for V 22 TE 3 20 3 4 E TEE 3 22 3 5 Eeer 3 22 3 6 Handshake SC CUE CS Goes t otiosi etas modu E tI p a t eti e E 3 23 3 7 Handshake state diagram to e en ferte ase aee qa coa iiaa 3 30 3 8 V 22bis 16 point constellation dagram eese enne 3 34 3 9 RA orEurinbr d D 3 35 3 10 22b18 deseramb ler sop ere ae 3 35 3 11 Wo 2bis Handshake EE 3 36 3 12 Kee EE 3 39 3 13 Handshake State DiagraM ueteres tue ie t tarius stesgersdayshes Bu eet ale 3 47 3 14 FSK Tx Data e EE 3 52 3 15 PESE Transmitt r SRR CER na pee ricette dachte mul causes 3 53 3 16 BO KAR Data PUI nce Gat etait idu bm M EE 3 53 3 17 LSEK Demodulator SPEC LUMI tg dread e Ra data Re Bees nds Mee oe ae oes 3 54 3 18 Simplified demodulation spectrum of a binary FSK ognal sess 3 55 3 19 DPSK transmitter block diagram iiie tese te rne enne neta ste ers a eS Penes 3 65 3 20 DPSK modem receiver block diagram esee 3 66 3 21 Signal energies over a baud eie eee de siea iii et mesdaees 3 68 3 22 Clock Recovery block di3pram EE 3 69 3 23 Carrier Recovery
189. ical distance from the point used to make the decision and the line that intersects the points 0 0 and the optimum decision point The optimum decision points are the ideal points for a decision to be made the black points in Fig 3 1 6 3 7 2 If the local carrier does not match the remote carrier the actual received points are rotated from the ideal points by some angle Now draw a line through the two points the optimum or ideal point and the origin 0 0 The error E is the distance from this line to the point that is used to make the decision Therefore E shows how far out our new point the point which is used to make decision is from its ideal position the optimum point This error is then lowpass filtered by the loop filter first order IIR filter and is used to adjust the current value of the local carrier phase either delay or advance the phase of the local carrier So as a result the Clock Recovery block rotates the constellation diagram to match the one shown in Fig 3 1 6 3 7 2 The filter coefficients and thresholds change depending on the state of the receiver handshake mode or data mode The phase correction is made once per baud and is performed in the middle of the baud 3 1 6 3 DPSK modulator control structure typedef struct Tx control DPSK t uint32 f carrier uint32 f guard 3 70 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www fr
190. ilters The input signal is bandpass filtered for the following reasons Rejection of out of band noise including the rejection of the transmit signal spectrum Introduction of a 90 degree relative phase shift required for I and Q channel separation 3 66 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Fixed equalization for line distortion In the current implementation a 38 tap bandpass FIR filter is used 3 1 6 2 2 Automatic Gain Control AGC The incoming signal level may vary over a large range due to attenuations in the telephone line However for clock and carrier recovery modules the signal level must be independent of the attenuation introduced by the communications channel and remain constant Automatic Gain Control performs this task It adjusts the envelope of the I and Q channels so that they are of the same magnitude The algorithm of the AGC that is used in the current implementation is described below The AGC monitors the I channel of the receiver and calculates the gain correction factor The gain correction factor is calculated once every three baud by a two step process First the three maximum values of the signal each one corresponding to one baud 16 samples are monitored and added to each other The previous value of the average signal level is then added to this sum and divided
191. implementation is its computational simplicity An adaptive filter consists of two parts an FIR filter and an adaptation algorithm that adjusts the coefficients of the filter to improve its performance In the current implementation an LMS adaptation technique is used so the equalizer s coefficients are updated using the following equation Cy41 Cy A amp Vk Where C is the vector of equalizer coefficients on the Kk iteration A defines the convergence speed of the equalizer I I the difference between the optimal and the actual value of I or Q is the error signal on the k iteration V is the vector of demodulated I or Q values taken from the equalizer s buffer There are two separate filters one for the I channel and the other for the Q channel Therefore the coefficients of these filters are updated separately as well 3 1 7 2 7 Clock Recovery The purpose of Clock Recovery is to detect the middle of the baud The decision block makes decisions exactly in the middle of the baud The energy of the incoming signal at this point is maximal so the probability of a mistake ocurring during the decision process is minimal In the current implementation the early late method of Clock Recovery is used Fig 3 1 7 3 7 1 shows the energy values for each sample over the baud It can be seen in this Figure that if the energy sample E7 is in the middle of the baud it has the highest energy value and the rest of the sample
192. ing depending on a user selectable setting see Table 3 107 Table 3 107 shows the effect of the setting of the AT Vn command on the format of the result code All references to cr mean the character with the ordinal value specified in parameter S3 all references to If likewise mean the character with the ordinal value specified in parameter S4 Table 3 107 Effect of the AT V command on the Result code format AT VO AT V1 Result numeric code gt lt cr gt lt cr gt lt lf gt codes verbose code gt lt cr gt lt lf gt All numeric and verbose codes are defined in test response bh Returns None Code example include text_response h struct channel t channel print result code amp channel RESPONSE CODE CONNECT MOTOROLA Chapter 3 Module Descriptions 3 221 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules print text response Call s void print text response struct channel t channel char text Arguments Table 3 108 print text response arguments channel in Pointer to the Channel control data structure text in Text of the text response Description This function writes the Text response defined by text according to V 25ter into the Rx uart data buffer Information text responses consist of three parts a header text and a trailer The characters transmitted for the head
193. ion of Make off hook in ms It is initialized in 7x pulse init e break ms Duration of Break on hook in ms It is initialized in 7x pulse init e interval ms Time interval between digits in ms It is initialized in Tx pulse init e samples left Number of samples left to generate the pause between digits or the pause between Make and Break It is initialized in Ir pulse init to 0 e pulse left Number of pulses left to generate the current digit It is initialized in Tx pulse init to 0 next break It is equal to TRUE if the next action is Break and to FALSE otherwise It is initialized in Tx pulse init to TRUE MOTOROLA Chapter 3 Module Descriptions 3 217 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Tx pulse init Call s void Tx pulse init struct channel t channel struct Tx pulse control t Tx pulse control Arguments Table 3 103 Tx pulse init arguments channel in Pointer to the Channel control data structure Tx pulse control in Pointer to the Pulse dialer control data structure Description This function initialises the Tx pulse control Pulse dialer control data structure It also initializes the fields of the Channel control data structure pointed to by channel that are responsible for the Tx Data Pump data pump ptr baud rate number samples data pump call func state After calling thi
194. iptions e at command buf Local circular buffer that the AT Parser writes all AT Commandis into after processing the received AT command string After processing the received AT commands the AT Parser writes competent commands from the at command buf buffer into the Tx control command buffer for the AT Handler to process e at buf ptr Pointer to the at command buf buffer e at command string Array into which the AT Parser stores all characters received following AT characters 3 232 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions dial digits Array into which the AT Parser stores dial number characters e digits number Number of characters in the dal digits array e dial This variable contains 1 if the 5 sign has occurred in the command string It is required for executing of the commands following the sign in the next call of the Command Parser only e backspace counter Counter to the at commands string array e sample counter Sample counter This is used for calculating the time in two cases receiving the second character of the Enter symbol Enter contains 2 characters CR and LF see at parser h defined values or receiving the escape sequence see LDR Soft Modem User Manual for escape sequence description pl
195. is function will execute if possible the function Tx control data pump call func associated with the current Tx Data Pump The rx data pump function contains logic to check the condition of Tx control sample head and Tx control sample tailto determine if the number of samples specified by Tx control number samples can be placed into the Tx sample buffer yet If the distance between the two pointers is equal to or less than the value Tx contro1 number samples it calls the Tx control data pump call func This function is called in the state_machine Returns e TX OK The Tx control data pump call func Was called TX SAMPLE BUF FULL The Tx control data pump call func was not called because Tx sample is already full TX STATE COMPLETED The current state of Tx Data Pump is complete this means that Tx control process count is equal to 0 Code example struct channel t channel if Tx data pump amp channel TX STATE COMPLETED 2 48 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Rx data pump Call s enum Rx result t RX OK RX SAMPLE BUF NOT FILED RX STATE COMPLETED enum Rx result t Rx data pump struct channel t channel Arguments Table 2 24 Rx data pump arguments channel in Pointer to the Channel control data structure De
196. is function is called from state machine Returns None Code example struct channel t channel struct Rx V22bis DH handshake t Rx V22 DH hshake Rx V22bis handshake init channel amp Rx V22bis DH hshake TRUE FALSE 3 46 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V22bis handshake routine Call s void Rx V22bis handshake routine struct channel t channel Arguments Table 3 28 Rx V22bis handshake routine arguments channel in Pointer to the channel control data structure Description This is the RX V 22bis Handshake Data Handler routine This function reads data symbols from the Rx data buffer It controls the handshake process The inner state diagram for this routine during handshake is shown in Fig 3 1 4 14 If handshake is completed successfully Rx control data handler state is set to RX DH STATE COMPLETED else to KX DH STATE FAILED This function is called by the Rx data handler function via the channel Rx control ptr data handler call func Figure 3 13 Handshake State Diagram Returns None Code example struct channel t channel Rx V22bis handshake routine channel MOTOROLA Chapter 3 Module Descriptions 3 47 For More Information On This Product Go to www freescale com Freescale Semicondu
197. is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode V23 available Boolean variable V23 available is TRUE if the Soft Modem is in Calling Mode or if the Soft Modem is in Answering Mode and the Remote Modem supports V 23 Modulation protocol It is initialised in Rx V8 DH init to TRUE if MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module the Soft Modem is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode e V22 V22bis available Boolean variable V22 V22bis available is TRUE if the Soft Modem is in Calling Mode or if the Soft Modem is in Answering Mode and the Remote Modem supports V 22 or V 22bis Modulation protocols It is initialised in Rx V8 DH init to TRUE if the Soft Modem is in Calling Mode and to FALSE if the Soft Modem is in Answering Mode MOTOROLA Chapter 3 Module Descriptions 3 159 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module Rx V8 DH init Call s void Rx V8 DH init struct channel t channel struct Rx V8 DH t rx s bool calling Arguments Table 3 67 Rx V8 DH init arguments channel in Pointer to the Channel control data structure IX S in Pointer to the Rx V8 Data Handler data structure calling in Boolean variable Contains TRUE i
198. is operation in a software modem both V 42 and V 42bis must be compiled using the V42BIS definition directive In this case the V 42 error correction module uses V 42bis compression is an integral part This V 42bis implementation provides buffered byte oriented compression and decompression services so it does not have to interface with the DTE buffers and can also be used as a standalone compressor on any platform or used along with different v 42 implementations MOTOROLA Chapter 3 Module Descriptions 3 129 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Overview The following declaration in the v42bis h file defines default negotiation values suggested by the CCITT Recommendation V 42bis Appendix II 1 define V42BIS MAX STRING 32 Maximum dictionary string length define V42BIS CODEWORD BITS 11 Maximum bits per codeword These values can be redefined with alternative values according to the CCITT Recommendation V 42bis The maximum bits per codeword can be up to the value of 2 because the implementation uses a 16 bit data type to represent the dictionary codewords Because the nodes in the dictionary are organized as a TRIE structure Trie is a kind of digital search tree Fredkin1960 introduced the trie terminology which is abbreviated from Retrieval the system provides fast dictionary look up for a matched string and the current character and ef
199. is used to produce non zero information field data inside the encoder See Figure 3 38 Ix uart data Data SOC Handler l Fra me Fnc anailatian Frame Storage Tx data Figure 3 38 Compression flow To receive data with V 42bis decompression enabled the V 42 receiver under normal conditions invokes V 42bis to decode data from the remote modem The special buffer decode buffer is used to communicate between the V 42 receiver and V 42bis decoder The size of the decode buffer is estimated to fit the maximum possible compression ratio for the maximum information field length of the I Frame Thus every processed frame becomes fully decompressed All data from the decode buffer is then directly transferred into the DTE The data that can not be transferred into the DTE immediately because of flow control remains in the decode buffer and the will be transferred next time when I Frame decapsulation restarts See Fig 3 3 3 2 MOTOROLA Chapter 3 Module Descriptions 3 131 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Overview Data Handler Rx uart data Decode Buffer Figure 3 39 Decompression flow This logic is enabled in the V 42 module when the V42BIS define statement is compiled If compression in one direction is disabled the V 42 module uses its own DTE data delivery scheme to from the DCE All the data structures of
200. ised At 1 K nodes this transmission code is increased to 11 bits and so on This is achieved by constantly clearing old dictionary nodes and recycling them according to a least recently used scheme The next 256 nodes are then pre loaded with an ASCII character code A starting node is thus provided for each of the 256 ASCII characters i e a root for 256 separate trees Since the dictionary entries are shifted up by the three control codes each ASCII code is stored in the address ASCII 3 The actual string learning dictionary starts at address 259 and usually goes to 2K nodes During the encoding process a tree dictionary is grown from the input file data Each string of input characters in effect climbs the tree nodes to find matching strings already stored in the dictionary The string matching process comes to an end when a codeword cannot be found in the dictionary The codeword then identifies the longest matching string in the dictionary as learned during previous transmissions This string is transmitted as the output codeword This codeword together with the last unmatched character is stored in the next empty dictionary entry to add a new branch to the tree dictionary The unmatched character is used as the first character of the next data string continuing the string matching and transmission process With few exceptions each transmission creates a new node in both the encoder and decoder dictionary The decoder uses the in
201. it corresponds to a O degree phase change Therefore the total phase transmitted is the same or the same constellation point However a phase change is required for correct clock recovery otherwise the energy of the samples remains constant To avoid this the scrambler is introduced to minimize the probability that such ill conditioned dibits occur In other words it makes the data stream look like a random stream of ones and zeros regardless of the data being transmitted This is required for the clock recovery module Considering d nT is the input to the scrambler the output d nT is given by d nT d nT XOR d n 14 T XOR d n 17 T Where T is the data period The signal flowchart of the modem scrambler is shown in Figure 3 4 MOTOROLA Chapter 3 Module Descriptions 3 21 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Figure 3 4 V 22 scrambler 3 1 3 2 Descrambler The descrambler is intended to recover the originally transmitted dibit The output of the descrambler is described by d nT d nT XOR d n 14 T XOR d n 17 T Where T is the data period The signal flowchart of the modem descrambler is shown in Figure 3 5 d nT Figure 3 5 V 22 descrambler 3 1 3 3 Handshake The handshake sequence for achieving synchronization between calling and answering modems is shown in Figure 3 6 3 22 MCF5407 LDR Soft Modem Software Develop
202. its 3 127 v42bis Decode 3 136 v42bis Encode 3 135 v42bis Flush 3 137 v42bis Init 3 134 v8 get bits 3 164 v8 put bits 3 157 For More Information On This Product Go to www freescale com MOTOROLA
203. itter circular data buffer operation The Tx control t structure is defined in modem h S E E KR RR RRR KR RK KKK kk kk kc kckck ck ck ck k ck kckckckckckckckckckckckckckckck A k k k k k k k k k k k k ck ck ck k ck ck ck RK Transmitter control Structure Eck ckckckckckckck ck ckck ck ck ck ck ck ck A A k kk kckckckckck ck KKK struct Tx control t enum Tx_state_t state intl6 sample ptr int16 sample head int16 sample tail intl6 sample end uint32 sample length uint8 data ptr uint8 data head uint8 data tail uint8 data end MOTOROLA Chapter 2 General Architecture 2 7 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel uin uin uin uin uin uin uin uin uin uin uin voi cal uin uin uin uin uin voi cal enu uin voi cal cal i t32 data length t8 uart data ptr t8 uart data head t8 uart data tail t8 uart data end t32 uart data length t32 command ptr t32 command head t32 command tail t32 command end t32 command length d data pump ptr l func t data pump call func t32 number samples t8 n bits t8 n bits mask t32 baud rate t32 process count d data handler ptr l func t data handler call func m Tx DH state t data handler state t32 number n bits d command parser ptr l func t command parser call func l func t command handler call func Th
204. k This adaptively maintains the output signal at a constant level that is necessary for proper operation of the algorithms of the modem receiver The algorithm of the AGC that is used in the current implementation is described below The AGC monitors the signal and calculates the gain correction factor The input signal is multiplied by this gain correction factor so that the signal maximum remains within a certain range The gain correction factor is calculated once every three bauds by a two step process First the three maximum values of the signal each one corresponding to one baud are monitored and added to each other The previous value of the average signal level is then added to this sum and divided by four to obtain the new average signal level At the second step the gain correction factor is calculated The gain correction factor is the result of dividing the maximum allowed signal level by the average signal level Also the AGC block determines if a carrier is present in the received signal by comparing the average signal level with the noise threshold After AGC the signal goes to the actual FSK demodulator This type of FSK demodulator uses two types of filters one is centered at the Mark frequency and the other at the Space frequency The Input BPF is centered about a mean frequency Mark and Space BPFs are centered about the desired mark and space frequency A simplified spectrum for the demodulator is shown in Fig 3 1 5 2 3
205. k and space correspond to binary 1 and 0 respectively 3 1 5 1 FSK Transmitter The transmitter takes data from the Tx data buffer performs FSK modulation taking into account the bits for transmitting and puts the resultant samples into the Tx sample buffer see Figure 3 14 Tx data EE Tx sample Figure 3 14 FSK Tx Data Pump The FSK modulation is represented in the following manner S n A cos Ao n Q Where e S n Transmitted signal e A Amplitude of transmitted signal Carrier mean frequency e AQ Frequency deviation e n Number of a sample e Phase shift For V 21 e 0 1080 Hz channel No 1 1750 Hz channel No 2 e Ao 100Hz For V 23 e Om 1500 Hz channel 600 baud 1700 Hz channel 1200 baud 420 Hz channel 75 bauds 3 52 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump e Aw 200 Hz channel 600 baud 600 Hz channel 1200 baud 30 Hz channel 75 baud The higher characteristic frequency corresponds to the Space frequency binary 0 the second one corresponds to the Mark frequency binary 1 The structure of the FSK Transmitter modulator is shown in Figure 3 15 Encod Frequency uad Modulator S nTs A cos n D nT 01010 Sample Rate 9600 Ts 1 Sample Rate T 1 Baud rate Figure 3 15 FSK Transmi
206. k k k k k k ck ck ck k ck ck ck RK Channel Structure HR KK RRR RR RK kk kckckckck KKK struct channel t struct Tx control t Tx control ptr struct Rx control t Rx control ptr struct state machine t state machine ptr struct uart params t uart control 2 6 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel struct daa control t daa control bi The channel t structure parameter descriptions 2 4 1 Tx control ptr Pointer to the Transmitter control data structure see chapter 2 4 1 Transmitter Initialized in Tx channel ml Rx control ptr Pointer to the Receiver control data structure see chapter 2 4 2 Receiver Initialized in Rx channel init state machine ptr Pointer to the State Machine control data structure see chapter 2 5 Global State Machine Initialized in state machine init uart control Pointer to the UART module control data structure see chapter 3 6 1 UART module Initialized in mcf5407 wort init daa control Pointer to the DAA Interface control data structure see chapter 3 6 2 DAA Interface Initialized in daa init Transmitter The Transmitter control structure is a constituent part of the Channel It contains the parameters required for the Tx Data Handler the Tx Data Pump the Command Parser the Command Handler and the transm
207. l16 BPLL1 intl6 BPLL2 intl6 BCNT intl6 AGCPLL1 3 90 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Data Pump intl6 AGCPLL2 int32 cerror sig int32 clerror sig int32 clerror2 sig uint32 baud nrg4 uint32 baud nrg8 intl6 signal present intl6 clock corrected int32 agc lp intl6 phase step int16 BINTG int16 AGC GC int16 BAUD TH int16 PHASE TH intl6 cl cnt bool adaptive equalizer enabled int32 filter adaptive ffe I coef ADAPTIVE FILTER FFE COEF NUMBER int16 filter adaptive ffe I buf ADAPTIVE FILTER FFE BUF SIZE int32 filter adaptive ffe Q coef ADAPTIVE FILTER FFE COEF NUMBER int16 filter adaptive ffe Q buf ADAPTIVE FILTER FFE BUF SIZE uint32 filter adaptive ffe buf ptr bool retrain enabled uint8 retrain current sl uint32 retrain sl counter f carrier Carrier frequency in Hz This field is initialized in function Rx V22bis init MOTOROLA Chapter 3 Module Descriptions 3 91 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 92 carrier phase Current phase of the carrier frequency generator in Q15 format This field is initialized in function QAM demodulator init to 0 carrier_phase_incr Carrier frequency phase increment per sample in Q15 format This field is initialized in functi
208. last received bit Reading from this 32 bit buffer is performed from the Isb in order to follow the original data order When data is read the contents of the buffer can be stored easily in a register right shifted by the number of read bytes and then stored back into a buffer In the receiver two input functions are implemented v42 getbits and v42 viewbits to access the 32 bit buffer At the beginning of the v42 rx data function this 32 bit buffer is filled In the body of this function the 32 bit buffer is read via the v42 getbits and v42 viewbits functions It is important to understand that the number of bits to read 3 104 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction n parameter of these functions cannot be greater than the size of the buffer in this case 32 bits minus the value of nbits If the v42 getbits function is called with a transparent parameter set to TRUE discarding the transparent bits also needs to be taken into account So the value passed to n parameter must be even less than 32 minus nbits The transmitter works in the same way At the beginning of transmission nbit fixed blocks of data are read from the 32 bit buffer this data is then stored in the Tx data buffer The v42 putbits function is called in the body of the transmitter to place data into the 32
209. le 3 18 Rx V22 handshake init arguments channel in Pointer to the channel control data structure Rx V22 handshak in Pointer to the RX handshake data handler structure e calling in Indicates either modem in call or answer mode Description This function initializes the receiver V 22 handshake data handler control structure It fills the appropriate fields of Rx control t structure pointed to by channel Kr control ptr fields data handler call func data handler state number n bits and the Rx V22 handshake structure fields state det scr ones ms det unscr ones ms wait send ms wait carrier ms current counter global counter It sets up the data handler for the receiver to perform the Rx V22 handshake routine This function is called from state_machine Returns None Code example struct channel t channel struct Rx V22 DH handshake t Rx V22 DH handshake Rx V22 handshake init channel amp Rx V22 DH handshake TRUE MOTOROLA Chapter 3 Module Descriptions 3 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Hx V22 handshake routine Call s void Rx V22 handshake routine struct channel t channel Arguments Table 3 19 Rx V22 handshake routine arguments channel in Pointer to the channel control data structure Description This is the RX V 22 Handshake Data Handler routine This function reads data symbols from the Rx data
210. le Rate D nT 01010 T 1 Baud rate Figure 3 19 DPSK transmitter block diagram 3 1 6 1 1 Scrambler The purpose of the scrambler is to randomize the input binary data sequence which means that it converts this sequence in a pseudo random binary sequence with some defined period This is required for the clock recovery module For more detailed information about the scrambler refer to section 3 1 3 2 3 1 6 1 2 Encoder The encoder implements encoding of the incoming sequence d n into the appropriate phase changes i e its function is to map every two incoming bits of the incoming sequence d n to a total phase The total phase is then transmitted The mapping rule can be seen in section 3 1 3 1 In the current implementation of the encoder it changes the carrier phase according to the incoming dibit and is executed once per baud i e with sample rate 9600 the phase changes once per 16 samples 3 1 6 1 3 Modulator The modulator modulates the cosine wave which contains the phase change The modulating frequency for V 22 is 1200 Hz for a calling modem and 2400 Hz for an answering modem 3 1 6 1 4 Bandpass filter After modulation the signal cannot be directly transmitted through the telephone line The reason is that the instantaneous changes of I nTy and Q nTy generate higher order harmonics Some of these harmonics fall into the frequency region reserved for the receiver MOTOROLA Chapter 3 Module Descri
211. led information about these blocks refer to Section 3 1 6 2 This function is called by the 7x data pump function of the modem c module via the channel Tv control ptr data pump call func Returns None Code example struct channel t channel DPSK modulator channel MOTOROLA Chapter 3 Module Descriptions 3 77 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump DPSK demodulator init Call s void DPSK demodulator init struct channel t channel Arguments Table 3 39 DPSK demodulator init arguments channel in Pointer to the channel control data structure Description Initialization of the DPSK receiver control structure Rx control DPSK 1 The pointer to this structure is contained in channel Rx control ptr 2data pump ptr Fills up the appropriate fields of this structure with default values carrier phase carrier phase incr total phase baud frac descrambler register filter buf and so on refer to Section 3 1 6 5 for more details This function is called by the Rx V22 init functions of the v22 c module Returns None Code example struct channel t channel DPSK demodulator init channel 3 78 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump DPSK demodulator Call s
212. ll transmit another retrain signal 3 1 4 5 Implementation The requirements of V 22bis are implemented in the v22bis c file This module is responsible for the initialization of the V 22bis handshake control structures Rx Tx V22bis DH handshake t the initialization of the QAM control structures Rx Tx control QAM t for details about these structures refer to Sections 3 1 7 4 3 1 7 5 scrambling descrambling and controlling the handshake process Rx V22bis handshake routine The description of the main functions and control structures of v22bis c are given below 3 1 4 6 RX V 22bis handshake data handler structure struct Rx V22bis DH handshake t MOTOROLA Chapter 3 Module Descriptions 3 39 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump enum Rx V22bis hadshake state t state bool retrain uint32 det unscr ones ms uint32 det scr ones 1200 ms uint32 wait send ms uint32 wait data 1200 ms uint32 send sl ms uint32 det sl ms uint8 current sl uint32 ones counter uint32 wait adaptive equalizer ms uint32 wait 16 way decision ms uint32 wait scr ones 2400 ms uint32 send scr ones 2400 ms uint8 det scr ones 2400 bits uint32 current counter uint32 global counter 3 40 state Current state of the RX V22bis Handshake Data Handler This field is initialized in function Rx V22bis handshake init retr
213. lock diagram of the clock recovery algorithm is shown in Figure 3 28 E Error Decision signal Loop filter H Accumulator Baud clock generator Figure 3 28 QAM Clock Recovery block diagram 3 1 7 2 8 Carrier Recovery Carrier Recovery is used for adjusting the phase of the local carrier to match with the phase of the incoming carrier It is very important to generate a local carrier that has the same phase and frequency as the incoming carrier because it is used in the demodulator to demodulate the incoming signal and retrieve the baseband information For implementation of Carrier Recovery a phase locked loop is used see Figure 3 29 MOTOROLA Chapter 3 Module Descriptions 3 85 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump I Phase Carrier ncomin a detector Loop filter generator carrier error carrier generator Figure 3 29 QAM Carrier Recovery block diagram The phase detector generates an error that is used to synchronize the local carrier to the incoming carrier This error signal contains the information about the phase and frequency difference between the local and the incoming carriers The constellation points are shown in Figure 3 30 The output of the phase detector is of the form Q nTy P Tp I nTy Q nTj Q nTy Q nT I nT3 P nTy Where I nTy and Q nTy are the optimum decision points T nTy
214. low 5 consecutive 1 bits So before the previous reading the 32 bit buffer could contain the xxxxxxxx011111100111110yy value During the previous reading the value 111110yy was taken from the buffer the rx_count1 variable became equal to five and the buffer was right shifted by 8 bits The transparent bit remained in the buffer It will be discarded when the next byte is taken from the 32 bit buffer or when the closing flag occurs 16 15 14 13 12 t1 10 9 8 7 6 5 4 3 2 1 0 x x x x X X X X 0 1 1 1 1 1 1 0 0 So receiving of this frame is now complete and the frame check sequence already calculated can be examined When a frame has been processed the receiver returns to the V42 GETTING FLAG State MOTOROLA Chapter 3 Module Descriptions 3 109 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction Three different situations can abort the reception of data The first situation occurs when one part of the flag lies in the right most byte and another in the next to right most byte 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 X X X X X 0 1 1 1 1 1 1 0 X X X X The second situation takes place when getting a byte from the rx buffer discarding transparent bits causes damage to the flag and as a result the frame closing flag will not be recognized A
215. ly between two DCEs Data is sent in frames Each frame has a Frame Check Sequence FCS field This field is used to determine whether a frame was damaged during transmission or not If a frame was damaged it will be automatically resent by the remote modem Additionally this protocol implements flow control between two DCEs The relationship of the V 42 module with the other modules is shown in Fig 3 2 1 The receiver takes data from the Rx data buffer processes it according to the V 42 V 14 protocol and puts useful data into the Rx uart data buffer from this buffer data goes to the terminal The transmitter takes data from the Tx uart data buffer data from the terminal comes to this buffer wraps it according to the V 42 V 14 protocol and puts the result data into the Tx data buffer If the V 42bis module is enabled and used it performs data compression in the transmitter and data decompression in the receiver Modem State Machine Channel Rx uart data Tx uart data V 42 Module V 42bis Module Figure 3 31 External relationships of the V 42 module The V 42 module consists of three main functions v42 init v42 rx data and v42 tx data The modem state machine calls the v42 init function when physical handshaking is completed It initializes the data structure and obtains the required parameters Each channel needs to have its own data structure in order to ha
216. m Freescale Semiconductor Inc Support Modules The last stage consists of the decision whether a tone has been detected or not If one of the tones is detected or is not detected during the maximum time of the detection process the channel Rx control ptr process count becomes equal to 0 If the actual tone is detected or not is detected is defined by tone ail detected in the structure of Rx tone t type This function is called by the Rx data pump function via channel Rx control ptr data pump call func Returns None Code example struct channel t channel Rx tone amp channel 3 7 4 Ring Detector The Ring detector module uses the serial communication interface of the DAA to receive ring data When a ring is detected the samples in the Rx sample buffer become equal to 32767 while the ring signal is positive then go back to 32768 when the ring is near zero and negative Thus a near square wave is presented in Rx sample that swings from 32768 to 32767 in cadence with the ring signal The Ring detector module routines can be found in the ong det c file The Ring detector control data structure Rx ring det tis defined in ong det h FCRC RR RR ke e e e e e ke ke ke o e ee e oe ke ok ek ke e e e e e e e e e e e e oe e o e e e e e e e e e e e e e e ee e Ring detector control data structure oko ke e e e e o ke oe e ok ke e e e o o ok ke o ke e ee ce oe e e e ee e e e ke ko e ee ke ke e o e
217. mission the Soft Modem initiates transmission of the CM message using the Tx V8 DH routine function and conditions its receiver to detect the JM message using the Rx V8 DH routine function After a minimum of 2 identical JM sequences have been received the Soft Modem transmits the CJ message using the Tx V8 DH routine function Following CJ the Soft Modem transmits no signal for a period of 75 ms then proceeds in accordance with the selected V series modulation mode 3 6 4 The V 8 start up procedure in answering mode For a period of at least 0 2 s after connection to the line the Soft Modem transmits no signal If the V 8 software module is enabled the Soft Modem transmits ANSam and detects CM messages using the Rx V8 DH routine function Upon receiving a minimum of 2 identical CM sequences the Soft Modem transmits the JM messages JM transmission continues until three CJ messages have been received using the Rx V8 DH routine function Upon receiving three CJ messages the Soft Modem will proceed with the physical handshake according to the selected V series modulation mode 3 164 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Call DCE Answer ANSam JM JM JM SigA DCE 75 ms 3 7 Support Modules 3 7 4 UART module The UART is the traditional physical interfac
218. mitted shall be divided into groups of 2 consecutive bits dibits Each dibit shall be encoded as a phase change relative to the phase 3 20 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump of the preceding signal element see table 3 1 3 1 At the receiver the dibits shall be decoded and the bits reassembled in the correct order The left hand digit of the dibit is the one occurring first in the data stream as it enters the modulator portion of the modem after the scrambler Table 3 13 Bits encoding in V 22 modem Dibit values Bit values Phase change 1200 bit s 600 bit s 00 0 90 01 0 11 1 270 10 180 The phase change is the actual on line phase shift in the transition region from the center of one signaling element to the center of the following signaling element For 600 bits s each bit shall be encoded as a phase change relative to the phase of the preceding signal element 3 1 3 4 Scrambler A self synchronizing scrambler which has the generating polynomial 1 x 14 x 17 is included in the modem transmitter The purpose of the scrambler is to randomize the input binary data sequence which means that it converts this sequence into a pseudo random binary sequence For example if the DTE sends a series of 01 dibits from table 3 1 3 1 it can be seen that each dib
219. more than Ox 1F It supports UARTI only and is used in both UART and modem modes Initialized in mcf5407 uart init MOTOROLA Chapter 3 Module Descriptions 3 167 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules e tx fifo threshold Tx FIFO threshold This threshold is the value at which the Tx FIFO is considered to be empty for the purpose of alerting the CPU that the Tx FIFO requires more data samples The value should be no more than Ox1F It supports UART only and is used in both UART and modem modes Initialized in mcf5407 uart init e mode UARTI mode It can be equal to uart mode UART mode codec 8 8 bit CODEC interface mode codec 16 2 16 bit CODEC interface mode This supports UARTI only Initialized in mcf5407 uart init shift direction Shift direction It can be equal to msb first Samples time slots are transferred msb first sb first Samples time slots are transferred lsb first This supports UARTI only Initialized in mcf5407_uart_init 3 168 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules mcf5407 uart init Call s void mcf5407 uart init struct channel t channel struct uart params t uart control Arguments Table 3 70 mcf5407 uart init arguments channel in Pointe
220. mple struct daa control t daa control daa tx level set amp daa control MOTOROLA Chapter 3 Module Descriptions 3 187 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules daa aout level set Call s void daa aout level set struct daa control t daa control Arguments Table 3 83 daa aout level set arguments daa control in Pointer to the DAA Interface control structure Description This function sets the DAA Transmit amp Receive Attenuation level for the call progress AOUT pin Register 6 ATM 1 0 ARM 1 0 according to the current setting in the H 1 register Returns None Code example struct daa control t daa control daa aout level set amp daa control 3 188 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc daa aout mute Call s void daa aout mute struct daa control t daa control Arguments Table 3 84 daa aout mute arguments daa control in Pointer to the DAA Interface control structure Description This function mutes the receive and transmit path for the call progress AOUT pin Register 6 ATM 1 0 ARM 1 0 Returns None Code example struct daa control t daa control daa aout mute amp daa control MOTOROLA Chapter 3 Module Description
221. mples that can be sent over a phone line and vice versa Possible Data Pump arrangements can be 1 Data Pump according to the ITU T V 21 V 22 V 22bis or V 23 recommendations 2 Data Pump that implements a DTMF generator 3 Data Pump that implements a Tone Generator and Detector 4 Data Pump that implements Ring detection Command Parser is a top level entity that is invoked by the scheduler to implement AT command syntax handling This writes all sequences of valid system commands to the command circular buffer Command Handler is a top level entity that is invoked by the scheduler to interpret AT commands and execute them It reads formatted commands from the command circular buffer that are written into it by the Command Parser in response to valid AT commands MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Sampling Frequency Text Response is a set of functions that perform informative messaging to the DTE according to V 25ter e DTE Interface is a set of functions that perform communication between the DCE and the DTE It uses the UARTO module DAA Interface is a set of functions that implement control and interaction with the Modem Daughter card based on an integrated direct access arrangement DAA 13044 It uses the UART1 module in modem mode USART 2 2 Sampling Frequency The sampling frequen
222. ms of binary 1 s have been detected the modem shall remain silent for a further 456 10 ms then it shall transmit binary 1 s 755 10 ms defined by 155ms S 9 100 ms later the modem shall be ready to transmit and receive data Answering modem On connection to the line the answering modem shall be conditioned to transmit signals in the high channel and receive signals in the low channel Following transmission of the answer sequence the modem shall transmit binary 1 s MOTOROLA Chapter 3 Module Descriptions 3 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump After 155 10 ms of binary 1 s have been detected the modem shall be ready to transmit and receive data after waiting a further 600 10 ms defined by S 9 100 ms Detect Ones for 155ms Silence Connect to line amp dial Connect to line after ring validation EE amp M eee POPENXDHS 0 fori55ms z for 00ms Figure 3 2 Timing diagram of the V 23 Handshake sequence The V 23 Handshake routines can be found in the v23 c file The Rx V 23 Handshake control data structure Rx V23 DH handshake t 1s defined in the v23 h file CC ke ke e ke ke ke ke kk oko ooo kk kk kk ok ok oe oe e oe oe ob ob ob ee ob o o oo e o o o e e e e e e e e e e e States of Rx V21 Handshake Data Handler RRR RRR kk kk ok ok e oe oe ee oe o
223. n This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Tx V22 init Call s void Tx V22 init struct channel t channel struct Tx control DPSK t Tx control DPSK bool calling enum v22 mode t mode Arguments Table 3 16 Tx V22 init arguments channel in Pointer to the channel control data structure Tx control DPSK in Pointer to the DPSK transmitter control data structure calling in Indicates either modem in call or answer mode mode in Specifies 600 bit s V22_MODE_600 or 1200 bit s V22_MODE_1200 mode Description This function initializes the Transmitter control Structures pointed to by Tx_control_DPSK and channel according to V 22 and calls DPSK modulator init It fills the appropriate fields of the Tx control t structure pointed to by channel Tx control ptr fields n bits n bits mask baud rate number samples data pump call func state process count and the Tx control DPSK structure fields f carrier f guard amplitude carrier amplitude guard omega ptr scrambler This function is called from state machine Returns None Code example struct channel t channel struct Tx control DPSK t Tx control DPSK Tx V22 init channel Tx control DPSK TRUE V22 MODE 1200 MOTOROLA Chapter 3 Module Descriptions 3 27 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V22 ini
224. n hook and sends the NO CARRIER response to the DTE 1 SM RETRAIN STATE e By default 2 The state equals to the value of the return sm state variable e When the Rx Data Handler Handshaker current state is complete 3 SM INIT RETRAIN STATE e On the Retrain sequence detection 4 SM RESET COMMAND STATE e On the reception of any character from the DTE and when the return sm state variable is not equal to SM ON LINE STATE e On the Break of the line 4 SM INIT ON LINE COMMAND STAT E e On Escape sequence is detected Go to On line command mode on escape code is set in the S18 register and the return sm state variable is equal to SM ON LINE STAT SM INIT PRE ANSWERTONE PAUSE STA TE It initializes the Tone Generator as the Silence tone generator And it goes off hook SM PRE ANSWERTONE PAUSE STAT E SM PHE ANSWERTONE PAUSE STATE Calls the Rx Data Pump Idle mode and the Tx Data Pump Silence Generator On the receipt of any character from the DTE it goes on hook and sends the NO CARRIER response to the DTE 1 9M PRE ANSWERTONE PAUSE ST ATE e By default 2 SM_INIT_ANSWERTONE_GEN_STAT E e f Silence Generation is completed 3 SM RESET COMMAND STATE e On the reception of any character from the DTE SM INIT AFTER ANSWERTONE PAUSE S TATE It initializes the Tone Generator as the Silence tone generator SM AFTER ANSWERTONE PAUSE S TATE MOTOROLA Chapter 2
225. n the S18 register SM INIT PRE DIAL STATE If AT X2 or X4 is set it initialises the Tone Detector as the Dial tone detector otherwise No Dial tone detection or Blind Dialing it initialises the Tone Generator as the Silence tone generator And it goes off hook 1 SM PRE DIAL PAUSE STATE e f AT XO was set before e f AT X1 was set before e f AT X3 was set before 2 SM DIALTONE DET STATE e f AT X2 was set before e f AT X4 was set before SM PHRE DIAL PAUSE STATE Calls the Rx Data Pump Idle mode and the Tx Data Pump Silence Generator On receipt of any character from the DTE it goes on hook and sends the NO CARRIER response to the DTE 1 9M PRE DIAL PAUSE STATE e By default 2 SM INIT DIALING STATE e On the completion of the Silence Generation 3 5M RESET COMMAND STATE e On the reception of any character from the DTE SM DIALTONE DET STATE Calls the Tx Data Pump Silence generator and the Rx Data Pump Dial Tone Detector On the receipt of any character from the DTE it goes on hook and sends the NO CARRIER response to the DTE If the Dial Tone was not detected during a fixed period of time it goes on hook and sends the NO DIAL TONE response to the DTE 1 SM DIALTONE DET STATE e By default 2 SM INIT DIALING STATE e If the Dial Tone is detected during a fixed time 3 SM RESET COMMAND STATE e On the reception of any character from the DTE
226. nal level with the threshold 3 1 7 2 3 Demodulator With Ip nT and Q T as inputs to the demodulator the outputs I nT and Q nT are given by rT Ip nT cos o nT Q nT sin nT QT I nT sin O nT Q nT cos t Where 6 is the local carrier phase 3 1 7 2 4 Decision block and Decoder The decision block identifies the current quadrant from the values of the baseband I and Q and compares it with the previous quadrant to obtain the phase change Using this phase change the decoder retrieves the first two bits of the original quadbit or whole dibit according to Table 3 1 4 1 The last two bits of quadbit are then retrieved using the constellation diagram see Fig 3 1 4 1 MOTOROLA Chapter 3 Module Descriptions 3 83 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 7 2 5 Descrambler The descrambler is intended to recover the originally transmitted dibit For more detailed information about the descrambler refer to Section 3 1 4 3 3 1 7 2 6 Adaptive Equalizer The Adaptive Equalizer is an adaptive filter that compensates for intersymbol interference ISI and telephone line distortion Adaptive equalizers are based on either a statistical approach such as the least mean square LMS or a deterministic approach such as the recursive least squares RLS algorithm The major advantage of the LMS algorithm that is used in the current
227. nd Tx Data Handlers Initialises the V 21 Rx Data Pump If the Channel is in calling mode S 13 register it initializes the V 21 Tx Data Pump 1 SM V8 HANDSHAKING STATE e f the Channel is in calling mode 2 SM ANSWERTONE GEN STATE e f the Channel is in answering mode 2 20 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Global State Machine Freescale Semiconductor Inc Table 2 1 The Global State Machine States continued Name of the State Activities Exit States SM V8 HANDSHAKING STATE Calls the Tx amp Rx Data Handlers V 8 Handshaker and the Tx amp Rx Data Pumps On the receipt of any character from the DTE and on the break of the line event it goes on hook and sends the NO CARRIER response to the DTE 1 SM V8 HANDSHAKING STATE e By default 2 SM INIT AFTER ANSWERTONE PA USE STATE e When the Rx Data Handler Handshaker current state is complete 3 SM RESET COMMAND STATE e On the reception of any character from the DTE e On the Break of the line SM INIT LOOPBACK STATE Sets UART1 to local loop back mode Initialises the Rx amp Tx Data Pumps and the Rx amp Tx Data Handlers Handshaker according to the chosen protocol and speed V 21 V 23 V 22 V 22bis SM PHISICAL HANDSHAKING STATE BEGIN SMAINITIALIZATIONCSTATE MOTOROLA
228. ndle incoming and outgoing data independently of the other channels The v42 init function assigns the V 42 data structure to the Rx and Tx data control structures 3 100 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction void v42 init struct channel t channel V42 DATA STRUCT data ptr channel Rx control ptr data handler ptr data ptr channel Tx control ptr data handler ptr data ptr Since the V 42 receiver influences the V 42 transmitter all receiver transmitter and common shared fields are grouped into one data structure having type V42 DATA STRUCT and the same instance of that structure is assigned to both the receiver and the transmitter Additionally the data handler function has to be assigned to both the Rx and Tx data control structures void v42 init struct channel t channel channel Rx control ptr data handler call func v42 rx data channel Tx control ptr data handler call func v42 tx data Since incoming and outgoing data is handled in a different way by nature different data handlers are required for each direction of data transfer But for the same channel they will dial using the same V 42 data structure The v42 rx data function is called only if the amount of data in the Rx data buffer exceeds a preset threshold T
229. ne tone 3 208 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Hx tone Call s Freescale Semiconductor Inc void Rx tone struct channel t channel Arguments Table 3 97 Rx tone arguments channel in Pointer to the Channel control data structure Description This function detects tones according to the parameters that were initialized in Rx tone mt It can perform detection of three tones simultaneously The tone can consist of one or two frequencies and it can be continuous or cadence This function reads samples from Rx sample The number of samples is defined by the Rx control number samples Rx sample Figure 3 45 Tone detector The tone detection procedure is divided into different stages as shown in Fig 3 6 3 6 2 x n Decision Figure 3 46 Stages of the Tone Detection The first stage is bandpass filtering based on double biquad filter of the input signal This is followed by an energy estimation by means of exponential filters based on the filtered signal and the global signal The exponential filters are given by y out n DET ALPHA Iy n l 1 DET ALPHA x out n 1 x out n DET ALPHA Iy n l 1 DET ALPHA y out n 1 MOTOROLA Chapter 3 Module Descriptions 3 209 For More Information On This Product Go to www freescale co
230. ne t structure is defined in state machine h 2 14 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Global State Machine S EE K K K k k RR RRR RR RK KK KK kk kckckck ck ck ck ck ck ck ckckckckckckckckckckckckckckckckckck ck k k k k k k k k k k ck ck ck ck ck k ck ck KK States of the Global State Machine okckckckckckckck ck ck ck ck ck ck ck k k A A k kk kc kck kk k KKK enum sm state t SM INITIALIZATION STATE SM RESET COMMAND STATE SM COMMAND STATE SM INIT ON LINE COMMAND STATE SM ON LINE COMMAND STATE SM INIT ON LINE STATE SM ON LINE STATE SM INIT PRE DIAL STATE SM PRE DIAL PAUSE STATE SM DIALTONE DET STATE SM INIT DIALING STATE SM DIALING STATE SM PRE PHISICAL HANDSHAKING STATE SM PHISICAL HANDSHAKING STATE SM PROTOCOL HANDSHAKING STATE SM INIT RETRAIN STATE SM RETRAIN STATE SM INIT PRE ANSWERTONE PAUSE STATE SM PRE ANSWERTONE PAUSE STATE SM INIT AFTER ANSWERTONE PAUSE STATE SM AFTER ANSWERTONE PAUSE STATE SM INIT ANSWERTONE GEN STATE SM ANSWERTONE GEN STATE SM INIT ANSWERTONE DET STATE SM ANSWERTONE DET STATE SM INIT V8 HANDSHAKING STATE SM V8 HANDSHAKING STATE SM INIT LOOPBACK STATE MOTOROLA Chapter 2 General Architecture For More Information On This Product Go to www freescale com 2 15 Freescale Semiconductor
231. nel t channel struct Rx V23 DH handshake t Rx V23 handshake bool calling Arguments Table 3 11 Rx V23 handshake init arguments channel in Pointer to the Channel control data structure Rx V23 handshake in Pointer to the Rx V 23 Handshake control data structure calling in Contains TRUE if the receiver is in calling mode and FALSE if the receiver is in answering mode Description This function sets the fields of the Rx V 23 Handshake control data structure pointed to by Rx V23 handshake state det ones ms wait send ms wait carrier ms current counter global counter It also initializes the fields of the Channel control data structure pointed to by the channel that are responsible for the Rx Data Handler data handler ptr data handler call func data handler state number n bits After calling this function the Rx Data Handler is initialized to perform the Rx V 23 Handshake sequence This function is called in state machine Returns None Code example struct channel t channel struct Rx V23 DH handshake t Rx V23 handshake bool calling TRUE Rx V23 handshake init amp channel amp Rx V23 handshake calling 3 18 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V23 handshake routine Call s void Rx V23 handshake routine struct channel
232. nel there is a remote modem in answer mode This remote modem receives at 1200 Hz and transmits at 2400 Hz The Differential Phase Shift Keying DPSK modulation technique is used for each channel with synchronous line transmission at 600 baud implemented in the dpsk c file The V 22 with a 600 baud rate accomplishes the transmission of 1200 bps by encoding two incoming bits a dibit in a single baud or 600 bps by encoding one incoming bit in a single baud Since there are four possible values for every dibit 00 01 10 11 the constellation diagram for the V 22 contains four points Figure 3 1 3 1 shows the constellation diagram for the V 22 The four constellation points notated A B C and D lie on a circle Since there is no amplitude information transmitted the radius of this circle is normalized to unity A scrambler is included in the input to the transmitter and a descrambler at the output of the receiver A guard tone of 1800 20 Hz or 550 20 Hz may be used while transmitting only in the high channel transmitter of the answering modem The guard tone indicates to an automatic telephone system that the line is occupied by the modem Fixed compromise equalization filtering the input output signal with a fixed filter shall be incorporated in the modem Such equalization shall be equally shared between the transmitter and the receiver Figure 3 3 Signal Constellation for V 22 For 1200 bits per second the data stream to be trans
233. ng end tone ANSam It consists of a sine wave signal at 2100 15 Hz with phase reversals at an interval of 450 25ms amplitude modulated by a sine wave at 15 0 1 Hz The modulated envelope ranges in amplitude between 0 8 0 01 and 1 20 01 times its average amplitude GEN CALLING TONE Calling tone The tone transmitted from the calling end The calling tone consists of a series of interrupted 1300Hz 15 Hz signals ON for a duration of not less than 0 7s and OFF for a duration of not less than 1 5s not more than 2 0s GEN SILENCE TONE Silence The signal with a zero frequency The Tone Generator routines can be found in the tone gendet c file 3 198 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules The file KKK stru KK The MOT Tone Generator control structure Tx control tone tis defined in the tone gendet h ceo oe oce oe eoe eoe eoe eoe oe eoe eee eee eoe eoe eee oe eoe eee eoe eoe oe oe eoe eee eee eee e e eoe e e e v EE B n B SG x x Tone generator Strucrure KEE ct Tx control tone t uint32 tone length ms uint32 tone pause ms uint32 tone rev ms intl6 amplitude uint32 tone frequency uint32 omega uint32 phase uint32 tone samples left uint32 samples left uint32 tone samples rev left uint32 amplitude frequency intl6
234. nges the state of the transmitter to pecrsron_Box In this state the transmitter makes a decision on what data to MOTOROLA Chapier 3 Module Descriptions 3 107 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction send flag unnumbered frame supervisor frame or information Before sending the first protocol frame command XID it issues 16 flags If the modem is in answering mode the transmitter sends 1 until the receiver receives an ODP sequence When ODP is received the receiver changes the state of the transmitter and finally starts sending an ADP sequence When the remote modem gets the ADP sequence it starts sending the first protocol frame flags When a first flag is received the receiver moves the transmitter to a DECISION BOX State 3 2 5 V 42 Receiver The structure of the V 42 receiver is shown in Figure 3 35 The following subsections give detailed information about the implementation of each block Rx_data N I I I I I I I I I Rx_uart_data V 42bis decoder Get data from Frame sequential I handler frames Vg n ge u i l Process A a i ok as a a I l I I I I 1 I V 42 Control and State unit to Decision Box to TX I Frame storage Figure 3 35 Structure of the V 42 receiver 3 2 5 1 Bit level input The receiver works in two states
235. nit int filter bufI Cyclic buffer used by the interpolation filter algorithm for I channel This field is initialized in function QAM demodulator init to 0 int filter bufQ Cyclic buffer used by the interpolation filter algorithm for Q channel This field is initialized in function QAM demodulator init to 0 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump int filter buf ptr Pointer to the current element of the int filter bufI This field is initialized in function QAM demodulator init int filter number Specifies the number of active filterbanks of the interpolation filter This field is initialized in function QAM demodulator init to 32 retrain enabled Specifies if auto retrain is enabled or disabled This field is initialized in function Rx V22bis init retrain current S1 Contains one or zero Used for S1 detection This field is initialized in function Rx V22bis handshake init to Q retrain s1 counter Counter that is used in the S1 detection state during the retrain This field is initialized in function QAM demodulator init to 0 retrain noise Accumulator of signal error used for retrain initiation in Q14 format This field is initialized in function QAM demodulator init to 0 e retrain noise cnt Baud counter when retrain noise is greater than QAM RETR
236. nitialized in Rx channel init to the start of Rx sample e sample head The Rx sample circular buffer write pointer The Rx DAA Interface modifies this pointer when writing the samples into Rx sample It is initialized in Rx channel init to the start of Rx sample e sample tail The Rx sample circular buffer read pointer The Rx Data Pump modules modify this pointer when reading samples from Rx_sample It is initialized in Rx channel init to the start of Rx sample 2 12 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel e sample end Pointer to the end of the Rx sample circular buffer Users should not modify this pointer It is initialized in Rx channel init to the end of Rx sample e sample length Length of the Rx sample circular buffer Initialized in Rx channel init e data ptr Pointer to the Rx data circular buffer Users should not modify this pointer It is initialized in Rx channel init to the start of Rx data data head The Rx data circular buffer write pointer The Data Pump modules modify this pointer when writing symbols into Rx data It is initialized in Rx channel init to the start of Rx data data tail The Rx data circular buffer read pointer The Data Handler modules modify this pointer when reading symbols from Rx data for
237. nt8 temp current nbits current nbits struct channel t channel temp current nbits V22bis descramble_bit channel current nbits MOTOROLA Chapter 3 Module Descriptions 3 43 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Call s void Tx V22 init struct channel t channel struct Tx control QAM t Tx control QAM bool calling enum v22bis mode t mode Arguments Table 3 25 Tx V22bis init arguments channel in Pointer to the channel control data structure Tx control QAM in Pointer to the QAM transmitter control data structure calling in Indicates either modem in call or answer mode mode in Specifies 1200 bit s V22BIS MODE 1200 or 2400 bit s V22BIS MODE 2400 mode Description This function initializes the Transmitter control Structures pointed to by 7x control QAM and channel according to V 22bis and calls QAM modulator init It fills the appropriate fields of the Tx control t structure pointed to by channel Tx control ptr fields n bits n bits mask baud rate number samples data pump call func state process count and the Tx control QAM structure fields f carrier f guard amplitude carrier amplitude guard constellation phase quadrant phase quadrant change scrambler This function is called from state machine Returns None Code example struct channel t channel struct T
238. nt8 uart data Arguments Table 2 13 Tx uart data write arguments Tx control in Pointer to the Transmitter control data structure uart data in Character for writing to the Tx uart data circular buffer Description This function writes the uart data into the Tx_uart_data circular buffer into the position pointed to by Tx control uart data head then updates Tx control uart data headto the next position in the buffer Returns None Code example struct Tx control t Tx control uint8 character a Tx uart data write amp Tx control character MOTOROLA Chapter 2 General Architecture 2 33 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx uart data read Call s inline uint8 Tx uart data read struct Tx control t Tx control Arguments Table 2 14 Tx uart data read arguments Tx control in Pointer to the Transmitter control data structure Description This function reads the value of the current element in the Tx_uart_data circular buffer pointed to by Tx control uart data tail then updates Tx control uart data tail to the next position in the buffer Returns Value of the element pointed to by Tx control uart data tail Code example struct Tx control t Tx control uint8 character character Tx uart data read amp Tx control 2 34 MCF5407 LDR Soft Modem Software Developer s Reference Manual MO
239. ntrol in Pointer to the Transmitter control data structure Description This function reads the value of the current element in the command circular buffer pointed to by Tx control command tail thenupdates Tx control command tail tothe next position in the buffer Returns Value of the element pointed to by Tx control command tail Code example struct Tx control t Tx control uint32 command command command read amp Tx control 2 38 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface global structure init Call s void global structure init struct channel t channel Arguments Table 2 18 global structure init arguments channel in Pointer to the Channel control data structure Description This function initializes the S and H global data arrays registers to the default values and assigns the CURRENT CHANNEL global pointer pointer to the current Channel used by the Interrupt Service Routines to the input argument channel This function is called once in main Returns None Code example struct channel t channel global structure init amp channel MOTOROLA Chapter 2 General Architecture 2 39 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx channel init Call s
240. o send it sends a flag and changes its state to V42 FLAG SENDING This block can be divided logically into three sub blocks the first block makes a decision when the V 42 protocol is in the protocol establishment phase state lt V42 CONNECTED the second block makes a decision when the V 42 protocol is in connected state state V42 CONNECTED and a third block makes a decision when the V 42 disconnection procedure starts state V42 DISCONNECTING The decision box also determines whether a frame will be sent as a command or a reply and if the p f bit is set or cleared 3 116 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction If it is decided to send a frame the transmitter constructs it After this is done the transmitter changes its state to V42 DATA SENDING In this state the transmitter puts data which it has prepared in the previous state into the tx buffer Upon placing a byte of data into that buffer the transmitter updates the frame control sum with this value When all the data is sent address control and possibly information fields the transmitter places the calculated frame control sum into the tx_ frame buffer directly after the sent data and changes its state to V42_ FCS SENDING When the FCS field has been sent the transmitter sends a frame closing flag by changing its state to
241. o which the Rx Data Pump places received data symbols The Rx Data Handler reads demodulated or detected data symbols from this buffer Rx uart data is a circular buffer into which the Rx Data Handler puts the received data chars The Tx UART Interface reads data chars from this buffer and sends them to the DTE Also this buffer is used to write data by Text Response functions in order to send informative text messages to the DTE Command is a circular buffer from which the Command Handler gets the detected commands and their parameters The Command Parser writes detected sequences of user commands with parameters into this buffer State Machine is a top level entity that determines the behaviour of the Soft Modem which implements the role of the scheduler supervisor And it has the capability to change the parameters of any Soft Modem block Data Handler is a top level entity that is invoked by the scheduler to manage transmission of actual data Possible Data Handlers can be 1 Data handler according to the ITU T V 14 recommendation 2 Data handler according to the ITU T V 42 and V 42bis recommendation 3 Data handler that performs physical handshake for example according to V 22 or V 22bis 4 Data handler according to the ITU T V 8 recommendation The Data Handler performs the actual handling of bits of data Data Pump is a top level entity that is invoked by the scheduler to manage the conversion of digital data into signal sa
242. oduct Go to www freescale com Freescale Semiconductor Inc Data Pump channel the modem shall be ready to receive data at 2400 bit s Handshake sequence for answering modem 2400 bit s operation a b c d e On connection to the line the answering modem shall be conditioned to transmit sig nals in the high channel at 1200 bit s and receive signals in the low channel at 1200 bit s Following transmission of the answer sequence in accordance with Recom mendation V 25 the modem shall transmit unscrambled binary 1 at 1200 bit s If the modem detects scrambled binary 1 s in the low channel at 1200 bit s for 270 40ms the handshake shall continue according to the 1200 bit s Handshake se quence for an answering modem However if unscrambled repetitive double dibit 00 and 11 at 1200 bit s is detected in the low channel at the end of receipt of this signal the modem shall be detected and then transmit an unscrambled repetitive dou ble dibit pattern of 00 and 11 at 1200 bit s for 100 3ms Following these signals the modem shall transmit scrambled binary 1 s at 1200 bit s 600 10ms after the detection of the end of double dibit 00 and 11 at 1200 bit s the modem shall begin transmitting scrambled binary 1 s at 2400 bit s 450 10ms after detection the receiver may begin making 16 way decisions Following transmission of scrambled binary 1 s at 2400 bit s for 200 10ms the modem shall be ready to transmit data at
243. of the Tone Detector Rx control tone t structure parameter descriptions tone Array of Tone Detector parameter structure MOTOROLA Chapter 3 Module Descriptions 3 207 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Rx tone init Call s void Rx tone init struct channel t channel struct Rx control tone t Rx control tone enum det tone type t tone DET TONE NUMBER Arguments Table 3 96 Rx tone init arguments channel in Pointer to the Channel control data structure Rx control tone in Pointer to the Tone Detector control data structure tone in Array of tone types see table 3 6 3 4 Description This function initialises the Tone Detector control data structure according to the chosen types of the tones tone It also initializes the fields of the Channel control data structure pointed to by channel that are responsible for the Rx Data Pump data pump ptr baud rate number samples data pump call func state process count After calling this function the Rx Data Pump is initialized to operate according to V 23 This function is called in state_machine Returns None Code example struct channel t channel struct Rx control tone t Rx control tone enum det tone type t tone 3 tone 0 DET ANS END TONE tone 1 DET BUSY TONE tone 2 DET ANSAM TONE Rx tone init amp channel amp Rx control to
244. oint in a new quadrant For example when receiving the current baud the phase change is 90 degrees from the previous baud i e the current point I Q is in the first quadrant and the previous one was in the fourth then the first dibit is 00 according toTable 3 22 If the I and Q values retrieved point to the top right point of the top right quadrant i e I 3 and Q 3 see fig 3 1 4 1 then the second dibit is 11 Therefore the whole quad bit 0011 Table 3 22 Bits encoding in V 22bis modem First two bits in quadbit 2400 bit s or dibit values 1200 bit s Phase change 00 90 01 0 11 270 10 180 MOTOROLA Chapter 3 Module Descriptions 3 33 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump At the receiver the dibits are decoded and the bits reassembled in the correct order The left hand bits in Table 3 22 and Figure 3 8 are the first of each pair in the data stream as it enters the modulator portion of the modem after the scrambler For 1200 bits s the data stream to be transmitted shall be divided into groups of 2 consecutive bits dibits The dibits shall be encoded as a phase quadrant change relative to the quadrant occupied by the preceding signal element see Table 3 12 34 The signalling elements corresponding to 01 in the signal constellation Figure 3 8 shall be transmitted irrespective of the quadrant concerned This ensures compatibility with
245. ol It programs the clock generator setting registers 7 8 and 9 to the appropriate divider ratios to obtain the desired sample rate Then it writes a 0x80 into Register 6 This enables the charge pump and powers up the line side chip 813015 The function sets the desired line interface parameters calling daa country set sets Analog Receive amp Transmit and AOUT Speaker Attenuation Levels calling daa rx level set daa tx level set daa aout level set This function is called once in main Returns None Code example struct channel t channel struct daa control t daa control daa init amp channel amp daa control 3 184 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc daa country set Call s void daa country set struct daa control t daa control Arguments Table 3 80 daa country set arguments daa control in Pointer to the DAA Interface control structure Description This function sets the desired line interface parameters registers 16 17 and 18 according to the current chosen country H 0 register The full list of supported countries by the LDR Soft Modem is placed in the SUPPORT COUNTRIES array in the modem c file This function is called in daa init and in the Command Handler by AT 4GCI Country code according to the T 35 g
246. ollowing the last frame already sent Since the v42_ACCEPT_I FRAME flag is set the receiver accepts that frame and clears that flag This is the second stage This approach avoids retransmission of the last frame when the receiver becomes empty MOTOROLA Chapter 3 Module Descriptions 3 111 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction rx last 2 amp k RECEIVE become equal to rx first Last I frame is received i i i min e Receiver is not TUN so all Incoming Only one I frame can be received All incoming frames will be ignored frames can be accepted v42 OWN RECEIVER IS FULL V42 OWN RECEIVER IS FULL V42 OWN RECEIVER IS FULL V42 ACCEPT FRAME V42 ACCEPT FRAME V42 ACCEPT FRAME There is a case when the v42 AccEPT r Fav flag will not be set up If SREJ is used then the next to last frame last means a last frame that can be stored into xx iframe storage but not the last frame in the series can be damaged After that the last frame is received Later on the next to last frame is received again after retransmission In this case the rx last index points to the position next to the one pointed to by rx first Only the V42 OWN RECEIVER IS FULL flag has to be set up in this case Frame reject condition Two fields in xx iframe storage are dedicated to frame reject control If notify rej is set the transmitte
247. on On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Error Decision signal Loop filter Baud clock generator Figure 3 22 Clock Recovery block diagram 3 1 6 2 7 Carrier Recovery Carrier Recovery is used for adjusting the phase of the local carrier to match the phase of the incoming carrier It is important to generate a local carrier that has the same phase and frequency as the incoming carrier because it is used in the demodulator to demodulate the incoming signal and retrieve the baseband information To implement Carrier Recovery a phase locked loop is used Figure 3 23 Phase Carrier ncomin Nunes detector Loop filter generator carrier error generator carrier Figure 3 23 Carrier Recovery block diagram The phase detector generates an error that is used to synchronize the local carrier to the incoming carrier This error signal contains the information about the phase and frequency difference between the local and the incoming carriers The constellation points that were chosen in the current implementation are shown in Figure 3 24 The output of the phase detector is of the form E nT sgn Q nT P nT sgnT Ty Q nTy MOTOROLA Chapter 3 Module Descriptions 3 69 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Figure 3 24 DPSK receiver decision points The error E nTy is a geometr
248. on QAM_demodulator_init baud_frac Fractional part of the baud in Q15 format i e 0 5 the middle of the baud This field is initialized in function QAM_demodulator_init to 0 baud incr Increment to baud frac per sample in Q15 format This field is initialized in function QAM demodulator init filter size The number of coefficients used by the input BPF This field is initialized in function QAM demodulator init filter mark I Coefficients of BPF for the I channel in Q14 format This field is initialized in function QAM demodulator init filter mark q Coefficients of BPF for the Q channel in Q14 format This field is initialized in function QAM demodulator init filter buf Cyclic buffer used by the filter algorithm of the input BPFs This field is initialized in function QAM demodulator init to 0 filter buf ptr Pointer to the current element of the filter buf This field is initialized in function QAM demodulator init decision enabled Indicates if the decision block is enabled This field is initialized in function QAM demodulator init to TRUE descrambler Pointer to the descrambler function This field is initialized in function Rx V22bis init descrambler enabled Indicates if the descrambler is enabled This field is initialized in function QAM demodulator init to TRUE descrambler register Shift Register used by the descrambler This field is initialized in function QAM demodulator init to 0 con
249. on gets the data from the Rx data buffer using the v14 get bits function decodes it and puts the encoded data into the Rx uart data buffer using the Rx uart data write function Returns None Code example struct channel t channel Rx control data handler call func channel Code explanation case V14 DH 1 GETTING value v14 get bits channel dp 1 if value dp rx null count 0 else dp rx null count dp rx substate V14 DH SYMBOL GETTING break MOTOROLA Chapter 3 Module Descriptions 3 147 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module dp rx substate contains vi4 DH 1 GETTING The Rx V14 DH routine function gets 1 data bit from the internal rx_buffer using the v14 eet bits function until a zero occurs in the data dp rx substate then switches into v14 DH SYMBOL GETTING dp rx null count specifies the number of received zeros to determine the carrier loss case V14 DH SYMBOL GETTING if dp rx null count gt CARRIER DETECT TIME Rx control baud rate Rx control n bits 1000 Rx control data handler state RX DH STATE FAILED return else value v14 get _bits channel dp 9 if value 0 dp rx null count 9 else dp rx null count 0 if value amp 0x100 if Rx_control gt data_handler_state RX_DH STATE ONLINE_COMMAND Rx uart data wri
250. onds to one signaling element symbol transmitted The number of signaling elements transmitted per second is commonly referred to as the baud rate which for V 22bis is set by the protocol to 600 The set of possible values of the sequence I n Q n determines the signal constellation which is 3 80 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump given in a two dimensional representation The signal constellation commonly referred to as the constellation diagram is a geometric picture that emphasizes the fact that the two channels are 90 degrees Quadrature out of phase The V 22bis with 600 baud rate accomplishes the transmission of 2400 bps by encoding four incoming bits quadbit in a single baud Since there are sixteen possible values for every quadbit the constellation diagram for V 22bis contains sixteen points The overall block diagram for the QAM transmitter is shown in Fig 3 1 7 2 The basic structural blocks are the scrambler encoder digital modulator and digital filter Sample Rate 9600 Baud rate 600 Ts 1 Sample Rate T 1 Baud rate S nTs Figure 3 25 QAM transmitter block diagram 3 1 7 1 4 Scrambler The purpose of the scrambler is to randomize the input binary data sequence which means that it converts this sequence into a pseudo random binary sequence with some defined p
251. oper s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Tables Table Page Number Title Number 3 43 QAM demodulator init arguments keen 3 98 3 44 QAM demodulator Areumelifss ee ddp gode 3 99 3 45 ret connection code E En CT 3 120 3 46 V42 metbits arBUmienls ponosio E NEIN HE ds nected cade RENE ENEE UI ERE E 3 121 3 47 42 init arg E EE 3 122 3 48 Vd puIDIES ar E 3 124 3 49 S px data ARON THES a Roe eeh 3 125 3 50 y42 tx dabit AUS uments scite or m tor bo eh edet ve cafe bte ted Msi e recae cafes 3 126 3 51 v42 viewbits arguments crie EAS XR CHER KENNEN an STA CUN MR RS GER REGNA TRUE Eg Send 3 127 3 52 VD DIS ET 3 133 3 53 v42bis nit e EE 3 134 3 54 W42 Dis E EE 3 135 3 55 v42bis E EE E 3 136 3 56 EZ Dis TAA SPAR INN DIES Lee eps BOE EE 3 137 3 57 Compression ratio COmparlsOn ener enne rennen entere n ennt en nennen nte 3 138 3 58 Tx V142 DH amit argutnents ineo n dae etnia sa S Yo Ense eR ornate PEE e aenea DR 3 141 3 59 TRV 14 DH routine arg mentS need e ao Pus ee ta ceu Feo ae eae suene EnS 3 142 3 60 VLA putbits ars mentS EE 3 143 3 61 Rx V14 DH mit ate Ie nts deele iergendee 3 147 3 62 Rx AE DEH xoutine arguments cose ent menus die ever as eate MER ANS 3 148 3 63 va Re CN 3 151 3 64 TX V8 DH init aEPUEIOCHU co editore tts e PUn equ Sane aer Pets uie a D Du VU ax e ERIS 3 154 3 65 Tx V8 DH routine argUmiehts ec iari e esee easet
252. or i20 i len i nBytes v42bis Encode v42bis input data il out out nBytes MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Overview v42bis Decode Call s int v42bis Decode v42bis t dp uint8 ibuf uint32 ilen uint8 obuf uint32 olen Arguments Table 3 55 v42bis Encode arguments dp in pointer to the v42bis data structure ibuf in pointer to the input buffer ilen in number of bytes in the input buffer obuf in pointer to the buffer to output decompressed data olen out returns the actual byte count that was decoded and put into the output buffer obu f Description This function performs input buffer decoding according to the CCITT Recommendation V 42bis section 8 It decodes i1en bytes from the input buffer ibuf and puts decompressed olen bytes into the output buffer obuf The size of the output buffer obuf must not be less than the established maximum string length value of parameter p2 of va2bis rnit for each character in the input buffer i e olen ilen maximum v 42bis string length Returns e 0 if all bytes from input the buffer were processed e C ERROR if an invalid codeword in the input buffer was reached e otherwise not all bytes from the input buffer were processed Code example res v42bis Decode amp v42bis
253. or answering modem a b c Once the answering modem has connected to the line immediately following the V 25 answer sequence the modem shall be conditioned to receive signals in the low channel It shall then transmit unscrambled binary 1 s Upon detecting scrambled binary 1 s in the low channel for a period of 270 40 ms the modem shall transmit scrambled binary 1 s in the high channel and wait for a further 765 10 ms The modem is then ready to transmit and receive data After completion of the handshake sequence any inadvertent loss and reappearance of the received line signal should not cause another handshake sequence to be gen erated MOTOROLA Chapter 3 Module Descriptions 3 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 1 3 4 Implementation The requirements of V 22 are implemented in the v22 c file This module is responsible for the initialization of the V 22 handshake control structures Rx Tx V22 DH handshake t the initialization of the DPSK control structures Rx Tx control DPSK t for details about these structures refer to Sections 3 1 6 4 3 1 6 5 scrambling descrambling and controlling the handshake process Rx V22 handshake routine A description of the main functions and control structures of v22 c are given below 3 1 3 5 RX V 22 Handshake data handler structure struct Rx V22 DH handshake t enum Rx V22 hadshake st
254. parallel detection of three tones It can detect continuous and cadence tones It also distinguishes tones consisting of one and two frequencies The signals that are supported by the Tone Detector are represented in Table 3 95 CC e e e e ke ke ke ke ke kk ko ooo kk kk ok kk ok ok ee oe oe oe o ee o o e e e kk e e e e e e e e e e e Types of tones oko kk kk e o e e e oe oe oe oe oe o EE enum det tone type t DET ANS TONE DET ANSAM TONE DET ANS END TONE DET CALLING TONE DET DIAL TONE DET BUSY TONE DET NONE Table 3 95 Tones that are supported by Tone Detector Correspondence with gen tone type ttype Signal Description DET ANS TONE Answering tone The tone transmitted from the answering end without ANS or with phase reversals ANS The detected tone should be a continuous 2100215 Hz tone DET ANS END TONE Answering tone without ANS or with phase reversals ANS and pause after it The tone transmitted from the answering end The detected tone should be a continuous 2100 15 Hz tone and with a pause after it DET ANSAM TONE Modified answer tone ANSam The tone transmitted from the answering end The detected tone should be a continuous 2100 15 Hz tone and is amplitude modulated by a sine wave at 15 0 1 Hz DET CALLING TONE Calling tone The tone transmitted from the calling end The detected tone should consist of a series of interrupted 1300Hz 15 H
255. parser c realization of AT command parser at handler h definitions used by AT command handler at handler c realization of AT command handler text response h definitions used by text response routines according to V 25ter text response c realization of text response routines according to V 25ter countries h definitions of country or area codes according to ITU T T 35 misc h definitions used by miscellaneous functions misc c realization of miscellaneous functions The following files are HW and Compiler dependent parts of the Soft Modem SoftMod mcp Soft Modem project file init h general data types and definitions Init function prototypes si3044 daa h definitions used by the DAA Si3044 Modem Daughter Card interface si3044 daa c realization of the DAA S13044 Modem Daughter Card interface mcf5407 uart h definitions used by UART module routines mcf5407 uart c realization of UART module routines mcf5407 timer h definitions used by Timer module routines mcf5407 timer c realization of Timer module routines printf uart h definitions used by printf uart routine printf uart c realization of printf uart routine Only for debug requirements mc 5407 h MCF5407 definitions MOTOROLA Chapter 1 Introduction 1 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Freescale Semiconductor Inc Quick Start 1 3 mcf5407
256. ple struct channel t channel QAM demodulator init channel 3 98 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc QAM demodulator Call s void QAM demodulator struct channel t channel Arguments Table 3 44 QAM demodulator arguments channel in Pointer to the channel control data structure Description This function performs all operations of the QAM receiver It gets samples from the Rx sample buffer processes them performing QAM demodulation see 3 1 7 and places the resultant bits into the Rx data buffer It contains the input bandpass filters the automatic gain control AGC the demodulator the adaptive equalizer the decision block the decoder the descrambler the carrier recovery and the clock recovery For more detailed information about these blocks refer to Section 3 1 7 3 This function is called from the function Rx data pump of modem c module via the channel Rx control ptr data pump call func Returns None Code example struct channel t channel QAM demodulator channel MOTOROLA Chapter 3 Module Descriptions 3 99 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction 3 2 V 42 Error Correction The V 42 error correcting protocol is used to deliver data correct
257. proper form for transmission through the Public Switched Telephone Network This process basically consists of the modulation of the baseband information logical 1 s and 0 s sent by the DTE into the passband of the communications channel for transmission The receiver collects the information from the telephone network and converts it back into its original form i e the bits sent by the DTE The qam c module consists of two main blocks the QAM transmitter and the QAM receiver These blocks are called the data pump They are executed every time the Tx sample buffer is almost empty the modulator or TX data pump is executed or when the Rx sample is full enough the demodulator or RX data pump is executed They are called from the modem c module 3 1 7 1 QAM transmitter In QAM the information is encoded as the phase and amplitude change of the transmitter carrier With dn denoting the phase that contains the information to be transmitted the transmitted signal s n is represented mathematically by s n A n cos n n 4 Where is the carrier frequency The parameter A n determines the amplitude of the transmitted signal It can also be written as s n A n cos n cos n sin con sin o n 5 The substitution of I n A n cos o n Q n A n sin n into 5 results in 6 used to describe QAM modulation systems s n I n cos n Q n sin on 6 Each value of the I n Q n sequence corresp
258. ptions 3 65 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump To eliminate these harmonics the modulator output must be digitally filtered For this purpose a 38 tap bandpass filter BPF is used This filter is based on a lowpass LPF FIR filter and its coefficients are calculated according to the following rule hy nT 2 hy nT cos mol Where T is the sampling period and h nT are the coefficients of the LPF The coefficients of the BPF are calculated in the initialization routine DPSK modulator init and depend on the carrier frequency 3 1 6 1 5 Guard tone generator This module generates the guard tone which is then added to the main signal For V 22 the frequency of the guard tone is 1800 Hz 20 Hz or 550 20 Hz and is only transmitted when the modem is transmitting in the high channel carrier frequency is 2400 Hz 3 1 6 2 DPSK receiver This subsection describes the functional blocks required to implement a DPSK receiver The receiver structure is more sophisticated than that of the transmitter An overall diagram of the modem receiver is shown in Fig 3 1 6 3 The basic structural blocks of the modem receiver are the input bandpass filters the automatic gain control AGC the demodulator the decision block the decoder the descrambler the carrier recovery and the clock recovery Figure 3 20 DPSK modem receiver block diagram 3 1 6 2 1 Bandpass f
259. put codeword code to retrieve a data string from its own duplicate dictionary This is done by following the codeword trail backwards through the tree dictionary until a codeword smaller than 259 is detected While jumping backwards from node to node through the dictionary an ASCII character is recovered in each step The character string is recovered in reverse order The recovered string is the output data from the decoder The decoder saves the input codeword in a buffer and waits for the next input codeword The next input codeword is similarly converted back into an output data string The first character of that next string is combined with the previous codeword which was saved in the buffer to create a new node in the receiver dictionary by storing the codeword character pair in a next empty dictionary location The next empty dictionary nodes are computed in the same way in both the encoder and decoder so that both the encoder dictionary node and the decoder dictionary node are stored in an identical dictionary codeword Note that the encoder stores its new node one transmission earlier than the receiver This can cause a problem if the encoder uses the just created node to encode the next string The receiver would then retrieve the wrong string because it does not yet have the correct node The solution is for the transmitter to avoid using a newly created node address to encode the string immediately following The ITU standard defines 2 mod
260. r data pump call func Returns None Code example struct channel t channel Rx idle amp channel MOTOROLA Chapter 2 General Architecture 2 55 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface save data handler parameters Call s void save data handler parameters struct channel t channel struct data handler parameters t data handler parameters Arguments Table 2 31 save data handler parameters arguments channel in Pointer to the Channel control data structure data handler parameter in Pointer to the Data handler parameters structure S Description This function copies the parameters of channel Tx control ptr and channel Rx control ptr concerning the current Data Handler data handler ptr data handler call func number n bits to the data handler parameters structure This function is called in state machine Returns None Code example struct channel t channel struct data handler parameters t data handler parameters save data handler parameters amp channel amp data handler parameters 2 56 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface load data handler parameters Call s void load data handler parameters struct channel t channel struct data
261. r bpf coef agc agc average agc_cnt signal max signal present pointed to by channel Rx control ptr data pump ptr to their default values This function is called by the Rx V21 init and Rx V23 init functions None struct channel t channel FSK demodulator init amp channel 3 62 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc FSK demodulator Call s void FSK demodulator struct channel t channel Arguments Table 3 36 FSK demodulator arguments channel in Pointer to the Channel control data structure Description This function gets samples from the Rx sample buffer processes them performing binary FSK demodulation see 3 1 5 2 and places the resultant bits into the Rx data buffer This function is called by the Rx data pump function via the channel Rx control ptr data pump call func Returns None Code example struct channel t channel FSK demodulator amp channel MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 63 Freescale Semiconductor Inc Data Pump 3 1 6 DPSK The Differential Phase Shift Keying DPSK modulation technique is used in the V 22 modem This technique is implemented in the module dpsk c This module consists of two main blocks
262. r init decision enabled Indicates if the decision block is enabled This field is initialized in function DPSK demodulator init to TRUE descrambler Pointer to the descrambler function This field is initialized in function Rx V22 init descrambler enabled Indicates if the descrambler is enabled This field is initialized in function DPSK demodulator init to TRUE MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump descrambler register Shift Register used by the descrambler This field is initialized in function DPSK demodulator init to 0 noise threshold Threshold for signal noise detection in Q14 format This field is initialized in function Rx V22 init agc The AGC gain factor in Q11 format This field is initialized in function DPSK demodulator init to 1 e agcave The current average signal level in Q14 format This field is initialized in function DPSK demodulator init to 0 0625 e avecnt The counter of the baud in the AGC block This field is initialized in function DPSK_demodulator_init to 0 e smax The maximum I value over the baud in Q14 format This field is initialized in function DPSK demodulator init to Q carrier locked Indicates that the carrier is locked and the receiver is in data mode This field is initialized in function DPSK demodulator init to FALSE
263. r control structure Every Rx Data Handler module can have its own control structure It is initialized in Rx channel init to NULL data handler call func Pointer to the function call associated with the current Rx Data Handler The Rx data handler function simply calls whatever function this pointer is pointing to It is initialized in Rx channel init to NULL data handler state Current Rx Data Handler state identifier It is initialized in Rx channel init to RK amp DH STATE NORMAL e number n bits Specifies the number of elements that should be in Rx data before a data handler call func call It is initialized in Rx channel init to DEFAULT NUMBER NBIITS defined in modem h connection code Contains two connection responses used for printing to the DTE after the Handshake is complete The Data Handler module modifies this value after protocol handshake completion It is initialized in Rx channel init to 0 2 5 Global State Machine The Global State Machine determines the behavior of the Soft Modem It implements the role of the scheduler supervisor The State Machine is responsible for proper initialization and calling of the Data Pump the Data Handler the Command Parser and Command Handler and other blocks according to the Soft Modem settings The description of the Global State Machine states can be found in Table 2 5 The graphical representation of it is represented in Fig 2 5 The state machi
264. r issues a reject frame REJ or SREJ for the corresponding frame notify rej is set only if the sent rej field is cleared This is done to avoid multiple rejection of the same I frame The acceptance of I frames depends on the usage of the selective reject function If selective reject is not used or the va2 AccEPT 1 FRAME flag is set only that frame is stored in rx iframe storage which corresponds to a position pointed to by rx last If a different frame is received it is not accepted and the notify rejand sent rej fields are processed appropriately If selective reject is used the receiver checks if there is a corresponding position in the rx iframe buffer for the received I frame With the selective reject function enabled the following situations are possible 3 112 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction rx iframe V notify rej sent rej 22 0 1 23 1 0 24 rx last gt 20 0 1 21 0 1 Remote modem Soft modem RR p 1 RR p 1 I NS 23 gt RR f 1 NR 20 4y RR f 1 NR 20 e I NS 23 EN SREJ NR 20 4 I NSZ20 VR becomes equal to 21 and SREJ NR 20 rx_last moves to the next position q I NS 20 I NS 20 position for this frame will not be f und and it should be ignored
265. r to the Channel control data structure uart control n Array of the UART parameter structure This array should only contain two elements The MCF5407 only contains two UARTs Description This function initialises the uart control 0 and the uart_control 1 structures to the default parameters it then sets the UART module parameters by using the mcf5407 uart parameters set function Default parameters for UARTO data bits data bits 6 parity parity none Stop bits stop bits 1 channel mode channel mode normal flow control transmit on off FALSE Default parameters for UARTI channel mode channel mode normal rx fifo threshold 16 tx fifo threshold 16 mode codec 16 shift directionzmsb first mcf5407 Moart init enables interrupt detection for UARTO on RxRDY receiver ready and for UARTI on RxRDY and TxRDY transmitter ready by using mcf5407 wort interrupt mask set It must be called before calling daa init This function is called in main Returns None Code example struct channel t channel struct uart params t uart control 2 mcf5407 uart init amp channel uart control MOTOROLA Chapter 3 Module Descriptions 3 169 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules mcf5407 uart parameters set Call s void mcf5407 uart parameters set struct uart params t uart p
266. rage signal level in Q14 format It is initialized in FSK demodulator init to 0 agc cnt Counter of bauds left for calculation of the new gain correction factor It is initialized in FSK demodulator init to 3 e signal max The maximum value of the input signal during a baud in Q14 format It is initialized in FSK demodulator init to O signal present Indicates the carrier signal presence It is equal to TRUE if the signal is present and to FALSE otherwise It is initialized in FSK demodulator init to FALSE MOTOROLA Chapter 3 Module Descriptions 3 59 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump FSK modulator init Call s void FSK modulator init struct channel t channel Arguments Table 3 33 FSK modulator init arguments channel in Pointer to the Channel control data structure Description This function sets the fields of the Tx FSK control data structure phase incr baud incr phase baud frac current bit pointed to by the channel Tx control ptr data pump ptr to their default values This function is called by the Tx V21 init and Tx V23 init functions Returns None Code example struct channel t channel FSK modulator init amp channel 3 60 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data P
267. reescale Semiconductor Inc V 8 Software Module Tx V8 DH routine Call s void Tx V8 DH routine struct channel t channel Arguments Table 3 65 Tx V8 DH routine arguments channel in Pointer to the Channel control data structure Description This function composes CM JM or CJ messages and puts them into the Tx data buffer using the v8 put bits function Returns None Code example struct channel t channel Tx control data handler call func channel Code explanation if tx s JM success Allows the Tx V8 DH routine to send data zw success allows data to be sent if the Soft Modem is in Calling Mode and in Answering Mode if the JM message should be sent The state identifier vg state can be in one of the following states case V8 DCE CM The V8 Data Handler will send the CM message in Calling Mode or the JM message in Answering Mode State identifier v8 sub state case V8 TEN ONES 3 154 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 8 Software Module The V8 Data Handler sends ten binary Ones and goes to the va svwc state case V8 SYNC The V8 Data Handler sends the sync message and goes to the va cann FUNCTION State case V8 CALL FUNCTION The V8 Data Handler sends the call function message and goes to the vs_mopwo state case V8 MODNO
268. rence User Manual for a detailed description of the AT commands and S registers that are supported by the LDR Soft Modem In the LDR Soft Modem an interpretation of the AT commands is performed by two software blocks the Command Parser and the Command Handler MOTOROLA Chapter 3 Module Descriptions 3 231 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions 3 8 2 Command Parser Tx uart data Nas ad Command The at parser control t structure is defined in at parser h FC koe e e e e ke ke ke ook e e e e ke ke oe o kk e e e e e ke o ke e e ee e e ke o e e e e e e e e e o e e e e e e Definition of AT parser structure kk ke e ec e oe e o ooo ok ke e e e o e o o o o ke e e e e e o oe oe o ke e ee e oe e o ko ke e ee oe e e ko e e e ee ke kk struct at parser control t uint32 at command buf BUF LENGTH AT command local buffer int8 at buf ptr pointer to at command buf uint8 at command string BUF LENGTH AT command enter string buffer uint8 dial digits DIAL LENGTH Dial string buffer int8 digits number int8 dial Used if sign finishes the dial string intl6 backspace counter uint32 sample counter uint8 plus counter uint8 uart data ptr intl6 string counter uint32 command code enum parser state t parser state enum sm parser state t sm parser state Ri The at parser control t structure parameter descr
269. rgy of the incoming signal at this point is maximal so the probability of a mistake during decision making is minimal In the current implementation the early late method of Clock Recovery is used Figure 3 21 shows the energy values for each sample over the baud It can be seen in this figure that if the energy sample E7 is in the middle of the baud it has the highest energy value and the rest of the samples are located symmetrically around it i e EIZE13 E2 E12 E3 E11 and so on In other words E1 E13 0 E3 E11 0 If E7 is shifted left and is not on top of the energy hill then E11 becomes greater than E3 or E3 Ell lt 0 If E7 is shifted right E3 E11 gt 0 So the difference E3 E11 may be used as an error value If this value is negative it means that the middle of the local baud occurred earlier than the middle of the incoming baud Therefore the local baud clock must be delayed If positive the local baud clock must be advanced Figure 3 21 Signal energies over a baud In the current implementation the energy of the third and eleventh samples are calculated The difference between these energies is then found This difference is then lowpass filtered by a first order IIR filter The output of the filter is used for local baud clock adjusting The block diagram of the clock recovery algorithm is shown in Figure 3 22 3 68 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Informati
270. rly it was not properly bounded by two flags or it was received with a CRC error but its size is greater than EARLY REJ CONDITION then there is a relatively high probability that it was an information frame notify rej and sent rej fields are processed appropriately to issue a REJ frame without waiting for the next I frame with an incorrect NS 3 2 5 3 2 Supervisor frame handling Frames RR RNR REJ and SREJ are handled in a specified way described in the ITU T V 42 Recommendation The two cases to be focused on here are the reception of a reply frame with the f bit set and the reception of an SREJ frame As mentioned earlier the transmitter has to resend all I frames that are still being unacknowledged after receiving a reply frame with the f bit set Assume an I frame has a sequence number NS equal to k that is currently being transmitted to the remote modem If the receive sequence number NR of the received reply frame is less than k by module 127 sending of this I frame should not be stopped if the selective reject function is used Moreover the flag for retransmission of this frame should not be set This increases protocol performance An example is described below Assume the transmitter is sending an I frame with NS equal to 18 when the receiver accepts an RR frame with the f bit set and the NR field equal to 17 After the transmitter resends frame 17 it will start to resend frame 19 because frame 18 will have been received
271. rmine when there is no carrier It is initialised in Rx V14 DH init to 0 MOTOROLA Chapter 3 Module Descriptions 3 145 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module Rx V14 DH init Call s void Rx V14 DH init struct channel t channel struct Rx V14 DH t dp Arguments Table 3 61 Rx V14 DH init arguments channel in Pointer to the Channel control data structure dp in Pointer to the Rx V14 Data Handler data structure Description Initialisation of the Rx V14 Data Handler The Rx V14 Data Handler takes control of the data structure The user must call this function before calling the Rx VI4 DH routine and v14 get bits functions It is only necessary to call it once before Data Handler operation Returns None Code example struct channel t channel static struct Rx V14 DH t Rx V14 DH Rx V14 DH init channel amp Rx V14 DH Rx control data handler call func Rx V14 DH routine 3 146 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc The V 14 Software Module Rx V14 DH routine Call s void Rx V14 DH routine struct channel t channel Arguments Table 3 62 Rx V14 DH routine arguments channel in Pointer to the Channel control data structure Description This functi
272. rns None Code example struct daa control t daa control uint8 reg value 0 daa write reg amp daa control 0x6 reg value 3 194 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Tx daa Call s void Tx daa struct channel t channel Arguments Table 3 90 Tx daa arguments channel in Pointer to the Channel control data structure Description This function is responsible for transmitting data to the DAA States of operation TX DAA NORMAL If the Tx sample circular buffer is not empty the function reads one sample from it and sets the least significant bit to 0 no secondary frame otherwise it sets the resultant sample equal to 0 silence Finally it sends the resultant sample to the DAA by using out sample codec TX DAA PRE READ REG If the Tx sample circular buffer is not empty the function reads one sample from it and sets the least significant bit to 1 calls secondary frame otherwise it sets the resultant sample equal to 1 generates silence and calls secondary frame Changes the Tx DAA state to TX DAA READ REG Finally it sends the resultant sample to the DAA by using out sample codec TX DAA PRE WRITE REG If the Tx sample circular buffer is not empty the function reads one sample from it and sets the least significan
273. rol or sends the special character XON into the data stream in the case of Software flow control to restart the flow of data The problem with software flow control is that the characters used to stop and start the flow of data can occur naturally in the data flow enabling software flow control instructions Using software flow control may prove satisfactory if you are transferring text files only Hardware flow control is much faster and much more reliable than software flow control so it is highly recommended to use this This function is called in state_machine Returns None Code example struct channel t channel flow control amp channel MOTOROLA Chapter 3 Module Descriptions 3 181 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules 3 7 2 DAA Interface The DAA interface is a set of functions that implement control and interact with the modem daughter card based on the integrated direct access arrangement DAA S13044 The data communication between the M5407C3 and the modem daughter card is performed via the UARTI module in modem mode USART The DAA s behavior is modified by programming new coefficients into the memory register of the data codec and the line chip thus it can adhere to country specific global telephone line standards without hardware changes For detailed information about the S13044 refer to the Si3044 Data Sheet R2 01 Si3044 DS201
274. rt of the modem which converts data into a format suitable for transmission over an analogue line Likewise it converts the analogue signal from the line back into digital data Modulation protocols determine how the modem converts digital data into analog signals that can be sent over a phone line The protocol standards implemented in the LDR Soft Modem are summarized in Table 1 1 The data rates of the LDR Soft Modem specified by the standards vary from 300bps V 21 to 2400bps V 22bis 3 1 1 V 21 The V 21 module implements the ITU V 21 recommendation for a speed of up to 300bps for use in the GSTN The V 21 implementation uses Frequency Shift Keying modulation with the symbol baud rate equal to the bit rate It is a 2 channel modem e For channel No 1 the mean frequency is 1080 Hz low channel e For channel No 2 the mean frequency is 1750 Hz high channel The frequency deviation is 100 Hz In each channel the higher characteristic frequency corresponds to a binary 0 Channel No 1 is used for transmission of the caller s data i e the person making the telephone call towards the called station while channel No 2 is used for transmission in the other direction The V 21 module initializes the FSK Data Pump module and also includes a Handshake Data Handler for the process of negotiating a connection The V 21 Data Pump is implemented in the FSK module see chapter 3 1 5 MOTOROLA Chapter 3 Module Descriptions 3 1 For
275. ruct biquad param t filter 1 param struct biquad param t filter 2 param E The double biquad param t structure parameter descriptions enabled It is equal to TRUE if the frequency detector is enabled and to FALSE otherwise It is initialized in Rx tone init depending on the type of tone filter 1 param Parameters of the first Biquad Filter filter 2 param Parameters of the second Biquad Filter CCo koe e e e e e ke ke e o e e e e e ok ke o o o kk e e e e e o ke ok e e ee e oe e ok e e e e e e e oe e e e e e e ee e States of Tone Detector oko e e e e e o ke ke ke ok ke e e e oe e o ke ok ke e e e e o e e ke o e e ee e e e ke o o e e e eoe e e o e ee ee kK enum detector state t RX TONE ON DETECTION RX TONE OFF DETECTION FC eoo ko e e e e ke ke ke ke oo o e e e e e oe ke ke ke o kk e e e e e oe e o ke e e e e e e oe e o e e e e e e e oe ke e e e e e e ee Tone detector parameters Structure ko ke He e e e ke RRR o ke e eke e o ke o ok ke e e e ee EE define DET TONE FREQUENCY NUMBER 2 struct Rx tone t struct double biquad param t frequency param DET TONE FREQUENCY NUMBER enum detector state t detector state intl6 y out intl6 x out intl6 x out max uint32 tone on ms uint32 max tone on ms uint32 tone off ms uint32 detection time uint32 tone on samples left uint32 max tone on samples left uint32 tone off samples left uint32 detection saples left bool tone on detected
276. s For More Information On This Product Go to www freescale com 3 189 Freescale Semiconductor Inc Support Modules daa ring detect Call s bool daa ring detect struct daa control t daa control Arguments Table 3 85 daa ring detect arguments daa control in Pointer to the DAA Interface control structure Description This function reads and returns a value of the Ring detect field RDT from Register 5 This function is called in state machine Returns The value of field RDT of Register 5 TRUE Indicates a ring is occurring FALSE Reset either 4 5 9 seconds after last positive ring is detected or when the system executes an off hook Code example struct daa control t daa control bool ring FALSE ring daa ring detect amp daa control 3 190 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules daa go off hook Call s void daa go off hook struct daa control t daa control Arguments Table 3 86 daa go off hook arguments daa control in Pointer to the DAA Interface control structure Description This function causes the line side chip to go off hook It generates an off hook command by applying a logic 0 to the OFHK pin if DAA HW HANG UP is defined or by setting the OH bit in Register 5 if DAA HW HANG UP is not de
277. s c c eiae ecd se Oe ENERGIE HN PINE IS eee MED RD AER M SIR NUS 2 33 2 14 Tx Sate Calas TEA ATO MIETIES 52 0 aban cae E OO edet telum ee stupet Qo anes 2 34 2 15 LEE E EE 2 36 2 16 command write argufrents 5 editt ged e EV n UIS RUE anpecdeaacedaatasasbaasvansedeness 2 37 2 17 command read ACUI SMUG 5 Cited Ne HI eoo iia dues EU Eaa eaaa ain 2 38 2 18 plobal structure rit argurnents eeu e diee eden 2 39 2 19 Tx xehannelanit areumebs q d beta uhi Ded pe ub bus ha sir E E t scs oe 2 40 2 20 Rx channel Init ATO URC E 2 42 2 21 Tx reset argutnents ius o n e tpi Y ASER IAE AT RIS Ue SN SR STA INNER gea REN E GE 2 46 2 22 Rx eset drguttie age iod topi qi eegene foncier Eege 2 47 2 23 Tx data ue etre re erase vH IANUE Re ts DURS dE SURE Ede EN RE iSi 2 48 2 24 Rx data EECHELEN 2 49 2 25 ix Gata handler ee 2 50 2 26 Rx data handler are menbsus o os ea ua aa Au tad te ea gas se Een 2 5 2 27 COMM ANG parser ALS Uments cus dote s idet Eed 2 52 2 28 command handler arguments edes tt ver e Vega rhe rae NUR ESSO PN B Nera n TUE riae ene e dus 2 53 2 29 Tx suUence 2 BON ATO UODES s cesse toco e ei e ulcera dig co Monta urea ie 2 54 2 30 IER 2 55 2 31 save data handler parameters arguments 1 de qece eid eet tre td e pni ed ot pic ge 2 56 2 32 load data handler parameters argument 2 57 3 1 be vui M eens 3 5 MOTOROLA Tables ix For More Information On This Product Go to www freescale com Table Numb
278. s are located symmetrically around it i e EIZE13 E2 E12 E3 E11 and so on In other words E1 E13 0 E3 E11 0 If E7 is shifted left and is not on top of the energy hill then E11 becomes greater than E3 or E3 Ell lt 0 If E7 is shifted right E3 E11 gt 0 So the difference E3 E11 may be used as an error value If this value is negative it means that the middle of the local baud 3 84 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump occurred earlier than the middle of the incoming baud Therefore the local baud clock must be delayed If positive the local baud clock must be advanced Figure 3 27 Signal energies over a baud For smooth clock adjustment an Interpolation filter is used Int I and Int Q in Fig 3 1 7 3 This has 16 filter coefficients from 64 filter banks Each bank phase shifts the incoming signal by a certain value In the current implementation the energy of the third and the eleventh samples is calculated The difference between these energies is then found This difference is then lowpass filtered by a first order IIR filter The output of the filter is used as the input to the accumulator If the value accumulated over a certain amount of time exceeds the threshold the local baud clock is adjusted by choosing a different filterbank in the interpolation filter The b
279. s function the Tx Data Pump is initialized to work as a Pulse dialer This function is called in state_machine Returns None Code example struct channel t channel struct Tx pulse control t Tx pulse control Tx pulse init amp channel amp Tx pulse control 3 218 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Support Modules Tx pulse Call s Tx pulse struct channel t channel Arguments Freescale Semiconductor Inc Table 3 104 Tx pulse arguments channel in Pointer to the Channel control data structure Description MOTOROLA This function reads the digits for Pulse dialing from the Tx data buffer until the number of digits equals to the channel Tx control ptr process count It performs the off and on hook signals to generate make and break pulses The number of make break pulses directly depends on the digit see Table 3 105 Table 3 105 Correspondence of dial digits to the number of Make Break pulses Digit Number of Make Break pulses 0 10 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 If the symbol in Tx data is the wrong digit or is equal to the symbol it generates a pause Tx sample Figure 3 49 Pulse dialer The pause between digits is defined by the S 15 register and the pause on a comma 5 symbol is defined by the S 8 register Thi
280. s function generates the signal and places the produced samples into the Tx sample buffer The number of generated samples per call is defined by Tx control 2 number samples Chapter 3 Module Descriptions 3 219 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules This function is called by the 7x data pump function via channel Tx control ptr data pump call func Returns None Code example struct channel t channel Tx pulse amp channel 3 7 7 Text Response The text response module is a set of functions that are responsible for informative messaging to the DTE 3 220 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules print result code Call s void print result code struct channel t channel uint8 code Arguments Table 3 106 print result code arguments channel in Pointer to the Channel control data structure code in Numeric code of the Result code Description This function writes the Result code defined by code according toV 25ter into the Rx uart data buffer Result codes consist of three parts a header the result text and a trailer The characters transmitted for the header and trailer are determined by a user setting The text may be transmitted as a number or as a str
281. s initialized in Tx channel init to NULL MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel e data handler call func Pointer to the function call associated with the current Tx Data Handler The Tx data handler function simply calls whatever function this pointer is pointing to It is initialized in Tx channel init to NULL data handler state Current Tx Data Handler state identifier It is initialized in Tx channel init to TX DH STATE NORMAL number n bits Number of elements that should be generated in Tx data per call to 7x data handler It is initialized in Tx channel init to DEFAULT NUMBER NBITS defined in modem h command parser ptr Pointer to the current Command Parser control data structure It is initialized in 7x channel init to NULL command parser call func Pointer to the function call associated with the current Command Parser The command parser function simply calls whatever function this pointer is pointing to It is initialized in Tx channel init to NULL command handler call func Pointer to the function call associated with the current Command Handler The command handler function simply calls whatever function this pointer is pointing to It is initialized in Tx channel init to NULL 2 4 2 Receiver The Receiver control structure is a constit
282. s initialized in function Rx V22bis handshake init training adaptive equalizer ms Time period of the Adaptive equalizer training in ms This field is initialized in function Rx V22bis handshake init wait 16 way decision ms wait scr ones 2400 ms send scr ones 2400 ms det scr ones 2400 bits Time intervals during the handshake process according to V 22bis recommendations These fields are initialized in function Rx V22bis handshake init current counter The counter that is used for counting the different data sequences e g for detecting 32 consecutive 1 s This field is initialized in function Rx V22bis handshake init to 0 global counter Current counter of the bits received throughout the handshaking phase This field is initialized in function Rx V22bis handshake init to 0 e mode Specifies 1200 bit s V22BIS MODE 1200 or 2400 bit s V22BIS MODE 2400 mode This field is initialized in function Rx V22bis handshake init 3 1 4 7 TX V 22bis handshake data handler structure struct Tx V22bis DH handshake t enum Tx V22bis hadshake state t state uint8 current bit D State Current state of the Tx V22bis Handshake Data Handler This field is initialized in function 7x V22bis handshake init current bit Contains the current quadbit dibit to be transmitted This field is initialized in function 7x V22bis handshake init to 1 MOTOROLA Chapter 3 Module Descriptions 3 41 For More Information
283. scription This is the Receiver Rx Data Pump entry point A call to this function will execute if possible the function Rx control data pump call func associated with the current Rx Data Pump The Rx data pump function contains logic to check the condition of Rx control sample head and Rx control sample tailto determine if the number of samples specified by Rx control number samples are present in the Rx sample buffer yet If the distance between the two pointers is equal to or more than the value Rx control number samples it calls the Rx control data pump call func This function is called in state_machine Returns e RS Ok The Rx control data pump call func Was called normally d RX SAMPLE BUF NOT FILED The Rx control data pump call func Was not called because Rx sample is not full enough RX STATE COMPLETED The current state of the Rx Data Pump is complete this means that Rx control process count is equal to 0 Code example struct channel t channel if Rx data pump amp channel RX STATE COMPLETED MOTOROLA Chapter 2 General Architecture 2 49 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface Tx data handler Call s enum Tx DH result t TX DH OK TX DATA BUF FULL enum Tx DH result t Tx data handler struct channel t channel Arguments Table 2 25 Tx data handler arguments channel in Pointer to the Chann
284. ssume the rx buffer is filled with the following bits and the zx counti variable is equal to five 16 15 14 13 12 1 10 9 8 7 6 5 4 3 2 4 0 0 1 1 1 1 1 TA 110 1 1 1 1 1 0 During execution of the v42 getbits dp amp value 8 TRUE function a 0 situated in bit number 0 will be discarded as a transparent bit along with a 0 situated in bit number 6 of the xx buffer As a result bit number 8 moves to position 6 while bit number 9 the first bit of the flag moves to position 7 After that the value OxFF is returned as a parameter into lt value parameter and the rx_buffer is right shifted by 10 bits 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 X X X X X X X X X X 0 1 1 1 1 1 1 The bit stream is also examined for the occurrence of seven or more consecutive lei It is merged with checking on flag misalignment The third situation when reception of data has to be aborted is when a frame being received is unbounded Section 8 5 5 of ITU T V 42 Recommendation In this implementation the xx index variable equals 0 For all of these situations the receiver moves back into the v42_GzTTING_FLAG State where it discards all bits preceding the frame closing flag and others flags until another frame opening flag is detected In all other cases one byte can be read from the rx_buffer without the threat of
285. stellation phase quadrant Pointer to the signal constellation of the first quadrant This field is initialized in function Rx V22bis init phase quadrant change Quadrant change according to the first two bits of the quadbit This field is initialized in function Rx V22bis init last quadrant The last phase Quadrant This field is initialized in function QAM demodulator init to 0 constellation threshold Threshold for constellation point detection This field is initialized in function Rx V22bis init noise threshold Threshold for signal noise detection in Q14 format This field is initialized in function Rx V22bis init agc The AGC gain factor in Q11 format This field is initialized in function QAM demodulator init to 1 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump e agcave The current average signal level obtained after AGC in Q14 format This field is initialized in function QAM demodulator init to 0 0625 e avecnt The counter of the baud in the AGC block This field is initialized in function QAM demodulator init to 0 e smax The maximum I value obtained after AGC over the baud in Q14 format This field is initialized in function QAM demodulator init to 0 e pre agcave The current average signal level in Q14 format This field is initialized in function QAM demodulator init to
286. t Call s void Rx V22 init struct channel t channel struct Rx control DPSK t Rx control DPSK bool calling enum v22 mode t mode Arguments Table 3 17 Rx V22 init arguments channel in Pointer to the channel control data structure Rx control DPSK in Pointer to the DPSK receiver control data structure calling in Indicates either modem in call or answer mode mode in Specifies 600 bit s V22 MODE 600 or 1200 bit s V22 MODE 1200 mode Description This function initializes the Receiver control Structure according to M22 It fills the appropriate fields of the Kr control t structure pointed to by channel Rx control ptr fields n bits n bits mask baud rate number samples data pump call func state process count and the Rx control DPSK structure fields f carrier omega ptr noise threshold descrambler This function is called from state_machine Returns None Code example struct channel t channel struct Rx control DPSK t Rx control DPSK Rx V22 init channel Rx control DPSK TRUE V22 MODE 1200 3 28 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V22 handshake init Call s void Rx V22 handshake init struct channel t t channel struct Rx V22 DH handshake t Rx V22 handshake bool calling Arguments Tab
287. t Go to www freescale com Freescale Semiconductor Inc Data Pump scrambler call func t scrambler bool scrambler enabled uint32 scrambler register int16 constellation phase quadrant uint8 phase quadrant change intl6 current I intl6 current Q uint8 current quadrant uint32 filter size intl6 filter coef TX QAM FIXED EQ COEF NUMBER int16 filter buf TX QAM FILTER BUF SIZE uint32 filter buf ptr 3 88 f carrier Carrier frequency in Hz This field is initialized in function Tx V22bis init f guard Guard tone frequency in Hz This field is initialized in function Tx V22bis init carrier phase Current phase of the carrier frequency generator in Q15 format This field is initialized in function QAM_modulator_init to 0 guard phase Current phase of the guard tone generator in Q15 format This field is initialized in function QAM modulator init to 0 carrier phase incr Carrier frequency phase increment per sample in Q15 format This field is initialized in function QAM modulator init guard phase incr Guard tone frequency phase increment per sample in Q15 format This field is initialized in function QAM modulator init baud frac Fractional part of the baud in Q14 format i e 0 5 the middle of the baud This field is initialized in function QAM modulator init to 0 baud incr Increment to baud frac per sample in Q15 format This field is initialized in function Q
288. t command Returns None Code example struct daa control t daa control daa country set amp daa control MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 185 Freescale Semiconductor Inc Support Modules daa rx level set Call s void daa rx level set struct daa control t daa control Arguments Table 3 81 daa rx level set arguments daa control in Pointer to the DAA Interface control structure Description This function sets the DAA Analog Receive Gain level Register 15 ARX 2 0 according to the current setting in the S 16 register It can be set to OdB 3dB 6dB 9dB or12dB gain Returns None Code example struct daa control t daa control daa rx level set amp daa control 3 186 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules daa tx level set Call s void daa tx level set struct daa control t daa control Arguments Table 3 82 daa tx level set arguments daa control in Pointer to the DAA Interface control structure Description This function sets the DAA Analog Transmit Attenuation level Register 15 ATX 2 0 according to the current setting in the S 17 register It can be set to OdB 3dB 6dB 9dB or12dB attenuation Returns None Code exa
289. t bit to 1 calls secondary frame otherwise it sets the resultant sample equal to 1 generates silence and calls secondary frame Changes the Tx DAA state to TX DAA WRITE REG Finally it sends the resultant sample to the DAA by using out sample codec TX DAA READ REG Prepares a special frame for the Read cycle The format of the Read frame is 0x2000l 0x1 F amp channel gt daa_control gt reg_number lt lt 8 Changes the Tx DAA state to TX DAA NORMAL Changes the Rx DAA state to R amp DAA READ REG Calculates the delay between sending the frame and receiving a response Finally it sends the result frame to the DAA by using out sample codec TX DAA WRITE REG Prepares a special frame for the Write cycle The format of the Write frame is Ox IF amp channel gt daa_control gt reg_number lt lt 8 OxFF amp MOTOROLA Chapier 3 Module Descriptions 3 195 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules channel daa control value Changes the Tx DAA state to TX DAA NORMAL Changes the Rx DAA state to RX DAA WRITE REG Calculates the delay between sending the frame and receiving a response Finally it sends the resultant frame to the DAA by using out sample codec This function is called by the Interrupt Service Routine of UARTI on a Transmitter ready event Returns None Code example struct channel t channel Tx daa amp ch
290. te Rx control uint8 value dp rx substate V14 DH 1 GETTING i break 3 148 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module In substate vi4_DH SYMBOL GETTING the Rx V14 DH routine function determines the loss of the carrier If there is no loss of carrier it gets 9 data bits from the internal buffer dp rx buffer using the v14 get bits function and if the data packet isn t broken Stop bit 1 and the Data Handler state isn t in the Online command state puts the data character 8 data bits into the Rx_uart_data buffer using the Rx uart data write function see chapter 2 6 2 Circular Buffer Inline functions If there is a loss of carrier the Data Handler goes to RX DH STATE FAILED MOTOROLA Chapter 3 Module Descriptions 3 149 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc The V 14 Software Module v14 get bits Call s uint32 vi4 get bits struct channel t channel struct Rx V14 DH t dp uint32 n Arguments Table 3 63 v14 getbits arguments channel in Pointer to the Channel control data structure dp in Pointer to the Rx V14 Data Handler data structure n in Contains the number of data bits required from the Rx data buffer Description This function gets data from the Rx data
291. the Receiver control data structure This function should be called before calling Rx data pump Rx data handler and Receiver Protocol initialization functions This function is called once in main Returns None Code example define DATA LENGTH 60 define SAMPLE LENGTH 400 define COMMAND LENGTH 40 2 42 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface define UART DATA LENGTH 300 struct channel t channel struct Rx control t Rx control uint8 Rx data DATA LENGTH int16 Rx sample SAMPLE LENGTH uint8 Rx uart data UART DATA LENGTH Rx channel init amp channel amp Rx control Rx data DATA LENGTH Rx sample SAMPLE LENGTH Rx uart data UART DATA LENGTH MOTOROLA Chapter 2 General Architecture For More Information On This Product Go to www freescale com 2 43 Freescale Semiconductor Inc Interface S registers init Call s void S registers init void Arguments None Description This function initializes the global S registers data array to the default values profile that are con tained in the S FACTORY DEFAULTT data array Factory defined Configuration of S registers This function is called by the global structure init function and by the Command Handler on the ATZ or AT amp F commands Returns None Code example S registers init
292. the frame in the appropriate way If the received frame is not one of the frames listed in section 8 2 4 1 of the ITU T V 42 Recommendation then the FRMR frame will be issued 3 2 5 3 1 Information frame handling Incoming I frames are stored in the rx iframe cyclic storage This storage can accept k RECEIVE 1 frames This number must be 2X Two indexes are used within this storage rx first and rx last rx first contains an index of the first valid field vis TRUE frame in storage that has not been copied to the Rx uart data buffer yet xx 1ast contains an index of the position where the next expected frame will be placed its NS is equal to VR If the rx first index is equal to the xx 1ast index it means that there is no frame available to place its data into the Rx uart data buffer Storage is full when rx first 1 amp k RECEIVE rx last Upon receiving an I frame two conditions have to be analyzed Own receiver is busy 2 Frame Reject condition Own receiver is busy condition The receiver accepts I frames only if it is not in a busy condition Setting this flag is performed in two stages In the first stage the va2 o RECEIVER rs FULL flag is set up along with va2 AccEPT r rFRAMEifthere is space in the xx iframe storage for one additional frame rx last 2 amp k RECEIVE rx first So while the RNR frame is being sent to the remote modem that modem has enough time to start sending the next I frame f
293. this function the Tx Data Pump is initialized to work as a DTMF generator This function is called in state_machine Returns None Code example struct channel t channel struct Tx DTMF control t Tx DTMF control Tx DTMF init amp channel amp Tx DTMF control MOTOROLA Chapter 3 Module Descriptions 3 215 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Tx DTMF Call s void Tx DTMF struct channel t channel Arguments Table 3 102 Tx DTMF arguments channel in Pointer to the Channel control data structure Description This function reads the digits symbols for DTMF dialing from the Tx data buffer until the number of digits equals channel Tx control ptr process count and finds the corresponding digit or symbol to the row and column frequency according to table 3 6 5 The generator of a DTMF signal simultaneously sends one frequency from the high group and one frequency from the low group For example sending 1209Hz and 770Hz indicates that the 4 digit is being sent If the symbol in Tx data is the wrong digit or is equal to the symbol it generates a pause Tx sample Figure 3 48 DTMF dialer The pause between digits is defined by the S 11 register and the pause on comma symbol is defined the by S 8 register This function generates the signal and places the produced samples into the
294. this pointer when reading characters from Tx uart data for further processing It is initialized in Tx channel init to the start of Tx uart data e uart data end Pointer to the end of the Tx uart data circular buffer Users should not modify this pointer It is initialized in Tx channel init to the end of Tx uart data MOTOROLA Chapter 2 General Architecture 2 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel 2 10 uart data length Length of the Tx_uart_data circular buffer Initialized in Tx channel init command ptr Pointer to the command circular buffer Users should not modify this pointer It is initialized in Tx channel init to the start of command command head The command circular buffer write pointer The Command Parser modifies this pointer when writing detected sequences of user commands with parameters to the command It is initialized in Tx channel init to the start of command command tail The command circular buffer read pointer The Command Handler module modifies this pointer when reading commands and parameters from command for further execution It is initialized in 7x channel init to the start of command command end Pointer to the end of the command circular buffer Users should not modify this pointer It is initialized in Tx channel init to the end of command command length Length of th
295. tialized in function QAM demodulator init to 0 training mode is TRUE if the modem is in training mode and FALSE if the modem is in data mode This field is used in the Clock Recovery block and is Initialized in function QAM demodulator init to FALSE adaptive equalizer enabled Indicates if the adaptive equalizer is enabled This field is initialized in function QAM demodulator init adaptive equalizer training Indicates if the adaptive equalizer is in training mode This field is initialized in function QAM demodulator init filter adaptive ffe I coef filter adaptive ffe Q coef The coefficients of the adaptive filter for the I and Q channels This field is initialized in function QAM demodulator init filtrer adaptive ffe I buf filter adaptive ffe Q buf Buffer of the adaptive filter for the I and Q channels This field is initialized in function QAM demodulator init filter adaptive ffe buf ptr Pointer to the current element of filter buf This field is initialized in function QAM demodulator init to 0 mu Defines the speed of adaptation of the adaptive equalizer in Q14 format This field is initialized in function QAM demodulator init int filter size The number of coefficients used by the interpolation filter This field is initialized in function QAM demodulator init int filter coef Coefficients of the interpolation filter in Q14 format This field is initialized in function QAM demodulator i
296. tion V 14 0x01 ARQ V 42 no error correction V 14 autodetect 0x02 ARQ V 42 only hang up if V 42 cannot be established dphase enabled in Detection phase enabled TRUE disabled FALSE valid only if ec mode 0x02 srej in 0x00 use of SREJ is denied by user 0x01 use of single SREJ only is permitted by user 0x02 use of multiple SREJ only is permitted by user 0x03 use of both single and multiple SREJ permitted by user extended fcs in TRUE if the use of a 32 bit FCS is permitted by the user FALSE oth erwise test frames in TRUE if the use of TEST frames is permitted by the user FALSE otherwise compression in Request for data compression 0x00 data compression disabled 0x01 data compression is permitted for transmitting 0x02 data compression is permitted for receiving 0x03 data compression is permitted for both directions of transfer Description This function sets the fields of the current V 42 data structure pointed to by the data ptr to their default values Additionally it assigns the V 42 transmit and V 42 receive data handler routines to the channel control data structure Returns None Code example MOTOROLA Chapter 3 Module Descriptions 3 121 For More Information On This Product Go to www freescale com 3 122 Freescale Semiconductor Inc V 42 Error Correction static V42 DATA STRUCT v42data v42 init channel v42data S 13 amp S13 ORIGINATE MODE S13 ORIGINATE MODE
297. tion QAM demodulator init to FALSE clock corrected Indicates that the Clock was corrected during the current baud This field is initialized in function QAM demodulator init to FALSE e agc lp The state of the filter of the AGC block This field is initialized in function QAM demodulator init to 0 e ast cerror Contains the previous phase error in the Carrier Recovery block This field is initialized in function QAM demodulator init phase unwrap enabled Indicates whether phase unwrapping will be performed or not This field is initialized in function QAM demodulator init MOTOROLA Chapter 3 Module Descriptions 3 93 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump 3 94 phase step The step of phase correction in the Carrier Recovery block This field is initialized in function QAM demodulator init BINTG Accumulates an error in Clock Recovery block This field is initialized in function QAM demodulator init to 0 AGC GC AGC gain correction coefficient This field is initialized in function QAM demodulator init BAUD TH The threshold for the clock error in Clock Recovery block This field is initialized in function QAM demodulator init PHASE TH The threshold for the phase error in Carrier Recovery block This field is initialized in function QAM demodulator init cl ent The counter of baud in the Clock Recovery block This field is ini
298. tion uses Frequency Shift Keying modulation with the symbol baud rate equal to the bit rate It is a 2 channel modem e For channel No 1 backward The modulation rate is 75 bauds the mean frequency is 420 Hz the frequency deviation is 30 Hz e For channel No 2 forward Mode 1 The modulation rate is 600 bauds the mean frequency is 1500 Hz the Frequency deviation is 200 Hz Mode 2 The modulation rate is 1200 bauds the mean frequency is 1700 Hz the frequency deviation is 400 Hz In each channel the higher characteristic frequency corresponds to a binary 0 Channel No 1 is used for transmitting the caller s data i e the person making the telephone call towards the called station while channel No 2 is used for transmission in the other direction Most hardware modems support Mode 2 only 1200bps for channel No 2 The V 23 module initializes the FSK Data Pump module and also includes a Handshake Data Handler for the process of negotiating a connection The V 23 Data Pump is implemented in the FSK module see chapter 3 1 5 3 1 2 1 Establishment of connection The V 23 recommendation does not describe how a connection is established The procedure used by the LDR Soft Modem is described below and illustrated in Fig 3 1 2 2 Calling modem On connection to the line the calling modem shall be conditioned to receive signals in the high channel and transmit signals in the low channel After 155310
299. tions 3 123 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction v42 rx data Call s void v42 rx data struct channel t channel Arguments Table 3 49 v42 rx data arguments channel in Pointer to the channel control data structure Description This function gets data from the Rx data buffer processes it according to the V 42 protocol and places the user s data into the Rx uart data buffer Returns None Code example channel Rx control ptr data handler call func v42 rx data struct Rx control t Rx control channel Rx control ptr Rx control data handler call func channel 3 124 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42 Error Correction v42 tx data Call s void v42 tx data struct channel t channel Arguments Table 3 50 v42 tx data arguments channel in Pointer to the channel control data structure Description This function gets data from the Tx oa data buffer processes it according to the V 42 protocol and places the resultant data into the Tx data buffer Returns None Code example channel gt Tx control ptr data handler call func v42 tx data struct Tx control t Tx control channel Tx control ptr Tx control data handler call func
300. to www freescale com Freescale Semiconductor Inc V 42 Error Correction Address 0x00 OxFF 7 6 5 4 3 2 1 07 6 54 3 2 1 0 7 6 5 4 8 2 1 O0 X X X X X X X X X X X X al j useful bits useful bits useful bits i 1 byte 1 2 byte 1 3 byte Byte i 1 is a byte that was received earlier than byte i 2 byte i 2 was received earlier than byte i 3 and so on Inside of each group of bits bit number 0 is the least significant bit lsb and bit number 3 if nbits is 4 is the most significant bit msb It is not convenient to process this data as it is Some transposition is required The following approach is implemented Useful bits are stored consecutively in a 32 bit buffer rx buffer in the receiver 7 6 5 4 3 2 1 07 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 X X X x 0 0 0 1 x x x x 0 1 1 0 x x x x 1 0 1 0 _ boss c d 7 31 is zs 12 11 10 9 8 7 6 5 4 3 2 1 0 Now bytes or rather nbits are placed consecutively one after another without gaps between them The lsb of each byte resides in the next available bit in the rx_buffer with the lowest number and the msb resides in the bit of the rx_buffer having a higher number In the above example bit number 0 is the first received bit while bit number 11 is the
301. trol sample headto the next position in the buffer Returns None Code example struct Rx control t Rx control intl6 samplez0 Rx sample write amp Rx control sample MOTOROLA Chapter 2 General Architecture For More Information On This Product Go to www freescale com 2 27 Interface Freescale Semiconductor Inc Rx sample read Call s inline int16 Rx sample read struct Rx control t Rx control Arguments Table 2 8 Rx sample read arguments Rx control in Pointer to the Receiver control data structure Description Returns Code example This function reads the value of the current element in the Rx sample circular buffer pointed to by Rx control sample tail thenupdates Rx control sample tail to the next position in the buffer Value of the element pointed to by Rx control sample tail struct Rx control t Rx control intl6 sample sample Rx sample read amp Rx control 2 28 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Interface Freescale Semiconductor Inc Tx data write Call s inline void Tx data write struct Tx control t Tx control uint8 data Arguments Table 2 9 Tx data write arguments Tx control in Pointer to the Transmitter control data structure data in Symbol for writing to the Tx data circular buffer
302. tter structure The encoder takes binaries for transmiting from the Tx_data buffer Depending on the binary the encoder changes the current phase step shift this means that it changes the current frequency Mark or Space of the Frequency modulator The Frequency modulator generates the current frequency tone Some of the generated harmonics fall into the frequency region reserved for the receiver To eliminate these harmonics the modulator output must be digitally filtered For this purpose a 38 tap bandpass filter BPF is used The generated result samples are placed into the Tx_sample buffer The FSK Tx Data Pump is implemented in the FSK_modulator routine 3 1 5 2 FSK Receiver The receiver takes samples from the Rx_sample buffer demodulates them and puts the resultant bits into the Rx_data circular buffer see Figure 3 16 Rx data Rx sample Figure 3 16 FSK Rx Data Pump The structure of the FSK Receiver demodulator is shown in Figure 3 17 MOTOROLA Chapter 3 Module Descriptions 3 53 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump S nTs RO Sample Rate 9600 Ts 1 Sample Rate T 1 Baud rate Figure 3 17 FSK Demodulator structure The received signal from the Rx_sample buffer is filtered by the Input BPF in order to reject unwanted out of band noise components Then the filtered signal goes to the AGC Automatic Gain Control bloc
303. turns None Code example struct channel t channel Tx V21 handshake routine amp channel 3 8 MCF5407 LDR Soft Modem Software Developer s Reference Manual For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Data Pump Rx V21 handshake init Call s void Rx V21 handshake init struct channel t channel struct Rx V21 DH handshake t Rx V21 handshake bool calling Arguments Table 3 5 Rx V21 handshake init arguments channel in Pointer to the Channel control data structure Rx V21 handshake in Pointer to the Rx V 21 Handshake control data structure calling in Contains TRUE if the receiver is in calling mode and FALSE if the receiver is in answering mode Description This function sets the fields of the Rx V 21 Handshake control data structure pointed to by Rx V21 handshake state det ones ms wait send ms wait carrier ms current counter global counter It also initializes the fields of the Channel control data structure pointed to by the channel that are responsible for the Rx Data Handler data handler ptr data handler call func data handler state number n bits After calling this function the Rx Data Handler is initialized to perform the Rx V 21 Handshake sequence This function is called in state machine Returns None Code example struct channel t channel struct Rx V21 DH handshake t Rx V21 hands
304. uct state machine t sm state machine init amp channel amp sm state machine amp channel MOTOROLA Chapter 2 General Architecture 2 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Interface 2 6 Interface This section describes the common functions and some data structures used in the Soft Modem 2 6 1 Global Data Structures This section describes the global data structures that are used in the Soft Modem They are declared in the modem c file Table 2 4 Global Data Structures struct channel t CURRENT CHANNEL Pointer to the Current Channel control structure used by the interrupt routines It is initialized by the global structure init function const uint8 Array of countries that are supported by the current SUPPORT COUNTRIES INUMBER SUPPORT COUNTRIES version of the Soft Modem uint8 S S NUMBER Array of S Registers It is initialized by the global structure init function These registers are accessed via AT commands for setting the modem configuration parameters and establishing modem default behavior The S registers are used to provide adjustability while avoiding unnecessary coding changes const uint8 S FACTORY DEFAULT S NUMBER Factory defined Configuration of the S registers contains the default characters and values used by the Soft Modem modules these are firmware and can be modified at compile time uint8 HIH NUMBE
305. uction 1 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Quick Start 1 6 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Chapter 2 General Architecture The Low Data Rate Soft Modem runs on the M5407C3 boards with an installed Modem daughter card based on the Silicon Labs S13044 DAA The current version of the LDR Soft Modem works as a stand alone application without the need for an operating system see Fig 2 The two functions performed by the modem are Modem Data Pump functions the modulation demodulation functions e Modem Control functions error correction hardware compression and AT command interpretation Modem Daughter Card Si3021 K Si3015 Dev board M5407C3 Figure 2 1 Basic Architecture of the Standalone Version of the LDR Soft Modem All Controller and Data Pump functionality is performed using the ColdFire MCF5407 microprocessor with no additional DSP processor In general the MCF5407 performs the following functions e Modulation demodulation Data encoding decoding Filtering e Automatic gain control Tone dialing e Call progress monitoring MOTOROLA Chapter 2 General Architecture 2 1 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc e AT command s
306. uent part of the Channel It contains the parameters required for the Rx Data Handler the Rx Data Pump and the receiver circular data buffer operation The rx control t structure is defined in modem h S EE KR RR RR RR RR RK KK KR RR RR RR k RK KK KR RR RR RR RR k k KK Receiver control Structure KKK struct Rx control t enum Rx_state_t state intl6 sample ptr int16 sample head intl6 sample tail intl6 sample end uint32 sample length uint8 data ptr uint8 data head MOTOROLA Chapter 2 General Architecture 2 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Channel uint8 data tail uint8 data end uint32 data length uint8 uart data ptr uint8 uart data head uint8 uart data tail uint8 uart data end uint32 uart data length void data pump ptr call func t data pump call func uint32 number samples uint8 n bits uint8 n bits mask uint32 baud rate uint32 process count void data handler ptr call func t data handler call func enum Rx DH state t data handler state uint32 number n bits uint32 connection code i The Tx control t structure parameter descriptions S ate State identifier It contains the current state of the receiver It is initialized in Rx channel init to RK IDLE STATE e sample ptr Pointer to the Rx sample circular buffer Users should not modify this pointer It is i
307. ulator init struct channel t channel Arguments Table 3 37 DPSK modulator init arguments channel in Pointer to the channel control data structure Description Initialization of the DPSK transmitter control structure Tx control DPSK t The pointer to this structure is contained in channel Tx control ptr data pump ptr Fills up the appropriate fields of this structure with default values carrier phase baud frac scrambler register and so on refer to Section 3 1 6 4 for details This function is called by the Tx V22 init functions of the v22 c module Returns None Code example struct channel t channel DPSK modulator init channel 3 76 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc DPSK modulator Call s void DPSK modulator struct channel t channel Arguments Table 3 38 DPSK modulator arguments channel in Pointer to the channel control data structure Description This function performs all the operations of the DPSK transmitter It gets bits of data from the Tx data buffer processes them and places the resultant samples into the Tx sample buffer The number of generated samples per call is defined by channel Tx control ptr number samples This function contains the scrambler the encoder digital modulator and digital filter For more detai
308. umber in Register number Description This function reads the value of the DAA control register by number reg number It sets the register number daa control reg number reg number changes the state of the Tx DAA to TX DAA PRE READ REG daa control tx state TX DAA PRE READ REG and waits till daa control value is true becomes TRUE It then returns the value of the register contained in daa control value Returns Value of the DAA control register by number reg number Code example struct daa control t daa control uint8 reg value reg value daa read reg amp daa control 0x6 MOTOROLA Chapter 3 Module Descriptions 3 193 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules daa write reg Call s void daa write reg struct daa control t daa control uint8 reg number uint8 value Arguments Table 3 89 daa write reg arguments daa control in Pointer to the DAA Interface control structure reg number in Register number value in Register Value Description This function writes the value to the DAA control register by reg number It sets the register number daa control reg number reg number sets the new register value daa control value value changes the state of the Tx DAA to TX DAA PRE WRITE REG daa control tx state TX DAA PRE WRITE REG and waits till daa control value is true becomes TRUE Retu
309. ump Freescale Semiconductor Inc FSK modulator Call s void FSK modulator struct channel t channel Arguments Table 3 34 FSK modulator arguments channel in Pointer to the Channel control data structure Description Returns Code example This function gets bits of data from the Tx data buffer processes them performing binary FSK modulation see 3 1 5 1 and places the resultant samples into the Tx sample buffer The number of generated samples per call is defined by channel Tx control ptr number samples This function is called by the 7x data pump function via the channel Tx control ptr data pump call func None struct channel t channel FSK modulator amp channel MOTOROLA Chapter 3 Module Descriptions 3 61 For More Information On This Product Go to www freescale com Data Pump Freescale Semiconductor Inc FSK demodulator init Call s void FSK demodulator init struct channel t channel Arguments Table 3 35 FSK demodulator init arguments channel in Pointer to the Channel control data structure Description Returns Code example This function sets the fields of the Rx FSK control data structure baud incr baud frac filter buf filter buf ptr last bit filter space i filter space q filter mark i filter mark q filter bpf size filter bpf buf filter bpf buf ptr filte
310. unc state process count After calling this function the Tx Data Pump is initialized to work as a Tone generator This function is called in state machine Returns None Code example struct channel t channel struct Tx control tone t Tx control tone Tx tone init amp channel amp Tx control tone GEN ANSAM TONE MOTOROLA Chapter 3 Module Descriptions 3 201 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Tx tone Call s void Tx tone struct channel t channel Arguments Table 3 94 Tx tone arguments channel in Pointer to the Channel control data structure Description This function generates the signal and places the produced samples into the Tx sample buffer The number of generated samples per call is defined by Tx control 2 number samples Tx sample Figure 3 44 Tone generator The parameters of the signal are defined by the Tx tone init function This function is called by the Tx data pump function via channel Tx control ptr data pump call func Returns None Code example struct channel t channel Tx tone amp channel 3 202 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules 3 7 3 2 Tone Detector The Tone Detector provides the possibility of
311. ursions 3 4 1 Communication with V 42 The V 42 Error Control module invokes the V 42bis primitives during normal operations The V 42 XID frames handle V42bis negotiation parameters during call initialization There are two bits in the S23 register that either permit or disallow compression Compression can be enabled from the caller to the answerer from the answerer to the caller or in both directions To transmit data with V 42bis compression enabled the V 42 transmitter under normal conditions invokes V 42bis to encode data from the terminal The encoded data is used for all further V 42 data processing The special cyclic buffer encode buffer is used to 3 130 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Implementation Overview communicate between the V 42 transmitter and the V 42bis encoder Two different functional blocks share this buffer The V 42bis Encoding block The V 42 Frame Encapsulation block The V 42bis encoding block compresses incoming data from Tx uart data and puts it into the encode buffer The V 42 Frame Encapsulation block reads the data from that buffer and encapsulates it in the information field of an I Frame When the decision to encapsulate an I Frame is made by the V 42 transmitter it is possible that the encode buffer could be empty In this case the V 42bis Flush request
312. us counter Escape sequence symbol counter The default value of the escape sequence symbol is e uart data ptr Special pointer to the Tx_uart_data buffer for monitoring the escape sequence string counter Pointer to the at command string array this shows which element is required to begin the processing of the at command string array command code This variable contains the AT command and the parameters of this command to be written into the at command bufT parser state State identifier It contains the current substate of the AT Parser It is initialized in AT parser init to ATP WAIT A sm parser state State identifier It contains the current state of the AT Parser It is initialized in AT parser init to ATP COMMAND MODE MOTOROLA Chapter 3 Module Descriptions 3 233 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions AT parser init Call s void AT parser init at parser control struct channel t channel struct at parser control t Arguments Table 3 120 AT parser init arguments channel in Pointer to the Channel control data structure at parser control in Pointer to the AT Parser data structure Description Initialisation of the AT Command Parser The function initialises the channel Tx control ptr command handler call functo AT parser routine It must be called befor
313. wn string To begin with each tree consists of only a root node with a unique codeword Data compression is achieved by growing a duplicate dictionary in both the encoder and decoder The dictionaries are grown in lockstep using the transmitted address tokens With a few exceptions For the encoder when it outputs an address token codeword that is already in the dictionary for the decoder when it inputs an address token codeword that is already in the dictionary each address token creates a new dictionary node The dictionary contains a pre loaded section and a learning section where new nodes are added during transmission New nodes are created in both the encoder and decoder dictionaries so that both remain identical at all times Before encoding a data file the dictionaries in both the encoder and decoder are pre loaded from addresses 0 to 258 The first three dictionary addresses represent special control codes MOTOROLA Chapter 3 Module Descriptions 3 127 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc V 42bis Data Compression Protocol ETM FLUSH STEPUP for compressed mode ECM EID RESET for transparent mode which enable the encoder to communicate with the decoder Following data transmissions grow a new dictionary An original 9 bit transmission code supports a dictionary with up to 512 nodes When the dictionary exceeds 512 nodes a 10 bit transmission code is util
314. x control QAM t Tx control QAM Tx V22bis init channel Tx control QAM TRUE V22bis MODE 2400 3 44 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Data Pump Rx V22bis init Call s void Rx V22bis init struct channel t channel struct Rx control QAM t Rx control QAM bool calling enum v22bis mode t mode Arguments Table 3 26 Rx V22bis init arguments channel in Pointer to the channel control data structure Rx control QAM in Pointer to the QAM receiver control data structure calling in Indicates either modem in call or answer mode mode in Specifies 1200 bit s V22BIS MODE 1200 or 2400 bit s V22BIS MODE 2400 mode Description This function initializes the Receiver control Structure according to V 22bis It fills the appropriate fields of the Rx_control_t structure pointed to by channel gt Rx_control_ptr fields n bits n bits mask baud rate number samples data pump call func state process count and the Rx control QAM structure fields f carrier constellation phase quadrant constellation threshold noise threshold phase quadrant change descrambler This function is called from state machine Returns None Code example struct channel t channel struct Rx control QAM t Rx control QAM Rx V22bis init channel Rx control QAM TRUE
315. x ring det MOTOROLA Chapter 3 Module Descriptions 3 211 For More Information On This Product Go to www freescale com Support Modules Freescale Semiconductor Inc Rx ring detect Call s void Rx ring detect struct channel t channel Arguments Table 3 99 Rx ring detect arguments channel in Pointer to the Channel control data structure Description This function detects Ring signals It uses the features of the DAA When a ring is detected the samples in the Rx sample buffer become equal to 32767 while the ring signal is positive then go back to 32768 while the ring is near zero and negative Thus a near square wave is presented in Rx sample that swings from 32768 to 32767 in cadence with the ring signal This function handles the received sample from the Rx sample buffer in order to detect a true Ring signal Rx sample Figure 3 47 Ring Detector This function is called by the Kr data pump function via channel Rx control ptr data pump call func Returns None Code example struct channel t channel Rx ring detect amp channel 3 7 5 DTMF Dialer The DTMF dialer implements the DTMF generator 3 212 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Support Modules Dual Tone Multi Frequency or DTMF is a method for instructing a telephon
316. xadecimal tmp str 100 3 8 Miscellaneous Functions The miscellaneous routines can be found in the misc c file These functions are widely used in the LDR Soft Modem 3 228 MCF5407 LDR Soft Modem Software Developer s Reference Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions dsp cos Call s int16 dsp cos uintl6 phase Arguments Table 3 117 dsp cos arguments phase in Phase in Q15 format 0 corresponds to 0 degrees 32768 1 0 in Q15 cor responds to 360 degrees Description This function calculates the cosine 2 pi pAase The phase is fractional in Q15 format Returns Result of the cos 2 pi phase calculation Code example int 16 phase 1 15 dsp cos phase MOTOROLA Chapter 3 Module Descriptions 3 229 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Miscellaneous Functions dsp convolution frac Call s intl6 dsp convolution frac const int16 tabl const intl6 tab2 uint32 n Arguments Table 3 118 dsp convolution frac arguments tabt in Pointer to the first vector of the fractional data elements tab1 in Pointer to the second vector of the fractional data elements n in Number of elements in one vector Description This function computes a convolution for a vector of fractional data values result S tabi k
317. z signals ON for a duration of not less than 0 7s and OFF for a duration of not less than 1 5s not more than 2 0s MOTOROLA Chapter 3 Module Descriptions For More Information On This Product Go to www freescale com 3 203 Freescale Semiconductor Inc Support Modules DET DIAL TONE Dial tone The tone is used in the PSTN to indicate that the telephone network switching equipment has recognized that a telephone has gone off hook and is prepared to receive a call The Tone Detector supports several types of Dial tone determined by S 24 e ex USSR countries Brazil Continuous 425 Hz tone e North American countries Continuous 350Hz 440Hz tone e United Kingdom Continuous 350Hz tone DET BUSY TONE Busy tone The tone is used in the PSTN to indicate that the called party is already taking another call The Tone Detector supports several types of Busy tone determined by S 24 e ex USSR countries Brazil Cadence 425 Hz tone 0 25 sec ON 0 25 sec OFF e North American countries Cadence 480Hz 620Hz tone 0 5 sec ON 0 5 sec OFF e United Kingdom Cadence 400Hz tone 0 4 sec ON 0 4 sec OFF DET NONE None It means the tone detector is disabled The Tone Detector routines can be found in the one gendet c file The scope of the Tone Detector control structure is defined in the tone gendet h file FC kk e e e e e ke ke oo e e e e e e ke o ok ke e e e e e ok ke ke k e
318. zed in mcf5407_uart_init parity Parity type It can be equal to parity none No parity parity even Even parity parity odd Odd parity parity mark High parity parity space Low parity This is not used in modem mode Initialized in mcf5407_uart_init stop bits Stop bit length Selects the length of the stop bit appended to the transmitted character It can be equal to stop bits 1 1 bit stop bits 1 5 1 5 bit stop bits 2 2 bit This is not used in modem mode Initialized in mcf5407_uart_init channel mode Channel mode It can be equal to channel mode normal Normal channel mode automatic echo Automatic echo channel mode local loopback Local loop back channel mode remote loopback Remote loop back This is used in both UART and modem modes Initialized in mcf5407_uart_init flow control transmit on off The on off flag for transmission This is used to control flow between the DTE and DCE in the flow_control function It can be equal to True Data transmission from DTE to DCE is enabled False Data transmission from DTE to DCE is disabled This is not used in modem mode Initialized in mcf5407_uart_init rx fifo threshold The Rx FIFO threshold The threshold is one less than the value at which the Rx FIFO is considered to be full for the purpose of alerting the CPU that the Rx FIFO needs to be read The value should be no

Download Pdf Manuals

image

Related Search

Related Contents

DVM8861 - FuturaShop  OKI MB491+LP  Instrucciones de manejo del LIFEPAK 20e ( PDF )  LSA 37 - 2 & 4 POLOS - ACC  FIRST Valve Assembly/Operating Instructions  5-port 10/100Base-TX Industrial Switch User's Guide  MOVITRAC® B, Panel de control / Manual de instrucciones / 2007-02  

Copyright © All rights reserved.
Failed to retrieve file