Interrupt works too fast on the Arduino -


i know sounds bit funny :). trying eliminate possibilities:

on arduino uno have attached interrupt triggered on high routine increments volatile defined long counter. counter displayed on lcd screen. if connect pulse generator frequency of 1 hz @ ttl levels, expect counter increase 1 per second. not case.

as frequency 1 hz (duty cycle 50%) possible once counter incremented irs exited (and clears interrupt flag) but: int0 level still high isr called again? @ 1 hz 50% duty, high stay 500 ms , @ 16 mhz...

the processor @ heart of arduino has 2 different kinds of interrupts: “external”, , “pin change”. there 2 external interrupt pins on atmega168/328 (ie, in arduino uno/nano/duemilanove), int0 , int1, , mapped arduino pins 2 , 3. these interrupts can set trigger on rising or falling signal edges, or on low level. triggers interpreted hardware, , interrupt fast. arduino mega has few more external interrupt pins available.

so commented: triggers on edge!

see more details on arduino playground web page.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -