SPDIF

History

Since the early 80's, a step towards digital audio has been set by the introduction of the Compact Disc player. In the beginning, those signals stayed inside the set, and were converted to analog signals before leaving the cabinet. A new trend is to keep signals into the digital domain as long as possible, because this is the only way to keep the signal quality. To make this possible different devices must be able communicate with one another within the digital domain. Several interfaces exist to perform such tasks, from which one has grown to the audio standard worldwide: IEC958 1989-03 (consumer Part) from the EBU. In Japan an equivalent EIAJ CP-340 1987-9 is standard.

Characteristics

Standard IEC958 "Digital audio interface" from EBU (European Broadcasting Union) details:

Physical connection:

The interface

IEC958 is a newer standard which supersedes AES/EBU and also S-PDIF. The S/PDIF interface (IEC-958) is a 'consumer' version of the AES/EBU-interface. The two formats are quite compatible with each other, differing only in the subcode information and connector. The professional format subcode contains ASCII strings for source and destination identification, whereas the commercial format carries the SCMS.

Here is a short comparision table of AES/EBU and S/PDIF interfaces:

ааааааааааааааааааааааааа AES/EBUааааааааааааа S/PDIF (IEC-958)
 
Cablingаааааааааааааааааа 110 ohm shileded TPа 75 ohm coaxial or fiber
Connectorаааааааааааааааа 3-pin XLRааааааааааа RCA (or BNC)
Signal levelааааааааааааа 3..10Vаааааааааааааа 0.5..1V
Modulationааааааааааааааа biphase-mark-codeааа biphase-mark-code
Subcode informationаааааа ASCII ID textааааааа SCMS copy protection info
Max. Resolutionаааааааааа 24 bitsааааааааааааа 20 bits (24 bit optional)

NOTE: AES/EBU also exists in 75 ohm/BNC version (AES-3id-1995 standard). 75 ohm BNC version of AES/EBU is very electrically similar to 75 ohm coaxial S/PDIF shown above.

The electrical characteristics of AES/EBU are based on on RS-422, so basically any differential RS-422 chip will do as the receiver and transmitter chips. S/PDIF coaxial interface is not specificaly based on any other standard I know of (but is quite similar in signal levels and bandwidth requrements to some video signals).

Both S/PDIF and AES/EBU can, and do transfer 24 bit words. In AES/EBU, the last 4 bits have a defined usage, so if anyone puts audio in there, it has to go to something that doesn't expect the standard specifies. But in S/PDIF, there's nothing that says what you have to use the bits for, so filling them all up with audio is acceptable. Typical S/PDIF equipments only use 16 or 20 bit resolutions. While many equipments use more than 16 bits in internal processing, it's not unusual for the output to be limited to 16 bits.

Note on HDR-2 (2 pin header) interface used in some PC products:
Many modern PC CD-ROM drives and some soundcards (SB32, AWE32, etc.) have a two pin digital output connector in the back of the drive and they sometimes call that interface S/PDIF. Unfortunately the electrical signal which comes from it is not exactly what is described in S/PDIF specifications. The data format is exactly the same, but the signal is TTL level (5Vpp) signal instead of the normal 1Vpp signal. The output level might be selected to make the interfacing to other digital electronics easy when signal is travelling inside the computer (the normal output driver system and input amplifiers can be avoided). The downnside of this is that you need to build some electronics to make the signal from the CD-ROM drive to match what normal S/PDIF equipments expect.

Multi channel audio and S/PDIF

IEC958 was named IEC60958 at 1998. IEC60958 (The S/PDIF) can carry normal audio and IEC61937 datastreams. IEC61937 datastreams can contain multichannel sound like MPEG2, AC3 or DTS. When IEC61937 datastrams are transferred, the bits which normally carry audio samples are replaced with the databits from the datastream and the headers of the S/PDIF signal. Channel-status information contains one bit (but 1) which tells if the data in S/PDIF frame is digital audio or some other data (DTS, AC3, MPEG audio etc.). This bit will tell normal digital audio equipments that they don't try to play back this data as they were audio samples. (would sound really horrible if this happens for some reason).

The equipments which can handle both normal audio and IEC61937 just look at those header bits to determine what to do with the received data.

Cabling details

S/PDIF (IEC-958) uses 75 ohm coaxial cable and RCA connectors. 75 ohm coaxial cable is inexpensive, because it is the same cable as used in video transmission (you can buy a video cable with RCA connectors to connect you S/PDIF equipments together). By specification, the max. length is 25 feet. If good 75-ohm cable with good 75-ohm connectors is used, it is possible to get good results with much longer lines. It depends on the quality of the transmitter, the receiver and the impedance match for the entire line, including the connectors. In general practical cases coaxial S/PDIF connections work typically to 10-15 meter distances with good 75 ohm coaxial cable.

AES/EBU-interface uses the well known symmetrical connections with transformer isolation and an output impedance of 110 ohm. The signal-level of this interface is reasonably higher than in the consumer version (3...10 volts). Because AES/EBU digital audio signals are transmitted at high, video-like frequencies (at around 6MHz) and should be handled very differently than standard analog audio lines. Commonly used XLR-3 microphone cables have various impedance ratings (30 ohm to 90 ohm typical) and exhibit poor digital transmission performance. The result is signal drop out and reduced cable lengths due to severe impedance mis-matching (VSWR) between AES/EBU 110 ohm equipment. AES/EBU signal transmission work for few tens of meters with a good cable.

There also an optical version of S/PDIF interface which is usually called Toslink, because uses Toslink optical components. The transmission media is 1 mm plastic fiber and the signals are trasmitted using visible light (red transmitting LED). The optical signals have exactly the same format as the electrical S/PDIF signals, they are just converted to light signals (light on/off). Because high light signal attenuation in the Toslink fiberoptic cable, the transmission distance available using this technique is less than 10-15 meters (with some equipments only few meters).

What can make difference in the sound of digital signal ?

There are two things which can cause differences between the sound of digital interfaces:

1. Jitter (clock phase noise)

This really only affects sound of the signal going directly to a DAC. If you're running into a computer, the computer is effectively going to be reclocking everything. Same applies also to CD-recoders, DAT tape decs and similar devices. Even modern DACs have typically a small buffer and reclocking circuitry, so the jitter is not so big problem nowadays that it used to be.

2. Errors

This usually causes very significant changes in the sound, often loud popping noises but occasionally less offensive effects. Any data loss or errors in either are a sign of a very broken link which is probably intermittently dropping out altogether.

S/PDIF signals

The signal on the digital output of a CD-player looks like almost perfect sine-wave, with an amplitude of 500 mVtt and a frequency of almost 3 MHz.

For each sample, two 32-bit words are transmitted, which results in a bit-rate of:

ааа 2.8224 Mbit/sа (44.1 kHz samplingrate, CD, DAT)
ааа 3.072а Mbit/sа (48 kHz sampling rate, DAT)
ааа 2.048а Mbit/sа (32 kHz sampling rate, for satellite purposes)

The output impedance is standard 75 ohm, so ordinary coaxial cable designed for video applications can be used. The minimal input level of S/PDIF interface is 200 mVtt which allows some cable losses. There is no real need for special quality cable as long as the cable is made of 75 ohm coaxial cable (a good video accessory cable works also as good S/PDIF cable).

The Coding Format

The digital signal is coded using the 'biphase-mark-code' (BMC), which is a kind of phase-modulation. In this system, two zero-crossings of the signal mean a logical 1 and one zero-crossing means a logical 0.

ааааааааааааааа _аа _аа _аа _аа _аа _аа _аа _аа _аа _аа _аа _
аааааааааааааа | | | | | | | | | | | | | | | | | | | | | | | |
clockаа 0 ___ _| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_
 
ааааааааааааааа ___аааааааа _______аааа ___аааааааа ___
аааааааааааааа |аа |аааааа |аааааа |аа |аа |аааааа |аа |
dataааа 0 ___ _|аа |_______|аааааа |___|аа |_______|аа |___
signalаааааааааа 1аа 0аа 0аа 1аа 1аа 0аа 1аа 0аа 0аа 1аа 0
 
аааааааааааааа а_аа ___аааа _аа _аа ___аа _аааа ___аа _
Biphaseааааааа | | |аа |аа | | | | |аа | | |аа |аа | | |
Markааа 0 ___а | | |аа |аа | | | | |аа | | |аа |аа | | |
signalаааааааа | | |аа |аа | | | | |аа | | |аа |аа | | |
ааааааааааааа _| |_|аа |___| |_| |_|аа |_| |___|аа |_| |___
 
cellsаааааааааа 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 0

The frequency of the clock if twice the bitrate. Every bit of the original data is represented as two logical states, which, together, form a cell. The length of a cel ('time-slot') is equal to the length of a databit. The logical level at the start of a bit is always inverted to the level at the end of the previous bit. The level at the end of a bit is equal (a 0 transmitted) or inverted (a 1 transmitted) to the start of that bit.

The first 4 bits of a 32-bit word (bits 0 through 3) form a preamble which takes care of synchronisation. This sync-pattern doesn't actually carry any data, but only equals four databits in length. It also doesn't use the BMC, so bit patterns which include more than two 0's or 1's in a row can occur (in fact, they always do).

There are 3 different sync-patterns, but they can appear in different forms, depending on the last cell of the previous 32-bit word (parity):

