Searching \ for '[PIC]: Would anyone understand...?please check' 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=pic
Search entire site for: 'Would anyone understand...?please check'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Would anyone understand...?please check'
2001\03\21@065000 by Jose S. Samonte Jr.

picon face
If my preamble sir Kevin is 10101010, at 1200 baud,
is this preamble reception algorithm right?


loop1   btfss  PORTC,7
       goto   loop1
       call   417us      ;halfbit delay
loop2   btfsc  PORTC,7
       goto   loop2
       call   833us      ;fullbit delay
loop3   btfss  PORTC,7
       goto   loop3
       call   417us      ;halfbit delay
loop4   btfsc  PORTC,7
       goto   loop4
       call   833us      ;fullbit delay
loop5   btfss  PORTC,7
       goto   loop5
       call   417us      ;halfbit delay
loop6   btfsc  PORTC,7
       goto   loop6
       call   833us      ;fullbit delay
loop7   btfss  PORTC,7
       goto   loop7
       call   417us      ;halfbit delay
loop8   btfsc  PORTC,7
       goto   loop8
       call   833us      ;fullbit delay


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

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


2001\03\21@071525 by Kevin Blain

flavicon
face
very nearly almost!!

you've almost got the right idea, but bear in mind (as in david's email)
that you will miss some of the preamble as the receiver is settling down.
therefrore think of preamble is a sequence, rather than a byte.

Because you don't know how long the receiver will take to settle, you won't
know how many bits of preamble there will be - but you can say whether it
will finish on a 0 or a 1, because you are setting that in the transmitter.

However, if you follow it through, it will wait for a 10 10 10 10 sequence,
true, but it will also allow the sequence 1100 1100 1100 1100 or 111000
111000 111000 111000 111000 with equal validity. You need to allow for if
its NOT what you were expecting after that delay, and treat it as an error.

You're almost got the right idea with the delay timing and stuff - it's
fairly primative, but it's simple and effective. - but why are you doing
different delays for 0 and 1? or is that just a cut and paste error?

If it helps, draw a 10101010.... squarewave pattern on a piece of paper, and
mark where you should be testing it - mark where you are currently testing
it too, and you will see that sometimes you end up testing it on the edges
rather than the levels.

Keep up the good work!

regards, Kevin


{Original Message removed}

2001\03\21@090614 by Jose S. Samonte Jr.

picon face
Hello, sir Kevin? =)


Kevin Blain <.....kevinbKILLspamspam@spam@WOODANDDOUGLAS.CO.UK> wrote:
very nearly almost!!

you've almost got the right idea, but bear in mind (as in david's email)
that you will miss some of the preamble as the receiver is settling down.
therefrore think of preamble is a sequence, rather than a byte.

Because you don't know how long the receiver will take to settle, you won't
know how many bits of preamble there will be - but you can say whether it
will finish on a 0 or a 1, because you are setting that in the transmitter.

However, if you follow it through, it will wait for a 10 10 10 10 sequence,
true, but it will also allow the sequence 1100 1100 1100 1100 or 111000
111000 111000 111000 111000 with equal validity. You need to allow for if
its NOT what you were expecting after that delay, and treat it as an error.

You're almost got the right idea with the delay timing and stuff - it's
fairly primative, but it's simple and effective. - but why are you doing
different delays for 0 and 1? or is that just a cut and paste error?

If it helps, draw a 10101010.... squarewave pattern on a piece of paper, and
mark where you should be testing it - mark where you are currently testing
it too, and you will see that sometimes you end up testing it on the edges
rather than the levels.

Keep up the good work!

regards, Kevin


{Original Message removed}

2001\03\21@121758 by Alice Campbell

flavicon
face
Jose, this isnt going to work.  The spacing has to be the
same for all the bits. You sample them all at the same rate,
and set your recieve register bits according to what you find
at each slice of time.

