Evaluation Kit for CMX608/618/638
EV6180/6380
2016 CML Microsystems Plc
14
UM6180/5
6.2.
Full-duplex Demonstration
This section contains an example script that can be executed using the Script Handler tab, which
is part of the ES0003 software application. The script is available as part of the EV6380 support
package, which is available from
. For a full description of the Script
Handler command syntax refer to the Script Language Reference (publication SD/PE0003/script/2
or later) and the PE0003 User Manual (publication UM0003/2 or later). For a full description of the
CMX638 device refer to the CMX608/618/638 datasheet.
The example script will set up the CMX638 for full-duplex operation at 2400bps. Using a software
sound editor such as Audacity, installed on the host PC, PCM samples can be output from the PC
sound card and fed into the CODEC input socket on the EV6180/6380. The PCM sample data will
be encoded, decoded and the resultant output from the CODEC output socket of the EV6180/6380
can be played back through the sound card on the host PC.
;FullDuplexDemo.txt
value buffer 27
;Declare an array 'value' of size 27 x 16-bit.
register #1, #$09, #1
;Set Powersave register length to 8 bits
register #1, #$07, #1
;Set Vocoder configuration register length to 8 bits
register #1, #$2E, #1
;Set Service Acknowledgement reg. length to 8 bits
register #1, #$10, #1
;Set Decoder Frame register length to 8 bits
register #1, #$30, #1
;Set Encoder Frame register length to 8 bits
register #1, #$06, #1
;Set Analogue Output Gain register length to 8 bits
register #1, #$05, #1
;Set analogue Input gain register length to 8 bits
register #1, #$0A, #1
;Set DTMF Attenuation register length to 8 bits
device #1
;Select device 1 (connect EV6380 to J3 PE0003)
copy #1, *$01
;Reset CMX638
copy #0, value
while value == #0
copy *$40, value
;Wait for RDY flag (Status reg. bit 15) to be set
and #$8000, value
endwhile
copy #$00, *$05
;Set analogue input gain to 0dB
copy #$08, *$06
;Set analogue output gain to +2dB
copy #$8107, *$1F
;Enable interrupts
copy #$0006, *$1D
;Select fast clock speed for full-duplex mode
copy #$00, *$0A
copy #$03, *$09
;Turn on analogue BIAS and CODEC master clock
delay #100
;Allow 100ms to allow bias to reach its final value
copy #$37, *$07
;Set FEC, HDD, 2400bps and 3 x 20ms frames
copy #0, value
while value == #0
copy *$40, value
;Wait for RDY flag to be set
and #$8000, value
endwhile
copy *$2E, value
;Check that device has accepted configuration
and #$0001, value
jmpc value == #$0001 device_configured
disp "Device not configured"
stop
device_configured
disp "Device configured"
copy #$0003, *$11
;Enable encoder and decoder
copy #0, value
while value == #0
copy *$40, value
;Wait for RDY flag to be set
and #$8000, value
endwhile
copy *$2E, value
;Check that device has accepted control command
and #$0001, value
jmpc value == #$0001 device_ready