Skip to main content

AN-CM-299 SPI Digital ISDN Telephone Handset

1 Terms and Definitions

ADC Analog-to-digital converter
DAC Digital-to-analog converter
IC Integrated circuit
ISDN Integrated services digital network
MCU Microcontroller unit
PWM Pulse-width modulation
SPI Serial peripheral interface

2 References

For related documents and software, please visit:

https://www.dialog-semiconductor.com/products/greenpak.

Download our free GreenPAK™ Designer software [1] to open the .gp files [2] and view the proposed circuit design. Use the GreenPAK development tools [3] to freeze the design into your own customized IC in a matter of minutes. Dialog Semiconductor provides a complete library of application notes [4] featuring design examples as well as explanations of features and blocks within the Dialog IC.

  1. GreenPAK Designer Software , Software Download and User Guide, Dialog Semiconductor
  2. AN-CM-299 SPI Digital ISDN Telephone Handset.gp , GreenPAK Design File, Dialog Semiconductor
  3. GreenPAK Development Tools, GreenPAK Development Tools Webpage, Dialog Semiconductor
  4. GreenPAK Application Notes, GreenPAK Application Notes Webpage, Dialog Semiconductor
  5. SLG46140V , Datasheet, Dialog Semiconductor
  6. SPI Telephone Handset Overview , Youtube

Author: Dragan Simeonov

3 Introduction

A handset is the part of a land line telephone that contains a speaker to receive audio, a microphone to transmit audio, and circuitry to interface with the base station. It can also be in the form of a headset.

Integrated Services Digital Network (ISDN) is a set of communication standards for simultaneous digital transmission of voice, video, data, and other network services over the traditional circuits of the public switched telephone network. The bearer channel (B) is a standard 64 kbit/s voice channel of 8 bits sampled at 8 kHz.

This application note will present the design of a SPI digital ISDN telephone handset using two SLG46140V [5] GreenPAK IC's. The designed telephone handset contains a speaker and a microphone and can transmit and receive audio over the SPI bus to/from the base unit at 64 kbit/s (8 bit audio sampled at 8 kHz sampling rate).

The following sections will show:

  • the SPI digital telephone handset circuit;
  • the SLG46140V GreenPAK telephone handset design in detail;
  • how to drive the handset over SPI.

P69#yIS1

Figure 1: Telephone Handset

4 SPI Digital Telephone Handset Circuit

Figure 2 shows the handset circuit. The capacitive microphone is connected between GND and a 10 k pullup resistor to 5 V. This fills the microphone capacitor with charge proportional to its capacitance. Sound vibrations make the capacitance fluctuate which in turn results in voltage fluctuations on the positive microphone terminal pin. The sound modulated voltage gets AC coupled and transmitted across the 1 uF capacitor to the PGA (+) - input on PIN6 of the left SLG46140V GreenPAK device. The two 10 k resistors connected to PIN6 are a weak voltage divider dividing the 1200 mV VREF on PIN3 to 600 mV to center the input to the middle of the PGA/ADC range (0~1200 mV). PIN7 is the PGA (-) - input and is just centered at 600 mV by two 10 k resistors dividing VREF. That way we have a ZERO point from which we can use the differential PGA amplification (16x) to amplify the microphone signal around the 600 mV ZERO point. Without the differential PGA mode, 16x amplification would result in amplifying also the 600 mV offset, saturating the PGA to the maximum value and losing the microphone signal.

P74#yIS1

Figure 2: Handset Circuit

The microphone signal gets amplified, digitized and transmitted over the SPI bus to the base unit.

From the base unit we receive the digital voice signal of the other party over the SPI bus, and inside the right SLG46140V GreenPAK device it gets converted to a PWM signal (0/5 V, 106 kHz) suitable for the n-MOS driver of the speaker. The n-MOS driver modulates the +5 V voltage on the speaker with the PWM voice signal, creating audible sound on the speaker to hear the other party. The sound is RC filtered for improved clarity.

Figure 3 shows a simple method to generate the PWM pulse train corresponding to a given signal is by using the intersective PWM method: the signal (here the red sine wave) is compared with a sawtooth waveform (blue). When the latter is less than the former, the PWM signal (bottom) is in high state (1). Otherwise it is in the low state (0). We do all this digitally, with a counter for the sawtooth, and an updating SPI voice value for the signal.

P79#yIS1

Figure 3: Intersective PWM Signal Generation

5 GreenPAK Design Schematics

The schematic of the GreenPAK design #1 – SPI ADC is shown in Figure 4.

The schematic of the GreenPAK design #2 – SPI DAC is shown in Figure 5.

P92#yIS1

Figure 4: Top View of the GreenPAK Design Schematic #1 – SPI ADC

P94#yIS1

Figure 5: Top View of the GreenPAK Design Schematic #2 – SPI DAC

5.1 GreenPAK Design #1 – SPI ADC

The analog microphone signal gets differentially amplified in the PGA (x16) and then gets fed into the ADC to be digitized. The digitized signal gets transmitted over the MISO line (PIN12) while the SPI master provides the SCLK (PIN11) and sample framing every 16 bits thru the nCSB (PIN13). The samples happen to occupy bits [9:2] out of [15:0] and are UNSIGNED WITH OFFSET (0x0000~0x03FC) as can be seen from the logic analyzer screen shot for the ADC value saturated to the maximum value - Figure 6.

P98#yIS1

Figure 6: System Diagram

The C source code snippet below shows how to read a word of SPI data and convert the sample to from UNSIGNED WITH OFFSET (0x0000~0x03FC) to SIGNED value (0xFE00~0x01FC).

5.2 GreenPAK Design #2 – SPI DAC

The digitized signal gets transmitted over the MOSI line (PIN12) while the SPI master provides the SCLK (PIN11) and sample framing every 16 bits thru nCSB (PIN13). Since we are reading only 8 bits [15:8] it is OK to transmit the sample twice every nCSB frame. The C source code snippet below shows how to write a word of SPI data.

The digitized audio sample then gets compared inside DCMP0/PWM0 to a digital “sawtooth signal” from CNT2 counting (0 ~ 255) with an overflow period of 9.3945 uS, (or 106 kHz). This results in a PWM signal going to PIN3 suitable for driving a small speaker thru a n-MOS driver.

6 GreenPAK Design Pinout

The Design consists of two GreenPAK SLG46140V ICs. The #1 - ADC Pinout is shown in Table 1 and Figure 7. The #2 - DAC Pinout is shown in Table 2 and Figure 8.

Table 1: Design Pinout #1 - ADC

P178#yIS1

Figure 7: Pin Configuration - STQFN14L

Table 2: Design Pinout #2 - DAC

P226#yIS1

Figure 8: Pin Configuration - STQFN14L

7 Test Results

The microphone signal is sampled at 8 bit resolution and 8kHz sampling frequency, outputting an uncompressed digital audio signal of 64 kbit/s. With the use of an Atmel AT90USB1286 USB devkit and the LUFAlib (Lightweight USB Framework for AVRs) we have compiled an Audio Input Device to feed the signal into GNUradio software for Fourier Analysis. Figure 9 shows the microphone signal frequency response to uniform white noise. This would be a good approximation of the microphone system transfer function. Since it has a wide uniform gain area it is a more quantitative proof of its ability to transfer audible sound to the base unit.

P230#yIS1

Figure 9: Microphone Frequency Response to Uniform White Noise

The speaker system was tested as well. With the use of an Atmel AT90USB1286 USB devkit and the LUFAlib (Lightweight USB Framework for AVRs) we have compiled an AudioOutput Device to feed the digital signal from a PC into our GreenPAK DAC driving the n-MOS driver, and subsequently the speaker. The audio quality had distinguishable speech/voice, suitable for a handset of a telephone.

8 Conclusion and Results Discussion

The Design of a SPI Digital ISDN Telephone Handset was presented. Through two GreenPAK designs on the SLG46140V we have successfully implemented a light-weight cost-effective solution. The design successfully encodes/decodes a microphone/speaker audio signal with 8 bit resolution at 8 kHz sample rate resulting in 64 kbit/s uncompressed audio suitable for a telephone quality voice call over the ISDN network. We have used two IC's in the design since the ADC/SPI and SPI/DAC components cannot be used simultaneously in one IC. The SPI component is not "Full-Duplex", so in a single device we have to choose between the SPI P2S (Parallel 2 Serial) and the SPI S2P (Serial 2 Parallel) mode using the SPI MISO pin in the first case and the SPI MOSI pin in the second case. This should not be a problem because the GreenPAK IC's are compact and still cost-effective even when used in pairs or more per design.

Appendix A RC Filter Calculation

  1. Since the speaker is 32 ohm, we will have the same order of magnitude R to maximize power.

  2. We want a cutoff frequency of just under 4 kHz. (8 kHz/2)

  3. Let R be ~ 47 ohm ...

  4. That means that C should be 1 / 4 kHz / 2 / Pi / 47 ohm = ~ 1 uF …

  5. ...for a cutoff frequency of 1 / 2 / Pi / R / C = ~ 3.4 kHz

P243#yIS1