Pages: [1]   Go Down
Author Topic: External interrupt (attachinterrupt) not working  (Read 1797 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone, I can't figure out why the external interrupt via the attachinterrupt() function on my arduino uno is not working.  I'm using a National Instruments card to send the arduino an analog TTL (5V) pulse into digital pin 2 or 3.  Per the instructions,  I am using the 0 interrupt designation for digital pin 2.  I've tried using pin 3 as well. Even the example code provided in the reference doesn't work.  Reference code: http://arduino.cc/en/Reference/AttachInterrupt

Are there some special requirements for the TTL pulse?  Any thoughts?  I'm stumped.

Scott

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using a different TTL input, the example code works.  So, there is something wrong with the NiDaq input. hmmmm....
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without wiring drawings and your sketch posted how are we to tell why it's not working for you? We can state that attachinterrupt command does function as designed when both the hardware and software is properly done. Did you wire a common ground from the NiQaq to the arduino? Are you relying on another interrupt to force you out of your ISR function? Interrupts are a powerful feature of the arduino platform, but many details must be correct to get useful results.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I figured it out.  I wasn't giving a 5V pulse from the NiDaq.  My oscilloscope was amplified 10X, so I was only giving a 0.5V pulse... Doh...
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool...
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Cool...

Spam in Chinese characters removed.
Logged

Pages: [1]   Go Up
Jump to: