G.711 intercom telephone system application using VS1010 UART

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
User avatar
VSDSP Expert
Posts: 2821
Joined: Tue 2010-06-22 13:43

G.711 intercom telephone system application using VS1010 UART

Post by Panu »

Dear VS1010 users,

Here's a preliminary version of a simple UART connected internal telephone/intercom/door phone system implemented using the VS1010 Developer Board and its on-board MEMS microphone. G.711 standard telephony audio data format (using u-Law encoding) is used to get a robust, error-tolerant voice link between two or more VS1010 Developer Boards. The code contains VS1010 MEMS microphone capture functions, VLSI's high quality microphone filters, agc32 auto gain and decimation filters from 192 kHz down to 8 kHz. The code is highly adaptible for a wide range of sample rates and packet intervals.

This code basically supports connecting two VS1010 Developer Boards together using their RX1 and TX1 pins (TX1 of one board to RX1 of the second board and vice versa). Theoretically the code could support up to 16 simultaneous voice connections (8 two-way) between as many devices as the underlying serial transport such as RS-485 allows, even more than 32 if a sufficient amount of repeaters and RS-485 segments is used, but proper flow control has not been implemented yet. This is, however, a viable code base for demonstrating the possibility of such a system and serves as a foundation for further software development. Please contact VLSI if you're interested, and tell us what kind of functionality you would require of such a system.

The packet-based protocol used in the system uses a time granularity of 8 milliseconds. Each 8 milliseconds packets containing an average amount of 64 samples (and as many bytes as G.711 is used) are transmitted. There is a 10 byte overhead per packet, which consists of the following bytes:
[0] Preamble 0xD5 (010101011 in the bus) , giving maximum amount of 0-1 transitions in the beginning of the packet. Useful for auto-detecting the baudrate.
[1] Destination phone number (1 byte)
[2] Sender phone number (1 byte)
[3] Packet type byte (e.g. Status query / Setup call / Terminate call / PCM data / PCM time slot beacon / Debug information / Other data etc)
[4] Low byte of payload length
[5] High byte of payload length
[6...n+6-1] Data Payload
[n+6] Low byte of CRC-16
[n+7] High byte of CRC-16
[n+8...n+9] Framing Error Token
The Framing Error Token is an overstretched zero transmission, which extends over the bit time allocated for sending a STOP bit in the UART data line. The receiver detects this condition as a Framing Error and from this it knows that it is at a packet boundary. The end of packet is the last byte received before a Framing Error and the start of packet is the first byte received after a Framing Error. This is an effective method to shield against data corruption that modifies the perceived amount of received bytes, as this token cannot exist inside a normal a data stream; it is not a byte of any value. From this position, the perceived lenght of a received packet can be determined and CRC checksum is calculated over the perceived packet data. Packet correctness is then verified against a received CRC-16 checksum. Any invalid packets are thus immediately and reliably rejected and the bus receiver immediately resynchronizes to the incoming data stream. The polynomial used for CRC-16 calculation is MPEG layer 3 CRC polynomial calculated over an array of 16-bit words containing 8-bit bytes (high byte of each word is always zero), which is a computationally simple operation on the VS1010 VSDSP processor. 1536 kbps bitrate is used on the UART (12.288 MHz / 8).

To run the code, extract the PHONE.DLX file from the .zip archive to your two VS1010D Developer Boards' SYS folders and execute the application in both of them. This can be done easily by adding PHONE to the beginning of your CONFIG.TXT file, so that the S:SYS/PHONE.DLX application starts automatically after power-up reset. After starting the application, push the B1 button on the Developer Board to talk to the other Developer Board. Source code is included, so you can even start developing it further.

Please contact VLSI for more information!
G.711 Phone Demo, VS1010 VSOS DLX executable, VSIDE solution source code included.
(41.38 KiB) Downloaded 365 times
Post Reply