аа Preambleааа cell-orderаааааааа cell-order
аааааа (last cell "0")ааа (last cell "1")
аа ----------------------------------------------
аа "B"аааааааа 11101000аааааааааа 00010111
аа "M"аааааааа 11100010аааааааааа 00011101
аа "W"аааааааа 11100100аааааааааа 00011011
 
Preamble B: Marks a word containing data for channel A (left)
ааа at the start of the data-block.
 
Preamble M: Marks a word with data for channel A that isn't
ааа at the start of the data-block.
 
Preamble W: Marks a word containing data for channel B.
ааа (right, for stereo). When using more than 2
ааа channels, this could also be any other channel
ааа (except for A).

Word and Block Formats

Every sample is transmitted as a 32-bit word (subframe). These bits are used as follows:

аа bitsаааааааааа meaning
аа ----------------------------------------------------------
аа 0-3ааааааааааа Preamble (see above; special structure)
 
аа 4-7ааааааааааа Auxillary-audio-databits
 
аа 8-27аааааааааа Sample
а (A 24-bit sample can be used (using bits 4-27).
аа A CD-player uses only 16 bits, so only bits
аа 13 (LSB) to 27 (MSB) are used. Bits 4-12 are
аа set to 0).
 
аа 28аааааааааааа Validity
а (When this bit is set, the sample should not
аа be used by the receiver. A CD-player uses
аа the 'error-flag' to set this bit).
 
аа 29аааааааааааа Subcode-data
 
 аа30аааааааааааа Channel-status-information
 
аа 31аааааааааааа Parity (bit 0-3 are not included)

The number of subframes that are used depends on the number of channels that is transmitted. A CD-player uses Channels A and B (left/right) and so each frame contains two subframes. A block contains 192 frames and starts with a preamble "B":

"M" Ch.1 "W" Ch.2 "B" Ch.1 "W" Ch.2 "M" Ch.1 "W" Ch.2 "M" ...
 
|ааааааааааааааа ||_ sub __|_ sub _||ааааааааааааааа |
|ааааааааааааааа ||ааааааааааааааа ||ааааааааааааааа |
|__ Frame 191 ___||__ Frameаа 0 ___||__ Frameа 1 ____|
 
а |
аааааааааааа block-start

Channelstatus and subcode information

In each block, 384 bits of channelstatus and subcode info are transmitted. The Channel-status bits are equal for both subframes, so actually only 192 useful bits are transmitted:

аа bitааааааааааа meaning
аа -------------------------------------------------------------
аа 0-3ааааааааааа controlbits:
 
а bit 0: 0 (is set to 1 during 4 channel transmission)
а bit 1: 0=Digital audio, 1=Non-audioаа (reserved to be 0 on old S/PDIF specs)
а bit 2: copy-protection. Copying is allowed
 when this bit is set.
ааааааааааааааааа bit 3: is set when pre-emphasis is used.
 
аа 4-7ааааааааааа 0 (reserved)
 
аа 9-15аааааааааа catagory-code:
 
а 0 = common 2-channel format
а 1 = 2-channel CD-format
ааааа (set by a CD-player when a subcode is
аааааа transmitted)
ааааааааааааааааа 2 = 2-channel PCM-encoder-decoder format
 
ааааааааааааааааа others are not used
 
аа 19-191аааааааа 0 (reserved)

The subcode-bits can be used by the manufacturer at will. They are used in blocks of 1176 bits before which a sync-word of 16 "0"-bits is transmitted

Electrical Interface

The electrical interface for S/PDIF signals can be either 75 ohm coaxial cable or optical fiber (usually called Toslink). Usually consumer models use that coaxial cable interface and semiprofessional/professional equipments use optical interface. The electrical signal in the coaxial cable is about 500mVtt.


Converting between AES/EBU and S/PDIF interfaces

There are differences in the electrical characteristics of AES/EBU and S/PDIF interfaces:

You can convert one electrical interface to another with a small amount of off-the-shelf hardware and a little time as you can see in the circuit below.

But the protocol used in AES/EBU and S/PDIF is not exactly the same and that can cause sometimes problems. The basic data format of AES and S/P-DIF are identical. There is a bit in the channel status frame that tells which is which. Depending upon the setting of that bit, some bits have different meanings. For example, the bits used to describe de-emphasis in the AES/EBU protocol overlap the bits used to implement the SCMS protocol in S/P-DIF land.

The big problem comes in the fact that MANY products out there are VERY picky about what they see in the bits, and even though a given signal may fall within the letter of the standard, some equipment will absolutely refuse to talk to it. Many equipments are reasonably flexible and tolerant of slight foos in the signal so the simple converters cna work on those. But a simple converter that works fine with one piece will as likely not work with another.

What are different types of IEC 958-interface

There are 2 implementations of IEC 958: consumer and professional. Those are referred in standard as IEC958 Types I and II. IEC958 professional format is same as AES/EBU but is carried over same type of coaxial or optical interface as consumer S/PDIF. IEC958 consumer format is the S/PDIF format used in CD-players. You can put an S-PDIF data stream on an AES/EBU physical balanced cable, or vice versa, and still have it be valid IEC958 data. Professional and consumer formats (Types I and II) differ only in the subcode information. In order to do track indexing, you must have a consumer format data stream (ie. an S/PDIF style data).

Jitter specifications of AES/EBU interface

The AES/EBU standard for serial digital audio uses typically 163 ns clock rate and allows up to +-20 ns of jitter in the signal. This peaks to peak value of 40 ns is aroun 1/4 of the unit interval. D/A conversion clock jitter requirements are considrably tighter. A draft AES/EBU standard specifies the D/A converter clock at 1 ns jitte; however, a theoretical value for 16-bit audio could be as small as 0.1 nsec. Small jitter D/A conversion is implemented by using separate PLL clocks for data recover and DAC and by using a buffering between data recovery and DAC.

Conversion circuits

Here are some AES/EBU and S/PDIF circuit collected from various sources. The following circuit will only convert the signal levels, not other protocol details.

Remeber that although the audio data is the same in both AES/EBU and S/PDIF interfaces, they are indeed different formats, at least in their subcode. AES converted to coax is NOT S/PDIF, and S/PDIF converted to XLR balanced is NOT AES. They are still their native format, just the transmission medium has changed. Whether they will work in your application depends on the equipment chosen.

Some DATs have a switch that selects one format or the other regardless of the physical interface, some just ignore what they don't understand (usually resulting in the generally positive benefit of ignoring SCMS encoding), and some indeed gag on the "other" format. But simply fixing the physical interface works far more often than it doesn't.

How to do different conversions using the circuit below

Here are some ideas how to make the most common conversions using the circits described below. Note: there is no guarantee that the information in this or the circuit are correct (they are believed to be correct but note tested by the author).

For every other conversion combination you can think of you can find circuits on the lis below. To build an dapter you need two parts connected after each other.

After you have slected the suitable circuit parts, built them an attached them together you get the conversion circuit you want. If you need more than one output, you can connect few (1-4) output modules to one input circuitry to have more then one output.

AES/EBU to S/PDIF signal level converter

AES out:аа 2-------330 ohm-----+-------------аа SPDIF in
аааааааааааааааааааааааааааааа |
аааааааааа 3--+ааааааааааааа 91 ohm
ааааааааааааа |ааааааааааааааа |
аааааааааа 1--+------+---------+-------------
аааааааааааааааааааа |
аааааааааааааааааааа -
ааааааааа ааааааground

The idea for this circuit is taken from articles posted to Usenet News.

If you are looking for a professional components for 110 ohm to 75 ohm interconnection then check Canare web site where they have 110 OHM-75 OHM IMPEDANCE TRANSFORMERS.

S/PDIF to AES/EBU

аааааааааааааааааааааааааааааааааааааааааа _
ааааааааааааааааа + 5 voltааааааааааааааа | \
SPDIF out:ааааааааа |аааааааа аааааааааа+-|а O-+
ааааааааааааааааааа _ +--4,7k-+аааааааа | |_/а |
ааааааааааааа diode ^ |а _ааа |аааа _аа |а _аа |
аааааа 10 u (+)аааа | | | \аа |ааа | \а | | \а |ааааа 100 n
O--+--+-||-+--------+-+-|а O--+--+-|а O-+-|а O-+-120 r-||-+----+-- 2
аа |а |аа а|ааааааа |аа |_/аа |а | |_/ааа |_/аааааааааааа |ааа |
аа |а +-||-+ 100nаа _аааааа 2,2k |аааааааааааааааааааааа 1 kаа |
а 75rаааааааааааааа ^ diodeаа |а |аааа ICаааааааааааааааа |ааа |аа AES in
аа |ааааааааааааааа |ааааааа --- |аааааааааааааааааааааа ---а а|
а ---ааааааааааааа ---аааааааааа |аааааа _ааааааааааааааааааа 220r
аааааааааааааааааааааааааааааааа |ааааа | \аааааааааа 100 nааа |
аааааааааааааааааааааааааааааааа +--+---|а O---+--120 r-||-+---+--- 3
 Diode = 1N914 or 1N4148ааааааааааа |аа |_/ааа |аа аааааааа|
ааааааааааааааааааааааааааааааааааа |ааа _аааа |аааааааа 1 kаа +--- 1
ааааааааааааааааааааааааааааааааааа |аа | \ааа |аааааааааа |аа |
ааа IC = 74HC04 or CMOS 4049ааааааа +---|а O---+ааааааааа --- ---
ааааааааааааааааааааааааааааааааааааааа |_/

The idea for this circuit is taken from articles posted to Usenet News.


S/PDIF conversion circuit building blocks

This is a collection of S/PDIF circuits found from various sources. The circuits are presented as building blocks which have one end on S/PDIF standard signal and other end an TTL level signal. The TTL levle signal end of the circuits is designed to be the the interface which you can use to wire different modules together to make whatever S/PDIF converter circuit you want. The circuit are presented as building blocks because with this approacs you can most easily build a suitable circuit for all conversion needs.

Here are tips for building a conversision circuits for different uses:

For other conversion needs do a little thinking and you should find quite easily the answer what blocks to connect to each other.

S/PDIF output buffer circuits

Here is set of output circuit which take in TTL level S/PDIF signal in and output standard S/PDIF coax cable output signal. Those output circuit are very useful building blocks for all kinds of S/PDIF related electronics projects. All the circuits do basically the same thing. They just use different components, so use the one where uou can easily get components.

S/PDIF output buffer circuit

ааааааааааааааааааааааааааааааааааааааааааааааааааааааа ааS/PDIF output
ааааааааааааааааааааааааааааааааааааааааааааааааааааааааа (RCA or BNC)
ааааааааааааааааааааааааааа |\ 
TTL level signal -----+-----| O-----680R--+---------+ааа +------- center pin
ааааааааааааааааааааа |аааа |/ааааааааааа |аааааааа |ааа |
 ааааааааааааааааааааа|аааааааааааааааааа |ааааааааа )||(
ааааааааааааааааааааа |аааа |\ааааааааааа |ааааааааа )||(
ааааааааааааааааааааа +-----| O-----680R--+ааааааааа )||(
ааааааааааааааааааааааааааа |/ааааааааааа |ааааааааа )||(
аааааааааааааааааааааааа ааааааааааааааа100Rааааааа |ааа |
ааааааааааааааааааааааааа 74HC04ааааааааа |аааааааа |ааа +------- ground
ааааааааааааааааааааааааааааааааааааааааа +----+----+ T1
аааааааааааааааааааааааааааааааааааааааааааааа |
аааааааааааааааааааааааааааааааааааааааааа ааа---

Idea for this circuit is taken from "A digital Output for the CD720" web page (was at http://www.spiceisle.com/homepages/brian/audiodiy/mods/digi-out.htm). The transformer T1 is high quality 1:1 pulse transformer (can be salvaged from old broken network interface card or similar source).

Another S/PDIF output circuit

 
ааааааааааааааааааааааааааа |\
ааааааааааааааааааааа +-----| O-----------+
ааааааааааааааааааааа |аааа |/ааааааааааа |аааааааааааааа S/PDIF output
ааааааааааааааааааааа |ааааааааааааа ааааа|а 100nFааааааа (RCA or BNC)
ааааааааааааааааааааа |аааа |\ааааааааааа |аа ||ааааа T1а 
TTL level signal -----+-----| O-----------+---||----+ааа +-------+--75R--- center pin
ааааааааааааааааааааа |аааа |/ааааааааааа |аа ||ааа |ааа |аааааа |
ааааааааа аааааааааааа|аааааааааааааааааа |ааааааааа )|| |аааааа | 
аааааааааааааааааааааа|аааа |\ааааааааааа |аааа 15аа )||(а 3ааа 220R
ааааааааааааааааааааа +-----| O-----------+ааа turns )||( turnsа |
ааааааааааааааааааааа |аааа |/ааааааааааа |ааааааааа )|| |ааа ааа|
ааааааааааааааааааааа |аааааааааааааааааа |аааааааа |ааа |аааааа | 
аааааааааааааааааааааа|аааа |\04ааааааааа |аааааааа |ааа +-------+-------- ground
ааааааааааааааааааааа +-----| 0-----------+аааааааа |аа 
аааааааааааааааааааааааааааа|/ааааааааааааа ааааааа---
аа 
аааааааааааааааааааааааааа74HCU04аааааааааааааааааааа 

This circuit is part of circuit "Splitter for S/PDIF coax/optical output" by T. Giesberts from Elektor Electronics magazine July/August 1995 pages 78-79. The transformer T1 is made to G2.3-FT12 ferrite ring core. Primary coil is 15 turns of 0.5 mm diameter enamelled copper wire and secondary is 3 turns of 0.5 mm diameter enamelled copper wire. The chip 74HCU04 is manufactured by Philips

The circuit in the magazine had 3 outputs. The two extra output were made by adding two more output coils to T1 and the output resistors.

Output circuit with transformer used as impedance matcher

This circuit is taken from Digital One V. 1.1 documentation. Digital One is from NET-Labs and is designed by by Enland Unruh.

аааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааа S/PDIF output
 
ааааааааааааааааааааааааааа IC1ааааааааааааа 0.1 uFааааааа 0.1 uFаааа 
аааааааааааааааааааааааааааа|\аааа ааааааааааа||ааааааааааа ||
TTL level signal -----------| +-----750R--+---||----+ааа +--||--- center pin
ааааааааааааааааааааааааааа |/ааааааааааа |аа ||ааа |ааа |а ||
ааааааааааааааааааааааааааааааааааааааааа |ааааааааа )||(
ааааааааааааааааааааааааааааа аааааааааааа|ааааааааа )||(
ааааааааааааааааааааааааааааааааааааааааа |ааааааааа )||(
ааааааааааааааааааааааааааааааааааааааааа |ааааааааа )||(
ааааааааааааааааааааааааааааааааааааааа 499Rааааааа |ааа |
ааааааааааааааааааааааааааааааааааааааааа |аааааааа |ааа +------- ground
ааааааааааааааааааааааааааааааааааааааааа +----+----+ T1
аааааааааааааааааааааааааааааааааааааааааааааа |
ааааааааааааааааааааааааааааааааааааааааааааа ---

T1 is a HF-transformer which has 2:1 turns ratio. Transformer type used in example circuit is SC944-05. IC1 in this circuit consists of 8 parallel connected buffer ports from 74ACQ244 IC.

Output with 1:1 pulse transformer

This is the recommended S/PDIF output circuit from Crystal Semiconductor CD4237 single chip multimedia audio system IC datasheet page 71.

аааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааа S/PDIF output
ааааааааааааааааааааааааааа IC1аааааааааааааааааааааааааааааааааааааа 
аааааааааааааааааааааааааааа|\ааааааааааа аааааааааааааааааааа
TTL level signal -----------| +-----374R--+---------+ааа +------- center pin
ааааааааааааааааааааааааааа |/ааааааааааа |аааааааа |ааа |ааа 
аааааааааааааааааааааааааааааааааааааааааа|ааааааааа )||(
аааааааааааааааааааааааааааааааааааа ааааа|ааааааааа )||(
ааааааааааааааааааааааааааааааааааааааааа |ааааааааа )||(
ааааааааааааааааааааааааааааааааааааааааа |ааааааааа )||(
аааааааааааааааааааааааааааааааааааааа 90.9Rааааааа |ааа |
ааааааааааааааааааааааааааааааааааааааааа |аааааааа |ааа +------- ground
ааааааааааааааааааааааааааааааааааааааааа +----+----+ T1
аааааааааааааааааааааааааааааааааааааааааааааа |
ааааааааааааааааааааааааааааааааааааааааааааа ---

The transformer used in this circuit is 1:1 pulse transformer (the original application note suggested pulse transformer from Pulse Engineering or Schott Corporation). IC1 is a buffer IC which must be capablw to supply enough current to drive the 75 ohm S/PDIF interface to full votlage swing specified (capable of loading 415 ohm load or capable of supplying 12 mA current).

Simple S/PDIF output without galvanic isolation

 
ааааааааааааааааааааааааааа |\
ааааааааааааааааааааа +-----| O-----------+
ааааааааааааааааааааа |аааа |/ааааааааааа |аааааааааааааа S/PDIF output
ааааааааааааааааааааа |аа аааааааааааааааа|а 150nFааааааа (RCA or BNC)
аааааааааааа |\аааааа |аааа |\ааааааааааа |аа ||ааааааа 
TTL level ---| o------+-----| O-----------+---||-----374R---+----- center pin
signalаааааа |/аааааа |аааа |/ааааааааааа |аа ||ааааааааааа |
ааааааааааааа аааааааа|аааааааааааааааааа |аааааааааааааааа |
ааааааааааааааааааааа |аааа |\ааааааааааа |ааааааааааааааа 93R1
ааааааааааааааааааааа +-----| O-----------+аааааааааааааааа |
ааааааааааааааааааааа |аааа |/ааааааааааа |аааааааааааааааа +----- ground
ааааааа аааааааааааааа|аааааааааааааааааа |аааааааааааааааа |
ааааааааааааааааааааа |аааа |\ааааааааааа |ааааааааааааааа ---
ааааааааааааааааааааа +-----| 0-----------+аа 
аааааааааааааааааааааа|аааа |/ааааааааааа |
ааааааааааааааааааааа |аааааааааааааааааа |
ааа аааааааааааааааааа|аааа |\ааааааааааа |аа 
аааааааааааааааааааааа+-----| 0-----------+аа 
аааааааааааааааааааааааааааа|/
 
ааааааааааааааааааааааааа 74HTU04аааааааааааааааааааа 

This circuit does not provide any isolation on the output. The TTL level signal form 74HCT04 buffer is attenuated to the levels specified in S/PDIF optical interface by using the voltage divider made of 374 ohm and 93.1 ohm resistors. This circuit is based on S/PDIF converter circuit diagram from Elektor Electronics magazine issue 4/1997 page 66.

Simplest TTL to S/PDIF coax interface

аааааааа 100nF
а TTL ----||-----330ohm--+--------- coax S/PDIF signal out
а inаааааааааааааааааааа |
ааааааааааааааааааааа 100ohm
аааааааааааааааааааааааа |
 Ground -----------------+--------- coax signal ground

This ricuit interfaces directly to the TTL level output provided by some sound equipment (CD-ROM or soundcard). This circuit works if the equipment which gives out TTL level has powerful enough TTL output to run this circuit (enough current output capability). If this simple circuit does not work reliably, then you need to build a circuit which includes the buffering electronics.

Isolation transformer for S/PDIF output

If your equipment (for example sound cards) has an S/PDIF output which does not have an isolation transformer at the output, you can easily add the transformer to it by putting a suitable transformer afther the original output.

Elector Electronics magazine issue 7-8/1999 recommend building the transformer for S/PDIF isolation in the following way:

The transformer must have good coupling factor, so the transformer core must be a toroidal core made of high permiability material. The prototype described in the magazine uses Philips Type TN13/7.5/5-3E25 core which has permiability rating (yt) of 4500. THe primary and secondary windongs consisted of 6 turns of 0.5 mm diameter enamelled copper wire laid on opposite sides of toroid. The transformer used in this prototype was described to have a bandwidth raged from 50 kHz to 17 MHz, which is more than adequate for an S/PDIF link.

The transformer should be fitted directly to the source and the receiving end must be protperly terminated for reliable operation. The reason for this is that the transformer input and output impedances are not exactly 75 ohm.

S/PDIF input circuits

The following circuits can be used to convert S/PDIF signals to TTL level signals which can be connected to any suitable output circuit or directly to digital electronics.

S/PDIF coax input circuit

 
ааааааааааааааааааа ааааааааааааааа+----10K--+аааааааааааааааааааааа 
аааааааааааааааааааааа10 nFааааааа |аааааааа |
аааааааааааааааааааааа ||ааааааааа |ааа |\аа |ааааааа |\
S/PDIF input ------+---||----100R--+----| O--+---+----| O----- TTL out
аааааааааааааааааа |аа ||ааааа ааааааааа|/аааааа |ааа |/
ааааааааааааааааа 75Rаааааааааааааааааааааааааа 10K
аааааааааааааааааа |аааааааааааааааа 74HCU04аааа |
ааааааааааааааааа ---аааааааааааааааааааааааааа ---

This circuit is part of circuit "Splitter for S/PDIF coax/optical output" by T. Giesberts from Elektor Electronics magazine July/August 1995 pages 78-79. The chip 74HCU04 is manufactured by Philips

Another input circuit

 
ааааааааааааааааааааааааааа +----10K----- +5V
ааааааа аааааааааааааааааааа|аааа /\ 
ааааааааааааааааааааааааааа---аааа |
аааааааааааааааааааа 4700 pFаааааа |ааа 
ааааааааааааааааааааааа||ааааааааа |ааа |\ааааааааааа |\
S/PDIF input ----------||----------+----| O-----------| O----- TTL out
(+/-500mV)ааааааааа ааа||аааааааааааааа |/ааааааааааа |/
аааааааааааааааааааааааааааааааааааааааааааа 
ааааааааааааааааааааааааааааааааааааааааа7404ааа 

The capacitor works as DC blocking capacitor. 10 kohm trimpot signal raises its ground potential to the point that Hex Inverter IC1 recognizes the difference between a digital 1 and 0 input. When you firt test the circuit then first addjust 10 kohm trimmer to the center and then adjust it so that the circuit receivers the S/PDIF signal well. If you have a voltmeter, you can adjust the trimpot to show around 2.6V at pin 1 of the IC. The inverter buffers the input and produces TTL 0-5V output signal. This circuit does not provivide the 75 ohm termination resistor, so you need to add it if you have problems because of cable signal reflections. This circuit is ppart of Coax Digital Out to MD circuit design.

Optical S/PDIF output circuit

Optical TOSLINK output

ааааааааааааааааааааааа ________________
аааааааааааааааа ааааа4|аааааааааааа ___|
 TTL signal -----------|ааааааааааа /
аааааааааааааааааааааа |аааааааааа |
ааааааааааааааааааааа 3|аааааааааа |
 +5V--4R7--+-----------|аааааааааа |
аааааааааа |ааааааааа 2|аа TOTX173 |
аааааааааа +---8k2-----|аааааааааа |
ааааааа ааа|аааааааааа |аааааааааа | 
аааааааааа=== 100 nFаа |аааааааааа |
аааааааааа |ааааааааа 1|ааааааааааа \___
аааааааааа +-----------|________________|
аааааааааа |ааааааааа 
аааааааааа---

The 4.7 ohm resistor and 100 nF capacitor make a filter against digital noise in +5V power source. The Toslink transmitting module used in this circuit is TOTX173 from Toshiba. This circuit is a part of circuit diagram from Elektor Electronics magazine issue 4/1997 page 65.

TORX173 and TOTX173 module pinouts

Toshiba optical receiver & transmitter modules used for S/P-DIF TORX173, TOTX173 top view:

ааа opto
аа +----+
а 6.ааа .5
аа +....+
ааа 1234аааааааа 
Pinа TORX173аааа TOTX173
1ааа outаааааааа GND
2ааа GNDаааааааа R
3ааа Vccаааааааа Vcc
4ааа GNDаааааааа in
5ааа case(GND)аа case(GND)
6ааа case(GND)аа case(GND)
 
Vccа +5V (use 0.1 uF decoupling to GND)
аааааааа (use 47 uH choke to connect Pin 3 to Vcc for TORX)
Rааа 8.2 kOhm to Vccаааааааааааааааааааааа 

TORX and TOTX are both high active and are CMOS/TLL logic compatible.

More information and datasheets is available at Toshiba optoelectronics components web page TOSLINK section.

Very cheap optical S/PDIF output

With TOSLINK modules available for as low as $10 it hardly seems worth it to bother with the trouble of making your own TOSLINK module due to the fact that the ones from Sharp have a built-in connector and are much easier to interface. But if you really want to make your own optical output interface, you can do it because S/PDIF optical (Toslink) transmitter is just basically a red LED coupled to the optical fiber. So to build a very basic output circuit you only need a red LED and a resistor, both available from any place where electronic components are sold.

The circuit is very simple:

аааааааааааааааааа _____
TTL signal -------|_____|---------+
ааааааааааааааааааааааааааааааааа |
аааааааааааааааааааааааааааааааа ---
ааааааааааааааааааааааааааааааааа Vа LED
аааааааааааааааааааааааааааааааа ---
ааааааааааааааааааааааааааааааааа |
ааа Ground -----------------------+

The idea of the circuit is that the digital data is fed through a series current limiting resistor to the LED (typically LEDs only require 5-30mA). A digital 0 is 0V and the LED is off. A digital 1 is +5V and the LED is on. That's it!

If for some reason the circuit does not work, try to change the LED and also try to connecting it better to the optical fiber. NOTE: Not all LEDs will work, so you may have to experiment a bit. Optimally, you want a high-brightness RED LED with a typical wavelength of 660nm.

If swapping the LED doesn't work, you might want to try using a hex inverter (7404 or similar IC) to buffer the signal. This might be good practice too, just in case the TTL SPDIF output of your source device isn't designed to handle a 20~30mA load this circuit generates.

Optical S/PDIF output circuit

Optical TOSLINK receiver

аааааа _____________
ааааа |___ааааааааа |1
ааааааааа \аааааааа |----------------- TTL output
аааааааааа |ааааааа |
аааааааааа |TORX173 |3
аааааааааа |ааааааа |----+----coil47uH----- +5V
аааааааааа |ааааааа |ааа |
аааааааааа |ааааааа |аа === 100 nF
аааааааааа |ааааааа |2аа |
аааааааааа |ааааааа |----+
аааааааааа |ааааааа |4аа |
аааааааааа |ааааааа |----+
аааааааааа |ааааааа |5аа |
аааааааааа |ааааааа |----+
аааааааааа |ааааааа |6аа |
ааа аааа__/аааааааа |----+
аааааа |____________|ааа |
ааааааааааааааааааааааа ---

The 47 microhenry coil and 100 nF capacitor make a filter against digital noise in +5V power source. The Toslink receiving module used in this circuit is TORX173 from Toshiba. This circuit is a part of circuit diagram from Elektor Electronics magazine issue 4/1997 page 66.

TORX173 and TOTX173 module pinouts

Toshiba optical receiver & transmitter modules used for S/P-DIF TORX173, TOTX173 top view:

ааа opto
аа +----+
а 6.ааа .5
аа +....+
ааа 1234аааааааа 
Pinа TORX173аааа TOTX173
1ааа outаааааааа GND
2ааа GNDаааааааа R
3ааа Vccаааааааа Vcc
4ааа GNDаааааааа in
5ааа case(GND)аа case(GND)
6ааа case(GND)аа case(GND)
 
Vccа +5V (use 0.1 uF decoupling to GND)
аааааааа (use 47 uH choke to connect Pin 3 to Vcc for TORX)
Rааа 8.2 kOhm to Vccаааааааааааааааааааааа 

TORX and TOTX are both high active and are CMOS/TLL logic compatible.

More information and datasheets is available at Toshiba optoelectronics components web page TOSLINK section.

 

Сайт создан в системе uCoz