Take out a comb, like for your hair.  draw on a paper the
pattern for the preamble as black 'o' for on and space for
off.  Lay the comb over the pattern.  Anytime you see white
paper between the teeth, the bit is low.  anytime you see an
'o' the bit is set.  count the number of teeth set for a bit-
it will be one or two or three depending on how big you draw
the dots.  Same for the spaces. If you move the comb so that
the space between 2 teeth is in the middle of each bit, you
have the best chance to detect it.  You could even sample
each piece twice and check that both are the same before
deciding it is on or off.


how about something like this:
wait till 1/2 of a bit has gone by.
check the pin
if the pin is high, set bit #0 high in recieve register
If the pin is low, set bit #0 low in reciever register.
wait a FULL BIT LENGTH, minus the time for the test.
if the pin is now high, set bit #1 high in recieve register.
If the pin is low, set it low.
wait a FULL BIT LENGTH, minus the time for the test.
If you do this 8 times, your recieve register is stuffed with
the incoming byte.
Now you test the byte to see if it was the one you were
looking for.  if it was supposed to be a "U", does the
pattern match or not?  If it doesnt match, start over, maybe
it was just noise.
wait



{Quote hidden}

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


2001\03\21@123224 by David VanHorn

flavicon
face
>
>how about something like this:
>wait till 1/2 of a bit has gone by.
>check the pin
>if the pin is high, set bit #0 high in recieve register
>If the pin is low, set bit #0 low in reciever register.
>wait a FULL BIT LENGTH, minus the time for the test.

I did this for a UART in the F84, worked great.


--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

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


2001\03\21@180531 by Olin Lathrop

face picon face
>>
If my preamble sir Kevin is 10101010, at 1200 baud,
is this preamble reception algorithm right?


loop1   btfss  PORTC,7
       goto   loop1
       call   417us      ;halfbit delay
loop2   btfsc  PORTC,7
       goto   loop2
       call   833us      ;fullbit delay
loop3   btfss  PORTC,7
       goto   loop3
       call   417us      ;halfbit delay
loop4   btfsc  PORTC,7
       goto   loop4
       call   833us      ;fullbit delay
loop5   btfss  PORTC,7
       goto   loop5
       call   417us      ;halfbit delay
loop6   btfsc  PORTC,7
       goto   loop6
       call   833us      ;fullbit delay
loop7   btfss  PORTC,7
       goto   loop7
       call   417us      ;halfbit delay
loop8   btfsc  PORTC,7
       goto   loop8
       call   833us      ;fullbit delay
<<

This only guarantees you get the sequence with a certain minimum timing, but
not a maximum.  Why not use the built-in UART to do the
individual bit diddling?  I would set the transmitter to as many stop bits
as it can do.  Other people have already commented on how to keep the
average DC value near middle, and how to do a preamble to get the DC
detector started.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, @spam@olinKILLspamspamembedinc.com, http://www.embedinc.com

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


2001\03\21@192130 by Jose S. Samonte Jr.

picon face
When I power-up the receiver with the transmitter still off, I get
garbled characters on the LCD on the receiver?
How do I get rid of these? =(

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

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


2001\03\22@023146 by Peter Betts

picon face
> When I power-up the receiver with the transmitter still off, I get
> garbled characters on the LCD on the receiver?
> How do I get rid of these? =(

It means you are not correctly detecting errors in the received bit stream
from the receiver, this should prevent output from being fed to the LCD
unless a correct communications link is established.

Noise from the RF receiver shouldn't get through your bit sync detector, I
thought that was it's purpose?

A data device of some kind (PIC 1) is connected to the RF transmitter and so
only when this data device sends a sync word to the transmitter should the
data receiving device (PIC 2) connected to the RF receiver detect this and
begin outputting data on the LCD screen.

Check your sync detector again.

Pete

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


2001\03\22@081809 by Olin Lathrop

face picon face
>>
When I power-up the receiver with the transmitter still off, I get
garbled characters on the LCD on the receiver?
How do I get rid of these? =(
<<

The receiver must be picking up noise or stray signals.  This is common in
radio links.  You have to do something to your data stream so that the
receiver can distiguish between noise and valid data.  Try sending the data
in small packets that each have a checksum or signiture.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, TakeThisOuTolinEraseMEspamspam_OUTembedinc.com, http://www.embedinc.com

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


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