Show Posts
Pages: 1 ... 507 508 [509] 510 511 ... 975
7621  Using Arduino / Networking, Protocols, and Devices / Re: Baud rates are the same but Serial throwing a tantrum! on: April 29, 2012, 04:32:23 pm

Grounds connected?
7622  Using Arduino / Project Guidance / Re: Teensy 2.0 and button lag on: April 29, 2012, 04:09:16 pm
I don't want to overload your screen with like 200 lines of code.

I have a sneaky suspicion my screen is not going to care about the size.  It gets paid the same amount if it's displaying a one line program or a 200 line program.
7623  Using Arduino / Project Guidance / Re: Teensy 2.0 and button lag on: April 29, 2012, 04:07:15 pm
Quote
Bounce button1 = Bounce(1,5);

5 milliseconds is too short.  You should be using values between 20 and 200.
7624  Using Arduino / Networking, Protocols, and Devices / Re: Mega Baud rate Error on: April 29, 2012, 04:03:36 pm
on 14400 the pulse width varies from bit to bit (from 50 to 100 uSec)

How did you arrive at that conclusion?
7625  Using Arduino / Project Guidance / Re: Attiny 85 RF on: April 29, 2012, 04:00:09 pm

http://arduino.cc/forum/index.php/topic,63755.0.html
7626  Using Arduino / Programming Questions / Re: smoothing pot input on: April 29, 2012, 03:55:27 pm
My question is, what is a reasonable value to initialize with?

1. Average of N samples where N is about the same history you get from the EWMA (for α = 0.9, N = 4 is adequate).

2. Start at zero and toss out values until the EWMA has a complete history (for α = 0.9 the first six values are be discarded).

3. Or, as @Grumpy_Mike said, one sample. 

It depends on what you are trying to accomplish (and whether or not you're a statistician).
7627  Using Arduino / Project Guidance / Re: Teensy 2.0 and button lag on: April 29, 2012, 03:46:17 pm

You forgot to post your code.  (please use [code] [/code] tags)
7628  Using Arduino / Programming Questions / Re: Reset millis() clock on: April 29, 2012, 03:40:04 pm
The variables I am referring to are timer0_overflow_count and timer0_millis, both of which are unsigned long, according to your sketch. Neither, according to your sketch, is volatile.

Nice catch!

@MGeo: This is a great example of why resetting millis is a bad idea.  Get a seemingly insignificant detail wrong and your program goes haywire.
7629  Using Arduino / Programming Questions / Re: smoothing pot input on: April 29, 2012, 03:28:26 pm
This seems to work, but is very slow to respond. How can I speed up the response?

First, let's review snippets from some of the replies...

Quote
That code uses an uninitialized variable

Quote
missing the proper initialization

Quote
And it is only the initialization of the variable that is missing

I can't help but notice that the code you posted does not initialize smooth.  Do you think that might be the problem?
7630  Using Arduino / Networking, Protocols, and Devices / Re: Baud rates are the same but Serial throwing a tantrum! on: April 29, 2012, 03:21:28 pm

The code you posted produces the results you posted?
7631  Using Arduino / Microcontrollers / MOVED: Baud rates are the same but Serial throwing a tantrum! on: April 29, 2012, 03:14:49 pm
This topic has been moved to Networking, Protocols, and Devices.

http://arduino.cc/forum/index.php?topic=103672.0
7632  Using Arduino / Programming Questions / Re: SPI_CLOCK_DIV and internal oscillator on: April 29, 2012, 01:35:47 pm

You're right.  ±5% is a reasonable practical limit.  Beyond that it becomes increasingly difficult to differentiate between the last bit and the stop bit.  Guess I shouldn't believe everything I read on the internet.  smiley-wink   (or I should do a better job of remembering the details)
7633  Using Arduino / Programming Questions / Re: smoothing pot input on: April 29, 2012, 01:09:04 pm
Can a filter like this be used to smooth the last n samples, so that old data is at some point essentially discarded?

A follow-up to @Grumpy_Mike's answer: Assuming your samples are integers (e.g. from the analog-to-digital converter), using db2db's α = 0.9, the contribution for the seventh previous value becomes so small that it is not present in a float.  In other words, for practical purposes it's zero.  α = 0.9 gives a history of six samples (the contribution of the six is 1 / 1E-06; not much).

Quote
Currently I am storing the last 20 samples and averaging them, but I have been looking for a way to achieve this without consuming 80 bytes (20 floats)...

What are you trying to achieve?  Is the goal to filter out noise when reading a stable signal (in which case the "windowed average" you're doing now is probably the right choice)?  Do you need the average to "respond quickly" to signal changes?
7634  Development / Other Software Development / Re: OptiBoot for 1284P and address 0000 on: April 29, 2012, 03:36:55 am

Thank you for the follow-up.
7635  Using Arduino / Programming Questions / Re: SPI_CLOCK_DIV and internal oscillator on: April 29, 2012, 03:32:46 am
@Coding Badly, why do you feel he is better off without a crystal?

I don't have enough information to have an opinion one way or the other.  Which is why my post is ambiguous...  Should work well (no guarantee from the management  smiley-wink).  ---versus--- When in doubt, get the crystal out.

Using an external crystal does require more power.  If low-power is paramount then running from the internal oscillator may be worth the risk.  If reliable serial communications is paramount then running from an external crystal may be worth the extra power consumption.  Only @lemming can make that decision.


Quote
If the temp variation causes a 4% change in clock frequency, and you are using a baud rate with say a 3% error at 1 MHz, I think you're going to have a problem.

That's unlikely.  Hardware based serial communications has a high probability of working up to ±10% total clock error.  The ±4% I recommend provides a nice cushion.

In addition, if @lemming has control of both sides he can use a zero-error baud rate.
Pages: 1 ... 507 508 [509] 510 511 ... 975