⬆️ ⬇️

Introduction to programming the DECT module SC14CVMDECT





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:



The simplest examples of using DECT



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 :



  1. 1880 - 1900 MHz - Europe
  2. 1920 - 1930 MHz - USA and Canada
  3. 1893.5 - 1906.1 MHz - Japan




  1. Standby mode - 4.5 mA
  2. Talk - 30 mA




  1. The ability to connect a microphone and headphones
  2. PCM bus - up to 4 channels simultaneously




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:



  1. 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.
  2. 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:



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 




For the API_HAL_LED_REQ request, these arguments mean:









How to play a melody:



 Sendmail.exe 31 1 5306 16 00 00 02 




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 




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 .

Source: https://habr.com/ru/post/221997/



All Articles