In this article we will learn about the programming of the DECT module SC14CVMDECT, be sure to flash the LED, and also share the experience of developing a solution for SIP telephony based on this module.
What is DECT
DECT (Digital Enhanced Cordless Telephone) is a wireless data transmission technology at 1.9 GHz. It is mainly used to transmit audio in telephony.
There are many terms related to DECT, many of which are purely marketing and their presence in the specification of the telephone does not guarantee the compatibility of the handsets or base stations.
')
Here is a brief list of them:
- DECT is a general term, each manufacturer makes its modifications based on DECT technology.
- DECT GAP (General Access Profile) - an attempt to standardize the functions and procedures of DECT-phones.
- DECT EU, US - DECT operation in different frequency ranges, and with different power levels.
- CAT-iq (Cordless Advanced Technology, Internet and Quality) - specifications of supported functions. CAT-iq v1 mainly regulates sound transmission, CAT-iq v2 - the ability to store and synchronize text data (address book, for example), CAT-iq v3 - transfer binary data, remote firmware updates, transfer HTTP content.
- FP (Fixed Part) - the base station that registers the tube.
- PP (Portable Part) - portable handset.
The simplest examples of using DECT
- Sound transmission Point-to-Point (aka Walkie-talkie mode) - can be used to communicate two subscribers without intermediaries.
- FP - PP transmission - you can call a regular telephone line or SIP server from a handset using a base station to connect to them.
- FP transmission — several PP — similar to the previous example; it is also possible to make Tube-Tube calls (but only through FP), hold conferences, make several parallel calls.
Comparison with Wi-Fi, Bluetooth
In addition to DECT cordless phones, Wi-Fi phones are gaining popularity now - they are easier to integrate into the infrastructure of an organization, since a regular Wi-Fi router is used as a base station. In addition, some Wi-Fi phones have an Ethernet output — i.e. You can connect stationary PCs that do not have a Wi-Fi network adapter.
In the DECT, there is one indisputable advantage - working on a separate frequency range. And given the fact that Wi-Fi-devices are becoming more and more, this is a major plus.
Of the additional advantages of DECT compared to Wi-Fi - high-quality voice transmission, without delays and gaps. In Wi-Fi, the quality can also be good, but only if the Wi-Fi phone is used as a telephone and there is not much radio interference around. If it combines the functions of a phone and a PC connection point, then you need to configure QoS (quality of service) to prioritize calls, and this is not always available and is not always convenient.
If you compare DECT with Bluetooth, then there is definitely better than DECT. DECT has a longer range. Bluetooth works at 2.4 GHz, as well as Wi-Fi, i.e. more prone to interference, and as a result, the quality of voice transmission is worse.
In the end, there remains the choice of DECT vs Wi-Fi, and there is no unequivocal solution as to which is better.
China Description SC14CVMDECT_AF
More information:
http://www.dialog-semiconductor.com/products/short-range-wireless/cordless-voice-module-(cvm)
General view of the whale:
Chip features :
- DECT ULE (Ultra Low Energy) - support for ultra low energy consumption
- Support for CAT-iq 1.0, 2.0, 3.0 protocols
- Register up to 6 handsets to one base station
- Work in the frequency ranges:
- 1880 - 1900 MHz - Europe
- 1920 - 1930 MHz - USA and Canada
- 1893.5 - 1906.1 MHz - Japan
- Power supply: 2.1 - 3.45 V
- Current consumption:
- Standby mode - 4.5 mA
- Talk - 30 mA
- Built-in antenna. It is possible to connect an external antenna
- Control Interface - UART
- Sound transmission:
- The ability to connect a microphone and headphones
- PCM bus - up to 4 channels simultaneously
- 324 KB of available flash-memory for storing user program
- 0.4 KB EEPROM for storing user program data
The general scheme of connecting external devices:
The figure shows a diagram of a typical DECT tube based on a microcontroller and the SC14CVMDECT module. The microcontroller is responsible for controlling the LCD screen and polling the pressed buttons; battery charge level detection functions, sound reception and transmission are reserved for the DECT module.
Possible options for application development
You can develop your application interacting with the DECT module in two ways:
- On a separate device (microcontroller), process all logic and exchange control data with a DECT module via a serial port (UART), using the Busmail protocol. The Busmail protocol has a mechanism to prevent packet loss (similar to the mechanism in the HDLC protocol), contains packet sequencing and checksum calculation. At the same time you can send a maximum of 7 packets. A confirmation of receipt of the packet must be sent within 100 ms.
- Integrate your logic into the application on the DECT module. It will communicate with the outside world through GPIO contacts and the UART. This is called the development of a COLA application (Co-Located Application).
These options are shown in the following image:
The choice of a particular type of development depends primarily on the complexity of the application. If the application is simple, or the use of an external microcontroller is highly undesirable, then the second option is better.
In other cases, of course, the first option is more convenient:
- It is more flexible - there is no rigid binding to the architecture of a separate DECT module.
- More visual - you can view and analyze all the commands coming from the DECT module with logging.
- More simple in debugging - to find out the cause of the application crash on the microcontroller is easier than the crash on the DECT module.
DECT module control examples
In order to make it easier to deal with the protocol of the DECT chip, it is better to take a ready-made utility Sendmail.exe - it is included in the SDK. Since the utility is written for Windows, we will check for Windows.
This utility allows you to send commands raw. The format of the commands you need to look at the API_PpCVMDECT_v0808.pdf specification
For a start, two simple examples are LED control and melody playback.
How to flash the LED:
Sendmail.exe 31 1 5902 02 03 01 FF 00 00 FF 00 02 0a 00
- The first argument of Sendmail is the COM port number in the 10th format, i.e. we have a DECT module connected to COM31.
- The second argument is the task number in the DECT module to which the command is addressed. For third-party developers, this value is always 1.
- The third is a unique team identifier in 16m format. 0x5902 is an API_HAL_LED_REQ request for LED control.
- The fourth and subsequent - the arguments of the team in 16m format.
For the API_HAL_LED_REQ request, these arguments mean:
- 02 - LedNr - LED number
- 03 - CmdCount - the number of tasks
- 01 FF 00 - 1e task, turn on the LED for 255 ms (ALI_LED_ON)
- 00 FF 00 - 2nd task, turn off the LED for 255 ms (ALI_LED_OFF)
- 02 0A 00 - 3rd task, repeat all tasks 10 times (ALI_REPEAT_SEQUENCE)
How to play a melody:
Sendmail.exe 31 1 5306 16 00 00 02
- 5306 - API_PP_AUDIO_START_TONE_REQ request to start playing a tone or melody
- 16 - ToneIndex - tone / melody number
- 00 - VolumeDb - volume in dB (± 127 dB)
- 00 - TrackGenVol - is it necessary to adjust the volume relative to the overall volume level
- 02 - Dest - audio output device (API_TONE_HANDSFREE_LSR - via speaker)
Getting the firmware version of the DECT module:
Sendmail.exe 31 1 5200 5200 - API_PP_GET_FW_VERSION_REQ
in return, should get something like:
Result: Primitiv: 5201, Data: 09 88 00 00 12 09 06 17 32 ff 5201 - API_PP_GET_FW_VERSION_CFM
- 09 88 00 00 - VersionHex - firmware version, i.e. 0x00008809
- 12 09 06 17 32 - LinkDate - the build date of the firmware, September 06, 2012 at 17:32
- f - DectType - frequency mode of the transceiver (API_DECT_TYPE_INVALID). This parameter is important if the module is in FP mode. Maybe EU, US, China, etc. To change the mode, you need to send a request API_PROD_TEST_REQ.
If these examples are not reproduced, restore the factory settings (PP mode is activated):
Sendmail.exe 31 1 4FFE 02 01 00 01 01
Wait 10 seconds and disable COLA (Co-Located Application):
Sendmail.exe 31 1 5802 FF 00
And then restart the module:
Sendmail.exe 31 1 5202
Walkie Talkie Example (Pp2Pp) - the ability for subscribers to call each other
Pp2Pp - two-way wireless communication between two subscribers.
As part of the SDK, there is already an example of Pp2Pp, and for the case of running the application on a DECT chip and in the case of its launch from a PC. It is universal, and from the first acquaintance with it can lead to shock.
We will consider how to implement the connection of two tubes with each other using the same console utility Sendmail.exe.
Connection diagram of KIT to PC:
Establishing a connection using sendmail.exe
1) Enter Pp2Pp mode
Sendmail.exe 30 1 4920 02 02 30
Sendmail.exe 31 1 4920 02 02 31
Sendmail.exe 30 1 5324
Sendmail.exe 31 1 5324
2) Call the subscriber
Sendmail.exe 30 1 4924
Sendmail.exe 30 1 4926 31
Sendmail.exe 31 1 5306 16 00 00 02
3) Lifting the tube
Sendmail.exe 31 1 4929
4) Sound on
Sendmail.exe 30 1 5303 0
Sendmail.exe 30 1 5323 01
Sendmail.exe 30 1 5301 03
Sendmail.exe 31 1,5303 0
Sendmail.exe 31 1 5323 01
Sendmail.exe 31 1 5301 03
Hooray! The sound has gone!
Behind these magic sets of numbers lies the state machine control of the DECT module. Therefore, the sequence of calls is very important. Unfortunately, Sendmail.exe does not wait for the receipt of confirmation notifications from the module, and the full picture of the exchange of messages is not clear.
The following figure shows the complete sequence of Busmail messages between a PC and two DECT modules:
The difficulties that we faced in the actual development
The real task in which DECT modules were used is the implementation of SIP phones for 6 simultaneously registered handsets. Moreover, the tubes can be of different manufacturers, the main thing is that they support the basic CAT-iq in full. SC14CVMDECT-AF was used as a DECT module. At the same time the conversation can be on 4m tubes. Each handset can call several SIP subscribers simultaneously and switch between them. For CAT-iq 2.0 handsets, general phonebook, missed call information and wideband calls are supported.
Difficulties:
1. In the original editions of the SDK, it was strongly suggested to use AT commands. They are similar to AT modem commands, but more specific. These AT commands were generated and processed by a separate application running on the DECT module.
They worked somehow, well, that the sources of this application were, we already started to correct some errors, when suddenly it turned out that Dialog Semiconductor refuses the -commands and replaces them with lower-level -commands.
At that time, there was still no miracle utility Sendmail.exe and its sources, so we had to write the parser and generator for the protocol ourselves, which was, of course, not the easiest task.
But in the latest editions of the documentation is well prepared, the examples are complete. So you can use without fear.
2. The variety of “compatible” CAT-iq handsets complicates the procedure for establishing a connection between FP and PP: the sequence of Busmail messages can change, and there is little data in the documentation, because some tubes send the dialed number in one message, others in several or in addition to another message.
Very pleased with the tube - 2.0. Compared to - 1.0, they are much more stable and the interaction process is most similar to that described in the documentation.
3. At the time of development, I hardly found CAT-iq 2.0 tubes, I had to order in Germany. They only appeared on the market. Perhaps now the situation is better.
4. UART needs a separate driver (level coordinator), since for it the logical “1” signal is 1.8V.
5. Busmail-interface assumes confirmation of the response within 100 ms. Therefore, processing Busmail messages should be done as quickly as possible.
Conclusion
SC14CVMDECT is a pretty good module for implementing DECT support. It has many possibilities, and therefore its use only as a means of communication between two points is slightly redundant. But if you need a CAT-iq 2.0 implementation, registration and simultaneous operation of several handsets or in the absence of an external SC14CVMDECT microcontroller is a very good option.
The only pity is that it does not implement SPI control (for embedded applications, SPI is sometimes more convenient than UART).
[!?] Questions and comments are welcome. They will be answered by the author of the article, Dmitry Valento, software engineer at
Promwad electronics design center .