Go Down

Topic: Sensor RPM without Interrupts (Read 1 time) previous topic - next topic

Hi... I'm working a week ago with Arduino, and I am implementing a speed sensor for 4 bicycles to send the signal to Adobe Flash and connect to a game .... The Atmega328 has only 2 External Interrupts and I need 4, so I'm trying to implement Polling ... the maximum frequency for receiving data from a single cycle is 50Hz (20ms) ... the question is: Polling is feasible to work with these speeds, or I will get the Arduino Mega has 6 external interrupts? hehe ... Thank you very much if anyone can help me with this...
Diego M Toro

Be aware the atmega328 has the ability to set its other pins as interrupts, called the "PCINT" interrupt system I think... I've read somewhere that somebody wrote a library to use these, but I don't have the link off hand.

robtillaart

pin change interrupts indeed

you need to read this - http://arduino.cc/playground/Main/PinChangeInt -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

DuaneB

hi,

I didn't write the pinchangeint library or contribute in anyway but here is a write up on the library -

http://rcarduino.blogspot.com/2012/03/need-more-interrupts-to-read-more.html

And an example of using it to read multiple signals which you could adapt to your application

http://rcarduino.blogspot.com/2012/04/how-to-read-multiple-rc-channels-draft.html

Duane B
rcarduino.blogspot.com


rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Nick Gammon

For fastest response for pin change interrupts (especially if you only need another two) choose pins on different "groups". (eg. PINB and PINC).

Then you can configure an interrupt handler for each one with minimal testing needed as to exactly which pin caused the interrupt.

More info here:

http://www.gammon.com.au/interrupts
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Hi,

Thanks everybody... I have been reading the links you sent me and I'm trying to make a 'fusion' of all the info ... this weekend I will work hard and tell them how I was ... (write in English is still difficult for me, and I translate some things on google, but I hope you mean, lol)
Diego M Toro

robtillaart


We understand it perfectly (otherwise we will just ask)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up