Searching \ for '[PIC]: Building an IR remote' 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: 'Building an IR remote'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Building an IR remote'
2002\09\27@221108 by Byron A Jeff

face picon face
For my "Poor Man's TIVO" project I'd like to build a serial controlled IR
transmitter, I've already seen a couple of useful projects, including a
16F84 based serial port controlled transmitter, but just to sharpen some
programming skills (real rusty) I want to roll my own.

My basic game plan is to modulate the hardware PWM of a 16F628 and accept
commands via the hardware USART. The USART is pretty easy due to Fr. McGahee's
PICUART code and the Midrange manual and datasheet spell out the PWM for the
most part. However I did have one question on the PWM output and one on the
IR LED driver.

PWM: Both the midrange manual and the datasheet state:

  "Since the CCPx pin is multiplexed with the PORT data latch, the
   corresponding TRIS bit must be cleared to make the CCPx pin an output."

This makes perfect sense. However it is unclear if the TRIS bit is set that
that pin will in fact be turned into an input. It's implied but never stated.
Is that the case? If so then I can modulate the PWM simply by flipping the
TRIS bit.

IR DRIVER: I plan on using a standard NPN transistor to drive the IR LED.
a 1K base resistor should be fine for driving a 2N2222 into full saturation
under normal circumstances. However since I plan to float the base should I
use a pulldown resistor on the base also? What value would be appropriate if
so?

The absolute max current for the hideously expensive IR LED I got from the
RatShack specifies a 100ma max current. I plan to drive it at 80ma using a
47 ohm current limiting resistor.

Anyway if anyone has answers or other ideas I'd love to hear them.

BAJ

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


2002\09\27@222816 by Wagner Lipnharski

flavicon
face
Byron A Jeff wrote:
> For my "Poor Man's TIVO" project I'd like to build a serial
> controlled IR
> transmitter, I've already seen a couple of useful projects,
including
{Quote hidden}

never
{Quote hidden}

10 kOhms between base and emitter should cut the NPN when contol is
floatting.
When driving, the voltage divided will still be able to drive the NPN.
If the IR Diode forward voltage is less than 2.5V, you could double
transmission power, by using two diodes in series, of course reducing
the Rx value for the appropriate current.


               o +5V
               |
               Rx
               |
              _V_  IR.D1
               |
              _V_  IR.D2
               |
               C
o--R1k---o-----B
        |      E
      R10k     |
        |      |
       _|_    _|_



If you need some support for the IR modulation and codes, even
examples for any uC coding, check my webpage, I made some text for
different remote brands. http://www.ustr.net


/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Wagner Lipnharski - UST Research Inc
Orlando FLorida - USA - http://www.ustr.net
/_/_/_/ Atmel AVR Consultant /_/_/_/

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


2002\09\27@224932 by Tom Messenger

flavicon
face
Wagner wrote:

>10 kOhms between base and emitter should cut the NPN when contol is
>floatting.
>When driving, the voltage divided will still be able to drive the NPN.

Of course, Wagner meant to say that the current is divided, not the voltage
since the base emitter junction will clamp the 10K to .6 volts.  The
difference is that now you supply the transistor base current plus .6V/10k
or 60uA extra.

What you will need to verify here is whether the 10k turns the device off
fast enough. You didn't mention operating frequency, I think.  At "low"
freqs, 10K is fine. At "high" freqs, 10K is an open. You are probably
working around, lemme guess, 38-40khz? this will be right where these
effects begin to take place so check it out with a scope. If it doesn't
turn off fast enough, change the 10k to something a bit lower. If your base
voltage is .6V, then a 1k will only need 600uA.

The deal here is that for quick operation, both your drive resistor and the
turn off resistance need to be checked to verify that they are doing their
jobs.

Hope this helps rather than confuses you. Good luck.
Tom M.

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


2002\09\27@232036 by Wagner Lipnharski

flavicon
face
Tom Messenger wrote:
> Wagner wrote:
>
>> 10 kOhms between base and emitter should cut the NPN when contol is
>> floatting.
>> When driving, the voltage divided will still be able to drive the
>> NPN.
>
> Of course, Wagner meant to say that the current is divided, not the
> voltage
> since the base emitter junction will clamp the 10K to .6 volts.  The
> difference is that now you supply the transistor base current plus
> .6V/10k
> or 60uA extra.


I meant Voltage divider before VBE reaches 0.6V... but you are correct
after that, current divider.


>
> What you will need to verify here is whether the 10k turns the
device
> off
> fast enough. You didn't mention operating frequency, I think.  At
> "low"
> freqs, 10K is fine. At "high" freqs, 10K is an open. You are
probably
> working around, lemme guess, 38-40khz? this will be right where
these
{Quote hidden}

I think he said the pull-down resistor will ONLY take effect when the
PIC will stop controlling the transistor and enter in high impedance
output, leaving the transistor alone.  I think that during the
transistor 38kHz modulation, he will supply both Hi and Low logic to
the 1k resistor, so, the 10k resistor will only hold the transistor
off during the time the PIC is not controlling it anymore.

/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Wagner Lipnharski - UST Research Inc
Orlando FLorida - USA - http://www.ustr.net
/_/_/_/ Atmel AVR Consultant /_/_/_/

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


2002\09\27@232041 by Byron A Jeff

face picon face
On Fri, Sep 27, 2002 at 07:47:58PM -0700, Tom Messenger wrote:
> Wagner wrote:
>
> >10 kOhms between base and emitter should cut the NPN when contol is
> >floatting.
> >When driving, the voltage divided will still be able to drive the NPN.
>
> Of course, Wagner meant to say that the current is divided, not the voltage
> since the base emitter junction will clamp the 10K to .6 volts.  The
> difference is that now you supply the transistor base current plus .6V/10k
> or 60uA extra.

Right.

>
> What you will need to verify here is whether the 10k turns the device off
> fast enough. You didn't mention operating frequency, I think.  At "low"
> freqs, 10K is fine. At "high" freqs, 10K is an open. You are probably
> working around, lemme guess, 38-40khz? this will be right where these
> effects begin to take place so check it out with a scope. If it doesn't
> turn off fast enough, change the 10k to something a bit lower. If your base
> voltage is .6V, then a 1k will only need 600uA.

Of course it's 40khz as that's the standard freqency.

Lowering the resistance seems like a good idea and will suck down very little
current over that 0.6V drop. For starters I think I'll do a 470 series with
a 2.2k pulldown. That'll feed the transistor nearly 10ma of current which
will drive it into hard saturation and give the 2.2k the 272uA of current
with no problem.

>
> The deal here is that for quick operation, both your drive resistor and the
> turn off resistance need to be checked to verify that they are doing their
> jobs.
>
> Hope this helps rather than confuses you. Good luck.

It helps a lot. No confusion whatsoever.

Thanks,

BAJ

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


2002\09\27@232048 by =?iso-8859-1?Q?F=E1bio_Pereira?=

flavicon
face
I agree with you Byron, it you look at the RB3 pin diagram you will see that
setting the tris register to 1 will shutdown both output mosfets and since
they are used by the pwm output too, no signal will appear at the pin
output.

Fabio

{Original Message removed}

2002\09\27@232608 by Byron A Jeff

face picon face
> [deleted for brevity ]

> 10 kOhms between base and emitter should cut the NPN when contol is
> floatting.
> When driving, the voltage divided will still be able to drive the NPN.
> If the IR Diode forward voltage is less than 2.5V, you could double
> transmission power, by using two diodes in series, of course reducing
> the Rx value for the appropriate current.

Good idea! I'll do that.

> If you need some support for the IR modulation and codes, even
> examples for any uC coding, check my webpage, I made some text for
> different remote brands. http://www.ustr.net

Great pages! I already took a look and the Hitachi protocol, which is my
initial target is quite well explained.

Thanks,

BAJ

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


2002\09\27@233952 by Andy Kunz

flavicon
face
>Of course it's 40khz as that's the standard freqency.

