Show Posts
Pages: 1 ... 134 135 [136] 137 138 ... 279
2026  Using Arduino / General Electronics / Re: What circuit drawing tool is this? on: January 25, 2013, 01:44:10 pm
Could be Eagle, just judging by the colors. I like Eagle, but there was a learning curve. I found it less than intuitive at first.
2027  Using Arduino / General Electronics / Re: Timer Tic Beep on: January 25, 2013, 01:36:29 pm
Tiny pic, can't read it...
2028  Using Arduino / Microcontrollers / Re: External interrupt fires early? on: January 25, 2013, 01:27:28 pm
what happens if you put varying length delays before enabling the interrupt, does that alter the 999 value.

Yes, for example, with delay(2000) instead, I get:

Code:
1999
2787
3787
4788
5788
2029  Using Arduino / Microcontrollers / Re: External interrupt fires early? on: January 25, 2013, 12:55:13 pm
I also tried using an Arduino to supply the 1 Hz signal, same results. Would have been surprised if that had made a difference, but it eliminates another possibility, if a remote one.
2030  Using Arduino / Microcontrollers / Re: External interrupt fires early? on: January 25, 2013, 12:28:04 pm
Did you try setting the pin as an input and using the pullup resistor?

Yes I did, it didn't make a difference.
2031  Using Arduino / Microcontrollers / External interrupt fires early? on: January 25, 2013, 11:32:54 am
I have a 1 Hz square wave connected to INT1, free-running so it is asynchronous WRT the µC. Using the following sketch, the interrupt appears to fire as soon as it's enabled; I consistently see 999 as the first number output. Then the time to the second interrupt varies, and is less than one second. I was expecting the opposite, i.e. the first number should be some random value less than one second, and then the rest should be one second apart.

I've been poring over the datasheet and I can't find anything that would indicate this behaviour, hoping someone can help. I've checked the interrupt flag (INTF1 in EIFR) to ensure it's not set going in, and it's not, have tried resetting it anyway, no joy, etc. etc.

Code:
#include <Streaming.h>    //http://arduiniana.org/libraries/streaming/

#define LED LED_BUILTIN

volatile boolean int1Flag;
boolean ledState;

void setup(void)
{
    delay(1000);
    Serial.begin(115200);
    pinMode(LED, OUTPUT);

    EICRA = _BV(ISC11);          //external interrupt 1 on falling edge
    EIMSK = _BV(INT1);           //enable external interrupt 1
}

void loop(void)
{
    if (int1Flag) {
        int1Flag = false;
        digitalWrite(LED, ledState = !ledState);
        Serial << millis() << endl;
    }
}

ISR(INT1_vect)
{
    int1Flag = true;
}

Typical output that I see:

Code:
999
1652
2652
3652
4652
--------
999
1056
2056
3056
4056
-------
999
1841
2840
3841
4840

I would have expected:

Code:
652
1652
2652
3652
4652
--------
56
1056
2056
3056
4056
--------
841
1841
2840
3841
4840
2032  Using Arduino / Networking, Protocols, and Devices / Re: Using Xbee to control or talk to ZigBee devices on: January 24, 2013, 07:39:50 pm
There was some discussion here not long ago on this topic, I don't think anyone knew where it had actually been done. I'd definitely grab the stuff if I could. You could be the first!
2033  Community / Bar Sport / Re: Coming of age on: January 24, 2013, 07:40:46 am
Happy B-Day, Boffin! I like to say, we don't have a lot of choice about growing older, but I refuse to grow up!
2034  Using Arduino / General Electronics / Re: What is 'spectrum' anyway? How can multiple frequencies exist in one signal? on: January 23, 2013, 07:39:12 pm
In point of fact, this maths stuff is all goobledegook.

Actually, it's what makes it all possible.

Quote
After all, to create a digital on-off [square wave] output, the Arduino isn't adding up a bunch of sine waves, it just says on
or off.

Of course. But for circuit analysis, we must decompose the signal to sine waves.
2035  Using Arduino / General Electronics / Re: What is 'spectrum' anyway? How can multiple frequencies exist in one signal? on: January 23, 2013, 07:07:14 pm
The music analogy is a useful one. Many instruments, singers, etc., all with different frequencies. Yet they all combine into a single signal that can always be described by a single amplitude (voltage) at any given point in time. So we can record music (the sum total) by encoding a single number. In the case of CDs or CD-quality music, we do this 44,100 times per second; the sampling rate is 44.1kHz.

All of AC circuit analysis is based on how the circuits respond to sinusoids. If we don't have a sine wave, all bets are off. A different analysis would be needed for every variation of signal, of which there are an infinite number. The thing that makes the Fourier transform so massively useful and powerful is that it lets us decompose any signal into sinusoidal components, which is the only thing we know how to analyze. This in turn lets us design things like the audio amplifiers for that CD to play through, and know in advance how the circuits will perform.

Even cooler is that the Fourier transform carries over to other disciplines. For example, in mechanical engineering, sprung systems can be modeled and analyzed as an electrical analog. So modeling how a car's springs and shock absorbers respond to a pothole might have a lot in common with how an electrical circuit responds to an impulse input.

Even the "simple" square wave is the sum of sines.

Charts showing how a square wave is built up from the odd harmonics of the fundamental. A fun exercise in Excel or whatever graphing tool you may have:
http://www.mathworks.com/products/matlab/examples.html?file=/products/demos/shipping/matlab/xfourier.html
2036  Using Arduino / Project Guidance / Re: Measuring a very fine wire with 10 µm precision on: January 23, 2013, 03:49:40 pm
Roughly speaking, what is the production volume required? Tens, hundreds, thousands ... ? Also production rate, how many per day, hour, or whatever.
2037  Community / Bar Sport / Re: The power has failed ... on: January 23, 2013, 09:33:23 am
LOL Nick, you must like living right on the edge, arguing with the gendarmes like that. I imagine that they were beginning to suspect that you were part of the problem and a plot to rob the bank while the power (?) and its defenses were down.

Absolutely hilarious story though!! smiley-grin
2038  Using Arduino / Installation & Troubleshooting / Re: Java vulnerabilities on: January 23, 2013, 09:07:53 am
Thanks for the info. I had already disabled the browser plugins and had Windows uninstall Java via control panel. Then the light went on and I realized I still had several instances, one for each release of Arduino that I have on the machine.

One thing I uninstalled was a Java updater that would pop up occasionally when there were new versions to install. Not sure which Java exactly this was updating and what it was used for, pretty sure it wasn't the copy that came with Arduino though.

Appreciate the replies again. Sayonara, Java smiley-roll
2039  Using Arduino / Installation & Troubleshooting / Java vulnerabilities on: January 22, 2013, 10:24:47 pm
With all the recent brouhaha (US-CERT warnings, etc.) I wonder if Arduino users have any cause for concern, or if there are steps that should be taken to mitigate risks. Or is the main concern limited to browser plug-ins?
2040  Community / Bar Sport / Re: You know you're in Michigan when... on: January 22, 2013, 07:25:59 pm
Which reminds me of this:

Baha! Classic!
Pages: 1 ... 134 135 [136] 137 138 ... 279