Electronics-Related.com
Forums

Uart through an audio transformer

Started by Martin Griffith October 4, 2008
On 2008-10-04, Martin Griffith <mart_in_medina@yah00.es> wrote:
> On Sat, 4 Oct 2008 16:50:35 -0400, in sci.electronics.design "Tam" ><t-tammaru@comcast.net> wrote: > >> >>"Martin Griffith" <mart_in_medina@yah00.es> wrote in message >>news:j8jfe4d1mv1qgb3bhmf10fqr8ltnuotrhm@4ax.com... >>> 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 >>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
> 9600 baud is not exactly DC
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
On 2008-10-05, Tam <t-tammaru@comcast.net> wrote:

>>>Tam >> 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). >> > 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
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
In article <gca2qb$11o$1@gonzo>, Jasen Betts  <jasen@xnet.co.nz> wrote:

>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.
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 <dplatt@radagast.org> AE6EO Friends of Jade Warrior home page: http://www.radagast.org/jade-warrior I do _not_ wish to receive unsolicited commercial email, and I will boycott any company which has the gall to send me such ads!
On Oct 4, 1:26=A0pm, Martin Griffith <mart_in_med...@yah00.es> wrote:
> 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 =3D 10R) > I only need about 8 bytes of data, and =A0LTspice 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
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"
"MooseFET" <kensmith@rahul.net> wrote in message 
news:32fda7c9-35ea-4d94-a64f-6c2f2955d5e7@i24g2000prf.googlegroups.com...
On Oct 4, 1:26 pm, Martin Griffith <mart_in_med...@yah00.es> wrote:
> 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
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
Vladimir Vassilevsky wrote:
> "Martin Griffith" <mart_in_medina@yah00.es> wrote in message > news:j8jfe4d1mv1qgb3bhmf10fqr8ltnuotrhm@4ax.com... >> 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 > > 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. >
Disconnect? T'is what capacitors were invented for. Well, that and a few other things. -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.
MooseFET wrote:
> On Oct 4, 1:26 pm, Martin Griffith <mart_in_med...@yah00.es> wrote: >> 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 > > The DC offset needs to be handled. >
Not really if you are allowed to chuck the first state after power-on.
> (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. >
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.
> (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" >
Or clamp, if you have to. -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.
"Joerg" <notthisjoergsch@removethispacbell.net> wrote in message 
news:QOcGk.2363$x%.308@nlpi070.nbdc.sbc.com...
> MooseFET wrote: >> On Oct 4, 1:26 pm, Martin Griffith <mart_in_med...@yah00.es> wrote: >>> 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 >> >> The DC offset needs to be handled. >> > > Not really if you are allowed to chuck the first state after power-on. > > >> (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. >> > > 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. > > >> (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" >> > > Or clamp, if you have to. >
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
> -- > Regards, Joerg > > http://www.analogconsultants.com/ > > "gmail" domain blocked because of excessive spam. > Use another domain or send PM.
On Oct 4, 1:26=A0pm, Martin Griffith <mart_in_med...@yah00.es> wrote:
> Any rules of thumb about sending a 9600 baud UARTsignal ,from an 8051 > through a telecom type V90 audio transformer
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.
On 6 Okt., 00:50, "Tam" <t-tamm...@comcast.net> wrote:
> "MooseFET" <kensm...@rahul.net> wrote in message > > news:32fda7c9-35ea-4d94-a64f-6c2f2955d5e7@i24g2000prf.googlegroups.com... > On Oct 4, 1:26 pm, Martin Griffith <mart_in_med...@yah00.es> wrote: > > > 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 > > 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.
snip
>
Thats kinda how the IrDa works, ones are no light, zeros is a 3/16 or 4/16 bit "blink" -Lasse