Uart through an audio transformer

Any rules of thumb about sending a 9600 baud UARTsignal ,from an 8051 through a telecom type V90 audio transformer, (LT spice K L1 L2 1 @

4mH Rs = 10R) I only need about 8 bytes of data, and LTspice seems to need a square wave for about a millisecond before it settles down. So a long sync word of 010101 etc then a start byte? I'll pad the sig down to 100mV or so

martin

Reply to
Martin Griffith
Loading thread data ...

Are you trying to send a signal that has a DC level associated with it, like straight binary data? Capacitive coupling won't help either. You need to encode the signal so that there is net 0 DC on it.

Tam

Reply to
Tam

You can run the UART through the AC coupled channel. For the reasonable error immunity, the bandwidth of the channel should be at the least from

0.05 to 0.5 of the UART bit rate. You have to convert your data so it will be no DC in it. The simplest way is to transmit every byte twice: as it is and inverted. There are smarter ways to avoid DC such as encoding every six bits into eight bits or RLL coding; however quick and dirty repetition of every byte is good enough. Make sure the transformer is disconnected when the UART is in idle.

Vladimir Vassilevsky DSP and Mixed Signal Consultant

formatting link

Reply to
Vladimir Vassilevsky

And one solution would be to use biphase encoding:

formatting link

Or Manchester code, like used for Ethernet.

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

9600 baud is not exactly DC No it's the standard non inverted uart o/p, and a longish sq wave syncword, seems to be ok (in LTspice).

I've want to insert some bytes of data into an audio feed, only 8 bytes I'll solder it up tomorrow, but the audio transformers I've got at hand are much better than the V90 type, so I was just wondering.....

Let's see what I can get away with. I've even used the long forgotten

74hc4066 for switching all the signals around!

martin

Reply to
Martin Griffith

I'm already using Biphase in another part of the project, and this is converting it to uart speak, quite silly

martin

Reply to
Martin Griffith

Thanks for the BW tip, I'll try 4800 as well

I had a small piece of the pcb that was unpopulated, so it was time for a couple of extra features, like this

martin

Reply to
Martin Griffith

On a sunny day (Sat, 04 Oct 2008 23:07:31 +0200) it happened Martin Griffith wrote in :

The normal way is called 'modem', so in the simplest application you modulate some tone in the audio range (frequency shift). Can be anything, like connecting the UART output to a VCO,

74HC4046 will do, there are others that have sine output.
Reply to
Jan Panteltje

I'd thought of that, but "I'm doing a Joerg", very little PCB space left, basically a SO14 footprint for the 4066 and a few 0805's Basically a KISS job. If it doesn't work, I'll not put it in the spec, but it would be really great if it does work.

It's really nice writing my own specs :)

martin

Reply to
Martin Griffith

Huh? If a 0 is 0V, and a 1 is 3V, you have 1.5V of DC regardless of the Baud rate , assuming an equal number of 1, and 0.

Tam

Reply to
Tam

no, only partly DC. and that needs to be recovred.

if you have a clean signal on the input side run the output into a correctly biased schmitt trigger it should work, othewise a train of 0x00 or 0xFF could be problem as such a signal has a high DC content.

Bye. Jasen

Reply to
Jasen Betts

If you take steps to ensure the data will have an equal number of 0s and 1s that will work in all conditions not just ideal conditions,

one way would be to biphase encode the data you intend to send.

0 -> 0x55 1 -> 0x56 2 -> 0x59 3 -> 0x5A 4 -> 0x65 5 -> 0x66 6 -> 0x69 7 -> 0x6A 8 -> 0x95 9 -> 0x96 A -> 0x99 B -> 0x9A C -> 0xA5 D -> 0xA6 E -> 0xA9 F -> 0xAA

This will double the number of bytes you need to send, but as long as there are no pauses between the bytes the DC component will be eliminated. (in async the start bit is a 0 and the stop bit a 1 so they cancel out if the data is tightly packed)

biphase encoding like this will reduce the bandwidth if the signal over sending inverted bytes (it raises the lower bound), this may be useful. transmitting these at 9600baud the lower frequency bound will be 2400Hz and third harmonic of the higher frequency will be 14400Hz it will be good if the audio hardware can handle that range,

Bye. Jasen

Reply to
Jasen Betts

A more recent and more bandwidth-efficient way to do this is to use

