1 Terms and Definitions
|ISDN||Integrated services digital network|
|SPI||Serial peripheral interface|
For related documents and software, please visit:
Download our free GreenPAK™ Designer software  to open the .gp files  and view the proposed circuit design. Use the GreenPAK development tools  to freeze the design into your own customized IC in a matter of minutes. Dialog Semiconductor provides a complete library of application notes  featuring design examples as well as explanations of features and blocks within the Dialog IC.
- GreenPAK Designer Software , Software Download and User Guide, Dialog Semiconductor
- AN-CM-299 SPI Digital ISDN Telephone Handset.gp , GreenPAK Design File, Dialog Semiconductor
- GreenPAK Development Tools, GreenPAK Development Tools Webpage, Dialog Semiconductor
- GreenPAK Application Notes, GreenPAK Application Notes Webpage, Dialog Semiconductor
- SLG46140V , Datasheet, Dialog Semiconductor
- SPI Telephone Handset Overview , Youtube
Author: Dragan Simeonov
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  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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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
We want a cutoff frequency of just under 4 kHz. (8 kHz/2)
Let R be ~ 47 ohm ...
That means that C should be 1 / 4 kHz / 2 / Pi / 47 ohm = ~ 1 uF …
...for a cutoff frequency of 1 / 2 / Pi / R / C = ~ 3.4 kHz