Searching \ for '[PIC]: Sample serial data' 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/ios.htm?key=serial
Search entire site for: 'Sample serial data'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Sample serial data'
2001\04\04@211946 by Wan Hasmi

flavicon
face
Hi all,

Does anyone know how to capture serial single line data(such as from IR sensor eg:GP1U7) into any I/O pin of PIC16F84? do i need to use the TMR0? or maybe poll the pin using btfss/btfsc?

thanks

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\04\05@115402 by Alice Campbell

flavicon
face
polling pins works for me.  It helps to have some idea what
your pulse looks like.  If its from a serial port, and you
know the baudrate, then just sample about in the middle of
where the bit is.  If youre not that easily satisfied, sample
twice.  If youre cautious, sample three times per bit.  If
youre paranoid, sample 8 times and vote for on and off.  This
only works if you have plenty of cycles per bit and you dont
have much to do during the time beteween bits.  If you are
really busy and can only check the port while doing other
things, use TMR0 and check out in the middle of the bit when
youre sure you are not too near an edge.

alice

{Quote hidden}

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


2001\04\05@213504 by Wan Hasmi

flavicon
face
thanks Alice..

actually I've built a 10 digit digital counter using PIC16F84 and display it
on LCD module. and I connect the output from the IR module to one of the PIC
I/O pin and monitor the pulse count on the counter. When I try position my
remote control unit with a keypress facing to the IR module, the counter
indicates incoming pulses and automatically increment the counter.
I notice that when I randomly pressed any key, the increment rate is the
same.
As a conclusion, how do we differentiate which key was pressed if we sample
the I/O pin on PIC? looking at this experiment result, the longer i pressed
the key, more pulses will be generated. this is more confusing to me..
any help please...

thanks

{Original Message removed}

2001\04\05@234756 by Jinx

face picon face
> As a conclusion, how do we differentiate which key was
> pressed if we sample the I/O pin on PIC? looking at this
> experiment result, the longer i pressed the key, more pulses
> will be generated. this is more confusing to me

The stream of pulses from the key needs to be encoded before
transmission. You could either send key presses to a micro to
code them (generate a unique sequence for each key) or use
hardware such as 4051/4520 multiplexing then send the resulting
codes to the transmitter stage. If you have a micro driving the
transmitter side, send just three copies of the data for a key,
unless you happen to want key repeats. You could add a time
delay before repeating kicks in (like a PC keyboard) so that
the initial keypress is sent, but the key has to remain down a
little longer before it starts repeating

Some IR transmitters use pulse distance coding and constant-
duration pulses, in which a "0" is say 1ms, "1" is 2ms and a pulse
is 500us. So the code "010" would be seen as

(500us pulse) (0V for 1ms) (500us pulse) (0V for 2ms) (500us
pulse) (0V for 1ms) (500us pulse)

Look for the end of a pulse and start a counter. Test the counter
contents at the start of the next pulse. It will a particular value for
a "0" length of space and another for a "1" length of space. The
code is generated at the transmitter by the same process, perhaps
use a TMR IRQ for consistency

--
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\04\06@201120 by Dan Michaels

flavicon
face
part 1 1012 bytes content-type:text/plain; charset="us-ascii"Forwarded for Alice Campbell --------

{Quote hidden}


part 2 8302 bytes content-type:image/gif; name="REMOTE.GIF"; (decode)


part 3 105 bytes
--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


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