Almost all that I've worked with for 10 years, Panasonic, Sony, QVC, NEC,
and numerous off-brands, have been 38 kHz with a 40-ish percent duty cycle.

Andy

-------------------------------------------------------------------
Race Boats  - @spam@andyKILLspamspamRC-Hydros.com      http://www.RC-Hydros.com
Airplanes   - KILLspamandyKILLspamspamFlyingHobbies.com  http://www.FlyingHobbies.com
Electronics - RemoveMEandyTakeThisOuTspamMontanaDesign.com  http://www.MontanaDesign.com
-------------------------------------------------------------------

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


2002\09\28@004020 by Wagner Lipnharski

flavicon
face
Byron A Jeff wrote:
>> [deleted for brevity ]
>
>> 10 kOhms between base and emitter should cut the NPN when contol is
>> floatting.
>> When driving, the voltage divided will still be able to drive the
>> NPN. If the IR Diode forward voltage is less than 2.5V, you could
>> double transmission power, by using two diodes in series, of course
>> reducing the Rx value for the appropriate current.
>
> Good idea! I'll do that.
>
>> If you need some support for the IR modulation and codes, even
>> examples for any uC coding, check my webpage, I made some text for
>> different remote brands. http://www.ustr.net
>
> Great pages! I already took a look and the Hitachi protocol, which
is
> my
> initial target is quite well explained.
>
> Thanks,
>
> BAJ


Byron, two other things to include in the "try and buy" bench tests;

1) You can try to change the control logic symmetry to the transistor.
Sometimes you get further control distance by finding the best
symmetry, 50/50, 45/55, 40/60. Sometimes the room reflects so much IR
and it keeps bouncing that it is better to reduce the ON time to 48,
45 or lower%, so the receiver can better "discriminate" IR from non
IR.  Sometimes the transistor or the LEDs are lazy enough to reduce by
themselves this On/Off symmetry, so you need to increase the ON time
at the uC, to compensate.

2) If you have more uC port pins available, you could tie several of
them together and sink the IR diodes directly, without any transistor.
I made several CNC remote control using to tie 5 AVR port pins and
direct drive the diodes, it works perfectly, and you save the
transistor and two resistors.


---.           o +5V
  |           |
A |----.     _V_-> IR.D1
  |    |      |
B |----o     _V_-> IR.D2
  |    |      |
C |----o      |
  |    |      R
D |----o      |
  |    |      |
E |----o------'
  |
---'

A very small capacitor in parallel with the current limiting resistor,
can improve the diodes "turn on".  At 38kHz, a 1nF capacitor offers an
impedance of 4200 Ohms, so, at least fast 1mA will be via the cap.
If you have a scope, you can find the best cap, not big enough to blow
up the uC port pins...  A way to see that is installing an extra
resistor of very low value (shunt) and scope the Vdrop. The High Vdrop
positive pulse will tell you the relative current.  When you find the
best cap, then you can remove the shunt resistor



---.           o +5V
  |           |
A |----.     _V_-> IR.D1
  |    |      |
B |----o     _V_-> IR.D2
  |    |      |
C |----o      o----.
  |    |      |    |
  |    |      R   === 1nF
D |----o      |    |
  |    |      |    |
E |----o--R---o----o---> Scope
  |      1 Ohm
---'      Shunt



5V----.        .-----
     |        |
Cap > '-.      |
Peak    |      |
knee    |      |
       |      |
       '-----.|
0V             '

CapPeakV / 1 Ohm = Current


As an extra "tip", try to use metal film resistors from now on. They
cost a little more (will not hurt the pocket), they are not carbon
coiled around the body, so metal film does not create "inductance" for
higher frequencies.  I use to buy 1% metal film from Digikey at
$6/package of 200 units, not bad at all, and they also have lower ppm,
what suffer less changes in resistance based on temperature changes.


/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Wagner Lipnharski - UST Research Inc
Orlando FLorida - USA - http://www.ustr.net
/_/_/_/ Atmel AVR Consultant /_/_/_/

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


