Pages: [1]   Go Down
Author Topic: interrupt issues: Adafruit motor shield + servo + timer interrupt + arduino  (Read 1820 times)
0 Members and 1 Guest are viewing this topic.
Vancouver, Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
I want to make a living designing robots
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I need an Arduino genius, someone who groks it all the way down to the bare metal.
I have a robot giving me issues.  I'll describe the hardware, the software, and then the symptoms I'm seeing.

Hardware:
I have an open source wall-hanging drawbot http://github.com/i-make-robots/drawbot build on an arduino with an adafruit motor shield connected to two NEMA17 steppers (for XY motion) and a hobby servo (for Z).

Software:
I use FrequencyTimer2 to control a timer interrupt on timer2.  I communicate with a Java app over Serial, which I'm told uses timer0.  The servo PWM is done on timer1.  I tell the steppers to move at a constant speed and they do, emitting a hum. 

Symptoms:
1. FrequencyTimer2 ruins the PWM on pins 9 and 10 on a mega http://www.pjrc.com/teensy/td_libs_FrequencyTimer2.html which are the two pins used for servo on the shield.  I'm looking for a lib that will make it easy to create timer interrupts (takes care of board-specific issues) and that doesn't screw with pins 9 & 10.  I'm willing to use ServoTimer2 if I can switch the FrequencyTimer to use timer1.  Do you know of one?
2. If If the Arduino receives serial data while this is happening I can hear breaks in the hum, which tells me I am losing steps over time.
3. If I try to send too much serial data from the Arduino the program is likely to hang.

I really want this to work on Duemilanove 328s, mega 2560s, and UNOs.  Unfortunately the timer stuff is getting way past my level of expertise.  Please, geniuses of Arduino!  Can you tell me how to make this work?

Thank you!
Logged

0
Offline Offline
God Member
*****
Karma: 24
Posts: 587
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

2. If If the Arduino receives serial data while this is happening I can hear breaks in the hum, which tells me I am losing steps over time.

Perhaps you might try 1.0.1-rc2, or 1.0.1 if you see this message after it's officially released.  Until then, here's where you can get it:

http://arduino.cc/forum/index.php/topic,100503.0.html

One of many bugs fixed was a terrible inefficiency in the serial interrupt.
Logged

Pages: [1]   Go Up
Jump to: