Int2 reads differently from Int0/1??

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I've got an interesting problem and couldn't turn up anything on a search.
I've got some hall-effect sensors hooked up to the external interrupts on an ATMega16. There are three sensors, one each on Int0, Int1, and Int2. Input filtering is a simple RC circuit, and identical on each one. Each interrupt is falling edge triggered.

Ok, here's the situation. Int2 "bounces". Badly. Connecting the same sensor to Int0, and rotating my test wheel one revolution may read, say, 100 counts, while Int2 will read over 2000. I've checked this with the sensor connected to Int0 and Int2 at the same time, so the counts should be identical. I've tried some software filtering, a delay loop in the ISR to miss some of the bounces. That seems to remove the bouncing, but then the Int2 input always reads EXACTLY twice as many counts as Int0.

Anyone have any ideas as to what could be causing this?

Thanks!
Jeremy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is configured for twice as many edges as the other two?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, INT2 is different. It operates asynchronously, while INT0 and INT1 are synchronous. This may be the cause of the problem.

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A schematic would help.

Klaus
********************************
Look at: www.megausb.de (German)
********************************