2002\09\28@012834 by Russell McMahon

face
flavicon
face
> The absolute max current for the hideously expensive IR LED I got from the
> RatShack specifies a 100ma max current. I plan to drive it at 80ma using a
> 47 ohm current limiting resistor.

V= .080 * 47 = 3.8v across the resistor leaving 1.2v for LED and transistor.
May or may not be correct depending on LED.

A safer and more flexible (and hardly any dearer) method is to use the
mickey_mouse_constant_current scheme I mentioned recently. Place LED in
collector and resistor in emitter. Iresistor = (Vin-0.6)/R which is the max
current that the LED in the collector circuit can see. This only works
"properly" if the LED has more operating voltage available than Vin. This
will be the case if you operate the PIC from a regulator and supply the LED
from the regulator input OR if you divide the Vin drive signal from the PIC.
eg Say PIC drive = 4.8v. Drive base from PIC via 2k2 to base and 1k base to
ground. Vbase-gnd max = 1.5v so Vemitter = 0.9v. If Remitter_ground = 12r
then  Ir = 75 mA (approximately of course :-) ). Adjust R or base divider to
vary current of the constant current source.

The LED and transistor then have about 4v headroom if driven from a 5v
supply. The beauty of this scheme is that it automatically compensates for
variations with LED forward voltage with type and current. A white LED with
Vf or around 3v will be driven at the same current as a red LED with a Vf of
under 2 volt. The maximum base drive to the transistor here is (4.8-1.5)/2k2
= 1.4mA. This implies a required beta of about 60 but alas tis not so as the
1k shunts all of this. As the base voltage sags more will be available for
the transistor. A beta of 200+ (eg BC337 etc) would be advised.

A better arrangement which leads to a much stiffer current source is to
replace the 1k with a zener or diode string. eg 2k2 PIC to base, 3 x 1N4148
in series from base to ground (cathodes towards ground).

All the above "playing" with a divider is avoided if the LED has a voltage >
Vdd to drive it.



       Russell McMahon

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


2002\09\28@043916 by Byron A Jeff

face picon face
On Fri, Sep 27, 2002 at 11:08:11PM -0400, Wagner Lipnharski wrote:
{Quote hidden}

Right.

>  I think that during the
> transistor 38kHz modulation, he will supply both Hi and Low logic to
> the 1k resistor, so, the 10k resistor will only hold the transistor
> off during the time the PIC is not controlling it anymore.

That's correct too. I took the question to mean would there be a problem
turning off the transistor fast enough at the end of a burst.

BAJ

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


2002\09\28@043931 by Byron A Jeff

face picon face
On Fri, Sep 27, 2002 at 11:37:33PM -0400, Andy Kunz wrote:
> >Of course it's 40khz as that's the standard freqency.
>
> Almost all that I've worked with for 10 years, Panasonic, Sony, QVC, NEC,
> and numerous off-brands, have been 38 kHz with a 40-ish percent duty cycle.

Well that's what I'll use for testing then.

Thanks for the info.

BAJ

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


2002\09\28@044953 by Byron A Jeff

face picon face
On Sat, Sep 28, 2002 at 12:08:30AM -0400, Wagner Lipnharski wrote:
> Byron A Jeff wrote:
> >> [further deleted for brevity ]
>
>
> Byron, two other things to include in the "try and buy" bench tests;
>
> 1) You can try to change the control logic symmetry to the transistor.
> Sometimes you get further control distance by finding the best
> symmetry, 50/50, 45/55, 40/60. Sometimes the room reflects so much IR
> and it keeps bouncing that it is better to reduce the ON time to 48,
> 45 or lower%, so the receiver can better "discriminate" IR from non
> IR.  Sometimes the transistor or the LEDs are lazy enough to reduce by
> themselves this On/Off symmetry, so you need to increase the ON time
> at the uC, to compensate.

Shouldn't be a problem in this instance as the remote I'm building will
literally be 4 inches in front of the receiver.

{Quote hidden}

