Show Posts
Pages: 1 ... 507 508 [509] 510 511 ... 972
7621  Using Arduino / Programming Questions / Re: Random Seeds and Random Numbers on: April 26, 2012, 12:00:03 pm
Quote
The jitter of the RC oscillator seems to be a better internal source of entropy than the ADC, though only generating 8 bits per second or 125 bits per second in example implementations.

For a specific processor, maybe.  In the general sense, no.  The AVR internal oscillator (and watchdog oscillator) certainly has jitter but the entropy in the jitter appears to be considerably less on newer processors.  My suspicion is that the jitter for newer processors is primarily a function of the previous and current state of the processor (which is going to be rife with patterns) rather than thermal noise.
7622  Using Arduino / Programming Questions / Re: asin() *always* returns 0 on: April 26, 2012, 11:23:49 am

http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html#ga98384ad60834911ec93ac5ae1af4cf0a

Quote
The asin() function computes the principal value of the arc sine of __x. The returned value is in the range [-pi/2, pi/2] radians. A domain error occurs for arguments not in the range [-1, +1].

AVR Libc does not produce run-time exceptions.  The developers chose to return zero instead.
7623  Using Arduino / Programming Questions / Re: Timing and speed issues with pin change interrupt based routines - Arduino slow? on: April 26, 2012, 11:15:38 am
Quote
12 hardware generated triggers

High pulse?  Toggle?


Other than what you've described, what is the application doing?  Serial output?  Managing an LCD?
7624  Using Arduino / Networking, Protocols, and Devices / Re: SoftwareSerial disable port? on: April 26, 2012, 12:32:05 am
So if I have the situation you describe above, and some random memory is written, shouldn't I be seeing crashes?

You may see "crashes".  They are other possible outcomes including running without symptoms.

Quote
I have one sketch running for months now where I assigned TX to -1, and it has not failed.

Good for you.

Quote
I assume no damage - just random crashes would be the effect.

There are some outcomes that could cause damage.  For example, if you have a peripheral connected (like an op-amp) that drives a pin and the pin is inadvertently switched to an output the result would very likely damage the processor.

Quote
Also, what if I have an output for an LED - lets say pin 5, and I assign 5 to TX also. If I never send any TX data, is there a specific problem with that?

Nope.  With the exception that the LED will be lit until you turn it off in setup.  Unless you want the LED to start life lit.  In which case it's a perfect solution.
7625  Using Arduino / Motors, Mechanics, and Power / Re: How to connect dc fan without motor shield? on: April 25, 2012, 11:54:27 pm

And, if you grow impatient for help, I suggest spending a few minutes with Google.  The question comes up rather frequently.
7626  Using Arduino / Motors, Mechanics, and Power / Re: How to connect dc fan without motor shield? on: April 25, 2012, 11:51:13 pm

On / off control or speed control?
7627  Using Arduino / Programming Questions / Re: Seeing generated C++ code on: April 25, 2012, 11:47:03 pm

The code in your sketch is very close to what is passed to the compiler.  The actual file will be located in your %TEMP%.  Just search for dot-cpp files.

For the libraries and core files, enable verbose output for the compiler.
7628  Using Arduino / Programming Questions / Re: Random Seeds and Random Numbers on: April 25, 2012, 11:23:13 pm
What do you consider to be the flaws?

It may take a few days to resurrect the memories.  I'll get back to you.

Quote
I think it's a flaw to throw away all the bits except the last one, since the others could have randomness, too.

I'm confused.  You state it's a flaw to throw away all but the last bit but then prove even the last bit is not random.
7629  Using Arduino / Networking, Protocols, and Devices / Re: SoftwareSerial disable port? on: April 25, 2012, 10:26:48 pm

Sounds reasonable to me.  Please add the suggestion here...
http://code.google.com/p/arduino/issues/list
7630  Using Arduino / Networking, Protocols, and Devices / Re: SoftwareSerial disable port? on: April 25, 2012, 08:25:47 pm

Let's walk through the code and try to determine what happens...

We'll work with pinMode(tx, OUTPUT); (the other calls are very similar for the sake of this discussion).  The essence of the call is this... *reg |= bit; ...where reg was obtained by calling portModeRegister and bit was obtained by calling digitalPinToBitMaskportModeRegister reads a 16 bit value from Flash memory and casts the value to a pointer.  When the parameter passed to portModeRegister is in range (when the pin number is valid), the 16 bit value is read from the port_to_mode_PGM array.  When the parameter is not in range, an arbitrary location anywhere in Flash can be read which means an essentially "random" value is returned.

The net result is that a "random" location in SRAM is modified.  It's not much different than dereferencing and uninitialized pointer.  Not a good thing.
7631  Using Arduino / Installation & Troubleshooting / Re: Problem uploading sketch in verify phase on: April 25, 2012, 08:10:21 pm

Please upload from the IDE with verbose output enabled and post the output.  Use [code] [/code] tags when posting.  If the output is too big it can be attached as a text file.
7632  Using Arduino / Installation & Troubleshooting / Re: Problem uploading sketch in verify phase on: April 25, 2012, 07:24:38 pm
Quote
The bootloader is the STK500v2 at 115200 with a 16mhz clock.
I verified that avrdude will connect to the bootloader (avrdude -pm2561 -cstk500v2 -b115200 -P/dev/ttyUSB1)
avrdude -pm2561 -b57600 -cstk500v2 -P/dev/ttyUSB1 -U flash:w:Blink.cpp.hex

- ? -
7633  Using Arduino / Programming Questions / Re: Character limit? on: April 25, 2012, 05:15:53 pm

The ring buffer is 63 bytes with Arduino 1.0.
7634  Using Arduino / Project Guidance / Re: Precise (in time) event logging. ~100ns required. on: April 25, 2012, 03:35:47 pm
My god people are self righteous

Yup.  That's me.  Self righteous to the core.

To ensure I cause you no further angst I will refrain from all further contact.  Good luck with your project.
7635  Using Arduino / Installation & Troubleshooting / Re: Problem uploading sketch in verify phase on: April 25, 2012, 03:33:04 pm

Does verify work from the IDE if you enable verbose output?
Pages: 1 ... 507 508 [509] 510 511 ... 972