Searching \ for '[EE]: Radio preamble and uarts (16C550, 16C654)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16C
Search entire site for: 'Radio preamble and uarts (16C550, 16C654)'.

Exact match. Not showing close matches.
PICList Thread
'[EE]: Radio preamble and uarts (16C550, 16C654)'
2001\06\29@091425 by Bob Ammerman

picon face
<changed to [EE]:>

> >I am interfacing a cheap radio module to a processor via a standard
> >UART with buffer (actually a 16C654).
> >
> >Not by choice, though. The hardware was served in this way.
> >
> >The radio module is bandpass, 2kHz to 10kHz - so I can transmit
> >about 3 bits 111 or 000 before the fan belt hops off at 9600 baud.

I've thought about this a little.

Note: this answer is based on the following constraints and asssumptions.

We can never transmit more than 3 consecutive 0's or 1's.

START bits are the same condition on the line as a data bit of 0.

STOP bits are the same condition on the line as a data bit of 1.

Bit numbers within the data are from 0 (LSbit) to 7 (MSbit)

The bits are transmitted starting with the LSBit

We assume the receiving UART will detect a framing error and attempt to
resynchronize whenever it sees a zero where it is expecting the stop bit
(which should be a one).

We assume the receiving UART will start searching for a new start bit (0
state) immediately after the line returns to a 1 state after encountering a
framing error condition.

First, if we want to transmit a continuous alternating sequence of 0's and
1's we can do so by repeatedly transmitting the byte value 0x55 as a
preamble. This works because we send:

START BIT (0)
bit 0 (1)
bit 1 (0)
.
.
.
bit 6 (1)
bit 7 (0)
STOP BIT (1)

The receiving UART will nicely sync on this, but of course it could be
misaligned byte wise. There are 5 possible conditions:

Case A: The receive UART is properly aligned.

Case B: The receive UART is shifted 2 bit times
(bit 6 is being treated as the stop bit, bit 7 as the start bit)

Case C: The receive UART is shifted 4 bit times
(bit 4 is being treated as the stop bit, bit 5 as the start bit)

Case D: The receive UART is shifted 6 bit times
(bit 2 is being treated as the stop bit, bit 3 as the start bit)

Case E: The receive UART is shifted 8 bit times
(bit 0 is being treated as the stop bit, bit 1 as the start bit)

Now we have to come up with a way to convert the unaligned cases to the
aligned case by taking advantage of the way the UART detects framing errors.
We do this by transmitting a 0 data bit where the UART expects a stop bit (a
1).

The binary value B'01000100' will cause a framing error only in Cases C and
E above (because bits 4 and 0 are the wrong state for a stop bit). In Case
C, the UART will treat bit 7 as the next start bit, translating us to case
B. In Case E, the UART will then treat bit 3 as the next start bit,
translating us to case D.

The binary value B'00010001' will cause a framing error only in Cases B and
D above (because bits 6 and 2 are the wrong state for a stop bit). In Case
B, the UART will treat the start bit of the next byte as the next start bit,
translating us to Case A. In Case D, the UART will treat bit 5 as the next
start bit, translating us to Case C.

The binary value B'01000101' will cause a framing error only in Case C above
(because bit 4 is the wrong state for a stop bit). In this case the UART
will treat bit 7 as the next start bit, translating us to case B.

The binary value B'00010101' will cause a framing error only in Case B above
(because bit 6 is the wrong state for a stop bit). In this case the UART
will treat the start bit of the next byte as the next start bit, translating
us to Case A.

So, the transmitter could send:

Preamble of "N" bytes of 0x55

(at this point the receiver is in any of the 5 cases)

B'01000100'

(the receiver is in case A, B or D because we mapped C->B and E->D)

B'00010001'

(the receiver is in case A or C because we mapped B->A and D->C)

B'01000101'

(the receiver is in case A or B because we mapped C->B)

B'00010101'

(the receiver is in case A because we mapped B->A)

whew!!


Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\06\29@185708 by Dal Wheeler

flavicon
face
On this thought, there is a nice little article about this subject in the
July Circuit Cellar (#132) by Jeff Bachiochi.  He's interfaced a couple of
12c508's to some Ming Tx,Rx modules.

-Dal

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2001\06\30@042700 by spam

flavicon
face
Wow, Bob -

I feel I should send you cruise tickets or pay Leonard Cohen to
write a song about you.
That train of thoughts ran me off the tracks a couple of time when I
tried it.

And you know what - your approach actually works.

The method I experimented my way to is to send 4 x 0x22 - it was
mentioned in an application note. But It only gives me correct sync
about half of the times.
I have googled and yahooed a lot the last couple of days and I am
sure this method is unique.

It is hereafter named

"Ammerman Synchronization"


Thanks,
Kent



{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2001\06\30@082256 by Bob Ammerman

picon face
{Quote hidden}

Kent,

Thanks for the compliments. Sometimes to attack a problem you have to go
back to the underlying first principles.

You might be amused to know that I never tested this before posting it ;-)

Also, since posting it, I have found no less than 2 applications for it
within projects I have worked on / am working on.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)s

{Quote hidden}

asssumptions.
{Quote hidden}

encountering a
> > framing error condition.
> >
> > First, if we want to transmit a continuous alternating sequence of 0's
and
{Quote hidden}

errors.
> > We do this by transmitting a 0 data bit where the UART expects a stop
bit (a
> > 1).
> >
> > The binary value B'01000100' will cause a framing error only in Cases C
and
> > E above (because bits 4 and 0 are the wrong state for a stop bit). In
Case
> > C, the UART will treat bit 7 as the next start bit, translating us to
case
> > B. In Case E, the UART will then treat bit 3 as the next start bit,
> > translating us to case D.
> >
> > The binary value B'00010001' will cause a framing error only in Cases B
and
> > D above (because bits 6 and 2 are the wrong state for a stop bit). In
Case
> > B, the UART will treat the start bit of the next byte as the next start
bit,
> > translating us to Case A. In Case D, the UART will treat bit 5 as the
next
> > start bit, translating us to Case C.
> >
> > The binary value B'01000101' will cause a framing error only in Case C
above
> > (because bit 4 is the wrong state for a stop bit). In this case the UART
> > will treat bit 7 as the next start bit, translating us to case B.
> >
> > The binary value B'00010101' will cause a framing error only in Case B
above
> > (because bit 6 is the wrong state for a stop bit). In this case the UART
> > will treat the start bit of the next byte as the next start bit,
translating
{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2001\06\30@123450 by spam

flavicon
face
Bob, you are most welcome.

I love when I can do that exact thing to my clients.
I once had a company ask me what to do about a small pen-
shaped device that measured blood coagulation. Everything was
finished, including plastic casting tools.
It involved an LED and a photo transistor that would detect when
the blood coagulated in a small capillary tube.

Now of course the prototype was made in aluminum and kept the
LED's nice and cool. The plastic version measured with great
accuracy when the LED was hot enough to give the same drop in
signal as coagulation.....
Available room for solution: 2 cubic mm.
Solution : one SMD resistor in parallel with the LED.
When the LED gets hot, the voltage over the diode falls and less
current is diverted through the resistor.
And the runaway-effect was too slow to interfere.

Easier than their suggestion involving a semi-transparent mirror,
new plastic tools, an extra photo transistor and new electronics.

It is those Da Vinci moments that makes it real fun...

Kent

> Thanks for the compliments. Sometimes to attack a problem you have to go
> back to the underlying first principles.
>
> You might be amused to know that I never tested this before posting it ;-)
>
> Also, since posting it, I have found no less than 2 applications for it
> within projects I have worked on / am working on.

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...