Then it becomes a choice between cost and convenience. While my initial design
does cost a transistor and a couple of resistors, I get the convenience of
set and forget PWM operation. Once I configure the PWM module for 38 Khz
operation, I don't need to keep track of it at all anymore in my code. With
your suggestion I'd actually have to code the oscillator.

I'm looking for design speed here. So I'll happily add a couple of pieces of
hardware to save quite a bit of coding.

>
> A very small capacitor in parallel with the current limiting resistor,
> can improve the diodes "turn on".  At 38kHz, a 1nF capacitor offers an
>  impedance of 4200 Ohms, so, at least fast 1mA will be via the cap.
> If you have a scope, you can find the best cap, not big enough to blow
> up the uC port pins...  A way to see that is installing an extra
> resistor of very low value (shunt) and scope the Vdrop. The High Vdrop
> positive pulse will tell you the relative current.  When you find the
> best cap, then you can remove the shunt resistor

I'll test this if I have problems transmitting.

This project is kind of weird as I'm not really trying to build a remote for
remote operations, but a remote as input/controller to the device. So the
normal effects of wall bouncing and distance aren't the real issues here.

> [Example deleted for brevity]
>
> As an extra "tip", try to use metal film resistors from now on. They
> cost a little more (will not hurt the pocket), they are not carbon
> coiled around the body, so metal film does not create "inductance" for
> higher frequencies.  I use to buy 1% metal film from Digikey at
> $6/package of 200 units, not bad at all, and they also have lower ppm,
> what suffer less changes in resistance based on temperature changes.

That'll end up being a catch 22 since this is probably going to be a one off.
I'll test with carbon. If it works, then likely I'll just keep it.

Thanks for the tips.

BAJ

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


2002\09\28@054045 by Andy Kunz

flavicon
face
What brand are you doing?  I might have code I can share for it.

Andy

At 04:39 AM 9/28/02 -0400, you wrote:
{Quote hidden}

-------------------------------------------------------------------
Race Boats  - RemoveMEandyTakeThisOuTspamspamRC-Hydros.com      http://www.RC-Hydros.com
Airplanes   - EraseMEandyspamspamspamBeGoneFlyingHobbies.com  http://www.FlyingHobbies.com
Electronics - RemoveMEandyKILLspamspamMontanaDesign.com  http://www.MontanaDesign.com
-------------------------------------------------------------------

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


2002\09\28@145952 by Byron A Jeff

face picon face
On Sat, Sep 28, 2002 at 05:39:05AM -0400, Andy Kunz wrote:
> What brand are you doing?  I might have code I can share for it.

Initially Hitachi VCR. Both Wagner's info and the Hitachi info in the HP48
IR remote database here:

http://wwwbzs.tu-graz.ac.at/~fleischh/computer/hp48/horn/utils/rem34bg/remotes/hitachi/hitachi.txt

has been very helpful.

Initially I'll only need the numbers. I'm not real thrilled that it isn't easy
to get any positive feedback from the VCR but I guess I'll just have to trust
that the unit is on and that it's set to output the signal from the VCR tuner.

Any info you'd like to add I would welcome. But I think I got it.

* Emit a header of 8.8-9ms followed by 4-4.5ms of silence
* 0 is 550uS (T) of signal followed by T of silence
* 1 is T of signal followed by 3T of silence.
* Emit 32 bit code consisting of 4 8 bit segments

 <dev><devcomp><code><codecomp>

Where the complements are the complement of the device and code.

The HP page shows a terminating T signal bit but Wagner's page does not. Will
test with both.

Both show a repeat/stop code. It's unclear what happens if you send the same
key code twice in a row instead of a key/repeat combo.

Eventually I'd like to see a machine readable database of a lot of remotes.
I find that I have a lot of universal remotes but that the vast majority of
them don't carry the useful extended functions (Channel Add/Delete, sleep
timer set, Menu, etc.) And most times I don't have the original in order to
train it. But if I had my own trainable, serial downloadable, universal
remote that can macro for example, then I'd probably take the effort to record
a new remote into the database if an entry doesn't exist.