8B/10B encoding. Each 8-bit byte is encoded into a 10-bit pattern, with the bits in the 10-bit pattern being chosen to ensure an acceptable degree of parity between 1-bits and 0-bits. In some cases, there are two different 10-bit patterns used to encode a single 8-bit input... the encoder chooses between them to help maintain the proper longer-term DC balance of the signal. Some of the 10-bit patterns which can be transmitted don't correspond to any 8-bit data value... these are used for purposes such as link synchronization and (I believe) error management. 8B/10B encoding has become quite popular these days (it's used for communication between computers and SATA hard drives, for instance). Since it has only a 20% overhead it's going to allow for faster communication than a 2:1 biphase-code expansion - it has only a 20% overhead in bandwidth.

I believe that its patent protection has lapsed and it's free for use. There are probably some open-source or public-domain implementations out on the net by now, I imagine.

--
Dave Platt                                    AE6EO
Friends of Jade Warrior home page:  http://www.radagast.org/jade-warrior
 Click to see the full signature
Reply to
Dave Platt

The DC offset needs to be handled.

(1) you can duck the whole issue: The simplest way to do this is to use "glitch code modulation". Run the RS-232 through a high pass filter so that it is only spikes on the edges. After the transformer, a Schmitt trigger can reconstruct it for you.

(2) You can restore the DC level Since RS232 is only two levels, you can pick off the positive and negative peaks and take the mid point between them as the "zero"

Reply to
MooseFET

The DC offset needs to be handled.

(1) you can duck the whole issue: The simplest way to do this is to use "glitch code modulation". Run the RS-232 through a high pass filter so that it is only spikes on the edges. After the transformer, a Schmitt trigger can reconstruct it for you.

(2) You can restore the DC level Since RS232 is only two levels, you can pick off the positive and negative peaks and take the mid point between them as the "zero"

************************************************************************************************* The T1 line gets around the problem by sending 1s as alternating + and - pulses. For instance 101110010 would be sent as +0-+-00+0. This is done for the whole serial bit stream, not on a per byte basis. Easy to do with a FF and CT transformer. BTW, the maximum DC that the small modem type transformer will take is around 2 ma. The little bitty ones won't even take that.

Tam

Reply to
Tam

Disconnect? T'is what capacitors were invented for. Well, that and a few other things.

--
Regards, Joerg

http://www.analogconsultants.com/
 Click to see the full signature
Reply to
Joerg

Not really if you are allowed to chuck the first state after power-on.

Yep, and those will nicely restore the signal. Of course not the first level after applying power before anything has been sent. If, for example, that was high and the Schmitt happens to sit in high then the whole thing won't work until after the first transition to low. Which should not be a problem in RS232. Usually tossing the first byte works if you have the right protocol.

Or clamp, if you have to.

--
Regards, Joerg

http://www.analogconsultants.com/
 Click to see the full signature
Reply to
Joerg

We did this years ago by having a receiver that included positive feedback through a low pass filter that matched the time constant of the transmitter HPF. AGC got hairy because it had to work off the peaks *after the DC restoration*. The active circuit was a comparator, not an opamp.

Tam

Reply to
Tam

Usually, to AC couple serial data, like 'through a transformer', one uses a modem.

Apple's old Appletalk used a Zilog 8530 SCC (serial communication controller) feature, the "FM1" mode, to make a good signal connection through transformer coupling, and lots of high-end SCC chips, with suitable differential transceivers, can do the same. This is a step up from a UART, but it's do-able in software.

That old 8530 chip, with a (?4) MHz clock, could run two channels at about 230 kbaud in FM1 mode; the old Macintosh could only keep up with the data from one, and that required full participation of the OS (i.e. a kernel-resident driver). Modes like FM1 that might be in a USART implementation include MFM, FM, FM1, FM2, RLL, X.25, etc...

The higher the frequency, the smaller/cheaper the transformer. Transmitter chips 26LS30, receivers 26LS32 or SN75175 are suitable. One sees this kind of trick in floppy and hard disk drives, too (and some of those same drivers in disk controllers), because the same issue arises in serial-to-magnetic media that you have in serial-to-transformer coupling.

Reply to
whit3rd

snip

Thats kinda how the IrDa works, ones are no light, zeros is a 3/16 or 4/16 bit "blink"

-Lasse

Reply to
langwadt

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.