Show Posts
Pages: [1] 2 3 ... 10
1  Development / Other Software Development / Re: New I2C Master library on: August 09, 2011, 02:47:22 pm
Very nice. Although the current Arduino I2C library works for me (single reads to a register), I thought it was kind of "klunky" the request operation.
2  Using Arduino / Programming Questions / Re: Bailing out of PulseIn() on: February 21, 2011, 02:18:16 pm
Thanks for the replies.

pluggy, I am just a beginner and like to leverage the libraries as much as I can, but thanks for the tip.

Graynomad, I did some more digging.  0022 adds the time out to the reading part of the code:

Question to the implementors:

+  // to be 20 clock cycles long and have about 16 clocks between the edge   

+  return clockCyclesToMicroseconds(width * 21 + 16);

The comment in the new code says 20 clock cycles long, but code uses 21 cycles.  I remember in my implementation 20 was more accurate than 21...   Is 21 more accurate than 20?

Thank you very much for the fix. Now I don't have to redefine pulseIn()
3  Using Arduino / Programming Questions / Bailing out of PulseIn() on: February 21, 2011, 12:23:59 am
In the old forum I asked for help to bail out of pulseIn():,49345.0.html
The suggestion was to redefine the function and add a time out.  That was with IDE 0020

I am reading IDE v 0022 and one of the fixes is:

* Applying the timeout parameter of pulseIn() during measurement of the
  pulse, not just while waiting for it.

Does this fix the "problem" I was having? In other words, there is time out for
1- waiting for previous pulse to end
2- waiting for pulse to start
3- waiting for pulse to stop

4  Forum 2005-2010 (read only) / Troubleshooting / Re: Help: How do I bail out of pulseIn? on: November 23, 2010, 01:40:18 pm
I did some measurements on the NEC remote pulses
I used *20+16 for width

These are the results on average of 50-100 measurements:

Theoretical (usec):  560  1690  2250  4500
Measured  (usec):   532  1674  2227  4549
Difference (usec):   -28    -16     -23   +49

So *20+16 seems to work (Arduino 0021 and  Duemilanove 168)

One additional comment: The reason I needed a bailout is because I am measuring HIGH pulses from the IR receiver. The normal off state of the receiver (no IR received) is HIGH, so if you get a spurious signal of one pulse the receiver out signal will go low, then high and stay there until the next event. In the meantime, pulseIn will wait for the end of the HIGH pulse forever...
5  Forum 2005-2010 (read only) / Troubleshooting / Re: Help: How do I bail out of pulseIn? on: November 22, 2010, 08:19:25 pm

thanks!. With further info from this post:
the code works. I needed to recalibrate width to be 20X

For the application I'm using (NEC remote protocol) the granularity is good enough.

I guess I understand why this is not in the standard release; it will increase the granularity of the pulse measurement. I wonder if there is a better way to bail out of the function.

Thanks again.

Edit: Further reading indicate that the multiplier is 19:
6  Forum 2005-2010 (read only) / Troubleshooting / Re: Help: How do I bail out of pulseIn? on: November 21, 2010, 11:23:45 am
Thanks!. I suppose I need to recompile the Arduino code (which I don't know how to do). Is there a function I could use in my own code?
7  Forum 2005-2010 (read only) / Troubleshooting / Help: How do I bail out of pulseIn? on: November 21, 2010, 04:43:56 am
I'm stuck in a pulseIn waiting for the pulse to end. The time out parameter waits for the pulse to start. There is no other time out parameter for the pulse to end.
8  Forum 2005-2010 (read only) / Troubleshooting / Re: IR pulser and decoder on: April 27, 2009, 07:27:02 pm
You can use a single Arduino to do all of that. I just finished a (Sony) remote control to control a DAC, including volume and documented it here: .
9  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: wire without enabling pull up resistors? on: November 15, 2010, 03:30:10 pm
Agree. I guess I am proposing a flag to just disable the automatic pull ups.
10  Forum 2005-2010 (read only) / Bugs & Suggestions / wire without enabling pull up resistors? on: November 14, 2010, 06:31:00 pm
It would be nice to have a flag to disable the internal pull up resistors in i2c and implement external pull ups to 3.3V
11  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: remove confusing Processing UI elements on: May 01, 2009, 06:16:48 pm
Isn't that part of the learning process?
12  Forum 2005-2010 (read only) / Syntax & Programs / Re: LCD "Bigfont" Numbers over 2 or 4 lines on: June 20, 2009, 11:31:37 pm

Inspired by your designs, I tweaked my 3-line large font.  Here are some pictures:
13  Forum 2005-2010 (read only) / Interfacing / Re: How to work an ir remote on: May 13, 2009, 12:43:47 pm
Yeah, Sony protocol is the easiest. I've implemented this code and works well. The latest code in this thread is interrupt based so you can do other things besides looping around waiting for the remote.
I posted the last code and it has some minor errors, but it works.
14  Forum 2005-2010 (read only) / Español / Re: Contar pulsos on: May 12, 2009, 04:33:07 pm
De acuerdo a este post: se tardan 51 ciclos para atender al interrupt. Supongamos que lo que haces en el interrupt se tarda 49 ciclos, entonces lo maximo que puede medir es 16MHz/100 o  160KHz
15  Forum 2005-2010 (read only) / Troubleshooting / Re: Your Website is Terrible on: April 25, 2009, 05:09:18 pm
When I learned programming, we had to use a keypuncher. Well, that was frustrating! :-)
Pages: [1] 2 3 ... 10