BAJ

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


2002\09\28@145953 by Alan B. Pearce

face picon face
>As an extra "tip", try to use metal film resistors from now on. They
>cost a little more (will not hurt the pocket), they are not carbon
>coiled around the body, so metal film does not create "inductance" for
>higher frequencies.  I use to buy 1% metal film from Digikey at
>$6/package of 200 units, not bad at all, and they also have lower ppm,
>what suffer less changes in resistance based on temperature changes.

Or use surface mount resistors, which also have no inductance worth
mentioning :)

As it is to be a remote, it should be as small as possible anyway :)

>For my "Poor Man's TIVO" project I'd like to build a serial controlled
>IR transmitter

From the rest of the discussion I take it you are going to "remote" control
a standard VCR. I was hoping you might be trying to do a "proper" TIVO.

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


2002\09\28@152549 by Andy Kunz

flavicon
face
>Initially I'll only need the numbers. I'm not real thrilled that it isn't easy
>to get any positive feedback from the VCR but I guess I'll just have to trust
>that the unit is on and that it's set to output the signal from the VCR tuner.

In our hotel systems we used to monitor the results.  As a rule, everybody
worked fine except RCA.  I think they rely on a human pressing the button a
second time.

>  <dev><devcomp><code><codecomp>

Not all do the complement as such.  If you want more universal code, treat
the complement as a second parameter.  I forget which it was, but there are
at least two companies that don't adhere to NEC's spec.

>train it. But if I had my own trainable, serial downloadable, universal
>remote that can macro for example, then I'd probably take the effort to record
>a new remote into the database if an entry doesn't exist.

Try contacting http://www.carmacon.com - he may already have this for you.

Andy

-------------------------------------------------------------------
Race Boats  - EraseMEandyspamEraseMERC-Hydros.com      http://www.RC-Hydros.com
Airplanes   - @spam@andy@spam@spamspam_OUTFlyingHobbies.com  http://www.FlyingHobbies.com
Electronics - spamBeGoneandyspamKILLspamMontanaDesign.com  http://www.MontanaDesign.com
-------------------------------------------------------------------

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


2002\09\28@162026 by Olin Lathrop

face picon face
> This makes perfect sense. However it is unclear if the TRIS bit is set
that
> that pin will in fact be turned into an input. It's implied but never
stated.
> Is that the case? If so then I can modulate the PWM simply by flipping the
> TRIS bit.

I believe that setting the TRIS bit will make the PWM output pin float.
What happens after that depends on the external circuit.

The normal way to "modulate" the PWM is to write a new value to the duty
cycle register.  That's what it's there for.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-request.....spamTakeThisOuTmitvma.mit.edu


2002\09\28@163058 by Olin Lathrop

face picon face
> 1) You can try to change the control logic symmetry to the transistor.
> Sometimes you get further control distance by finding the best
> symmetry, 50/50, 45/55, 40/60. Sometimes the room reflects so much IR
> and it keeps bouncing that it is better to reduce the ON time to 48,
> 45 or lower%,

Maybe there are reasons to lower the on time, but this isn't one of them.
At 40KHz, each cycle lasts 25uS.  If the light were to "keep bouncing" for
even 1% of that time, that would be 250nS.  To do so, it would have to
travel 245 feet, or about 75 meters.  That would require either a very large
room, or many bounces.  Either way the light would be attenuated to a small
fraction of its original strength by the time it reached the receiver.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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


2002\09\28@193051 by Byron A Jeff

face picon face
On Sat, Sep 28, 2002 at 04:13:04PM -0400, Olin Lathrop wrote:
> > This makes perfect sense. However it is unclear if the TRIS bit is set
> that
> > that pin will in fact be turned into an input. It's implied but never
> stated.
> > Is that the case? If so then I can modulate the PWM simply by flipping the
> > TRIS bit.
>
> I believe that setting the TRIS bit will make the PWM output pin float.
> What happens after that depends on the external circuit.

