Go Down

Topic: Missing Timer Input Pins?%!&# (swearing omitted) (Read 696 times) previous topic - next topic

wholder

I set out to create a motor speed control design for an RC car project I'm working on and ran into an unexpected limitation in the Arduino Mega hardware design.  Specifically, I wanted to implement a closed loop speed control on the drive motor on my car and thought I'd use one of the 16 bit timers to count revolutions of the motor using a hall effect sensor.  But, after much searching, I was surprised to learn that the Mega Arduino design only bothers to bring out the input pin to Timer 5 to an edge connector.  The input pins to the other 16 bit timers, timer 1, timer 3 and timer 4, are left completely unconnected...  So, OK, fine.  I thought I'd use timer 5.  But, then I discovered that doing this would break my use of the Servo library, as it depends on Timer 5.  Argh...

So, it seems that someone decided that using timers as counters was a rather unimportant feature in the design of the Arduino Mega.  Frankly, this seems incredibly short sighted to me.

Wayne

Coding Badly


T0 is available.  You would have to move millis to a different timer.

ICP4 is available.

ICP5 is available.  The Servo library would have to run the timer at a constant frequency and leave it running.


MarkT

You should be able to use any of the attachInterrupt() pins and count with an ISR - or even use pin-change interrupts and then any pin can be used.
[ I won't respond to messages, use the forum please ]

DuaneB

Hi,
    I don't know a whole lot about hall effect sensors, but I have an RC Car on the table next to me, where on earth are you planning on mounting the sensor ? wont it be saturated by the motor magnets ? and wont it upset the balance of the motor ?

My suggestion - find an easily accessible slow moving gear or shaft and count the revs with light.

As others have suggested, any interrupt pin will do for this.

Duane B

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

MarkT

Hall effect sensors cannot saturate, they are not ferromagnetic.  (Well some sensors may add ferromagnetic materials to increase sensitivity, but your basic Hall effect sensor is just a piece of semiconductor with a bias-current flowing.)
[ I won't respond to messages, use the forum please ]

Go Up