Searching \ for '[PIC]: IR receiver code' 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=ir
Search entire site for: 'IR receiver code'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: IR receiver code'
2001\02\27@191752 by Ray Bieze

flavicon
face
I would like to take IR data from a Panasonic TV remote and store it in memory for subsequent serial transmission.  I'm having real problems with the timing and working out the port change interrupts.  Can anyone help?

Thanks

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\27@205742 by Drew Vassallo

picon face
>I would like to take IR data from a Panasonic TV remote and store it in
>memory for subsequent serial transmission.  I'm having real problems with
>the timing and working out the port change interrupts.  Can anyone help?

There is some IR code out there, check the PICLIST library/archives; I
haven't really looked at it.  I think it was for a SONY brand remote - for a
CD player or something similar.

PLEASE don't tell me you're using the PORTB "interrupt on change" feature
for multiple interrupts.  You'll be sorry :)

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\28@031147 by Giorgio De Nunzio

flavicon
face
> PLEASE don't tell me you're using the PORTB "interrupt on change" feature
> for multiple interrupts.  You'll be sorry :)
>
> --Andrew

Hi all! I am a PIC newbie, and I am just studying data sheets and the
like.
I am curious about your statement, Andrew. Can you please tell me more
about the problems involved in PORTB interrupt on change?
I was just reading a manual page about "interrupt on change" when your msg
was delivered to my box..!

Thanks!
Ciao
Giorgio

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


2001\02\28@032509 by Vasile Surducan

flavicon
face
Well, I am using interrupt on change, and I'm not sorry...
But what do you mean by multiple interrupts ?
Vasile

On Wed, 28 Feb 2001, Giorgio De Nunzio wrote:

{Quote hidden}

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


2001\02\28@081636 by Drew Vassallo

picon face
>I am curious about your statement, Andrew. Can you please tell me more
>about the problems involved in PORTB interrupt on change?
>I was just reading a manual page about "interrupt on change" when your msg
>was delivered to my box..!

In brief, the PORTB interrupt on change feature is not intended for use as a
general purpose multiple interrupt source.  This is because you can affect
the PORTB status with ANY operation that accesses ANY bit on the port
(though I'm not sure about "movf", but I would assume so because the port is
read).

From the 16C71 datasheet:

"This interrupt on mismatch feature, together with soft-
ware configurable pull-ups on these four pins allow
easy interface to a keypad and make it possible for
wake-up on key-depression. Refer to the Embedded
Control Handbook, "Implementing Wake-Up on Key
Stroke" (AN552).
The interrupt on change feature is recommended for
wake-up on key depression operation and operations
where PORTB is only used for the interrupt on change
feature. Polling of PORTB is not recommended while
using the interrupt on change feature.
Note: For the PIC16C71
if a change on the I/O pin should occur
when the read operation is being executed
(start of the Q2 cycle), then interrupt flag bit
RBIF may not get set."

I feel that Microchip doesn't make as big a deal out of this as they should.
 They simply say "polling of PORTB is not recommended."  If you use this
feature as they suggest, for wake up on keypad input, then you can use the
interrupt feature during sleep and disable the interrupts during polling,
which would work great.  If you don't use it for this purpose, but instead
try to use it for multiple general purpose interrupts while using the
remaining PORTB pins for other purposes, you will invariably run into a heap
of trouble trying to track down why your interrupts are working "more often
than not, but not always."

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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


2001\02\28@094509 by s.m.brady

picon face
But this interrupt on change is only valid for pins configured as inputs.

I have implemented portB with inputs and outputs, the inputs configured "to
interrupt on change" as i require, I am monitoring for stray interrupts
(using leds) and so far, emphasis on so far no random problems/errors,

Sharon

{Original Message removed}

2001\02\28@095927 by Alan B. Pearce

face picon face
>But this interrupt on change is only valid for pins configured as inputs.

>I have implemented portB with inputs and outputs, the inputs configured "to
>interrupt on change" as i require, I am monitoring for stray interrupts
>(using leds) and so far, emphasis on so far no random problems/errors,

The problem is that any instruction that writes to the output bits of the port
also does an inherent read of the port as well. If the input bits of the port
happen to change while this output instruction is in progress, then you will
have a missed interrupt.

I have not actually had occasion to use this function, but someone posted some
test code here a while back to prove that the situation exists. It is also not
explained that well in the Microchip documentation, (in case it looks like an FU
by them I think) which is why some of the other comments in this thread.

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


2001\02\28@101005 by Drew Vassallo

picon face
>I have implemented portB with inputs and outputs, the inputs configured "to
>interrupt on change" as i require, I am monitoring for stray interrupts
>(using leds) and so far, emphasis on so far no random problems/errors,

As I said, if you want to use them as general interrupts, disabling them
during portions of the code that use PORTB I/O and re-enabling them during
portions that don't use PORTB access, that's fine.  The only problem with
this is that for many people, trying to isolate portions of the code that
allow interrupt on change from portions that use PORTB for I/O (can't allow
interrupt on change) is very tough.  That's not to say it can't be done, but
unless you're really desperate for interrupt sources and have your code
sectioned off safely, you might as well poll the lines rather than try to
use the interrupts.

For example, if you have PORTB interrupt on change enabled for RB<4:7> and
somewhere in your code you proceed to set RB<2> (output), the entire port
gets read, bit 2 latch is set, and the entire port is written.  During the
read cycle (Q2), if one of your interrupt pins detects a change, it will be
ignored because the PORTB read is in process and the latches are re-written
with the new value.  So, the interrupt on change comparison shows "no
change."

From the 16C71 datasheet again:

"Note: For the PIC16C71
If a change on the I/O pin should occur
when the read operation is being executed
(start of the Q2 cycle), then interrupt flag bit
RBIF may not get set."

Granted, I'm not sure if this note applies to ALL PICs, but it should be
noted anyways.  I can't imagine the bug would only exist on the 'C71 since
the same architecture is used for PORT I/O.  The 'F876 datasheet also
cautions against polling PORTB during int. on change enable.  It also
references Microchip's AN552, which may contain more information.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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


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