That's good to know.

>
> The normal way to "modulate" the PWM is to write a new value to the duty
> cycle register.  That's what it's there for.

Olin, you do bring up an interesting point. If the duty cycle is set to 0
then does the output stay a flat low? Or does it glitch every cycle?

For this purpose it probably doesn't matter. I was still interested in the
TRIS register because it only required manipulating a single bit and not have
to track the value in the ducy cycle register.

But it's certainly something to consider.

BAJ

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


2002\09\28@201602 by Wagner Lipnharski

flavicon
face
Byron A Jeff wrote:

[snip]

> The HP page shows a terminating T signal bit but Wagner's page does
> not. Will
> test with both.


Probably I missed the terminating T signal, but it worked without it,
or, the remotes I had did not generate it either.
All the information I put available was collected directly from the
remotes, with an AVR gathering the IR received, time based and framed
and then transfered to a PC software to analyse.


> Both show a repeat/stop code. It's unclear what happens if you send
> the same
> key code twice in a row instead of a key/repeat combo.


The Repeat frame has the unique feature to save battery, since it
sends a short burst than if you press the key again and again.  The
final result is exactly the same, doesn't matter if you send the
Repeat Frame (that makes the receive to retrieve the last received
code) or repress the same key.

[snip]

/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Wagner Lipnharski - UST Research Inc
Orlando FLorida - USA - http://www.ustr.net
/_/_/_/ Atmel AVR Consultant /_/_/_/

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


2002\09\29@081508 by Olin Lathrop

face picon face
> Olin, you do bring up an interesting point. If the duty cycle is set to 0
> then does the output stay a flat low? Or does it glitch every cycle?

I think the output will stay flat low.

> For this purpose it probably doesn't matter. I was still interested in the
> TRIS register because it only required manipulating a single bit and not
have
> to track the value in the ducy cycle register.

You only have to write two values to the duty cycle register, 0 for off and
whatever you want the duty cycle to be for on.  Duty cycle changes won't
take effect until the start of the next PWM cycle, but keeping track of
whole carrier pulses is probably a good idea anyway.  I would assume you
describe the various on and off times in numbers of carrier pulses anyway.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\29@083309 by Jinx

face picon face
> Olin, you do bring up an interesting point. If the duty cycle is set to 0
> then does the output stay a flat low? Or does it glitch every cycle?

If PWM dc=0 then the CCPx pin is not set (Midrange Manual 14.5.1)

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\29@095257 by Byron A Jeff

face picon face
On Sun, Sep 29, 2002 at 08:10:13AM -0400, Olin Lathrop wrote:
> > Olin, you do bring up an interesting point. If the duty cycle is set to 0
> > then does the output stay a flat low? Or does it glitch every cycle?
>
> I think the output will stay flat low.

That's good.

{Quote hidden}

I hadn't planned to. 26.3 uS, the period of a 38 Khz carrier, isn't exactly
conducive to clean manipulation. I think that's probably the one advantage to
controlling the output buffer directly, precise turnon/turnoff without having
to wait until the end of the cycle.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\30@033527 by Michael Rigby-Jones

flavicon
face
> -----Original Message-----
> From: Jinx [SMTP:spamBeGonejoecolquitt@spam@spamspam_OUTCLEAR.NET.NZ]
> Sent: Sunday, September 29, 2002 1:32 PM
> To:   TakeThisOuTPICLISTspamspamMITVMA.MIT.EDU
> Subject:      Re: [PIC]: Building an IR remote
>
> > Olin, you do bring up an interesting point. If the duty cycle is set to
> 0
> > then does the output stay a flat low? Or does it glitch every cycle?
>
> If PWM dc=0 then the CCPx pin is not set (Midrange Manual 14.5.1)
>
>
By pure chance one of the graduate engineers here has been making an IR
remote using a PIC at home.  I suggested using the CCP module in PWM mode
for producing the carrier and it works perfectly by simply writing 0 and the
desired "on" duty cycle into the CCP duty cycle register.

Regards

Mike

--
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


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