Software timer vs pin interrupt priority.

I am trying to drive a stepper motor from an Arduino Nano at an RPM based on the ground speed reported by an EM-506 GPS module. I can parse the position information from the GPS and I can drive the stepper motor smoothly, but I cannot do both.

I read from the GPS using SoftSerial on pins 0 and 1.

I am using Timer1 to drive the Easy Driver Stepper.

Is the Nano incapable of this or do I need to do something with interrupt priorities to allow the stepper interrupts to have a higher priority?

I'm new at this, so I've obviously overlooked something.

I think most current softSerial implementations turn off interrupts for pretty long stretches when receiving data. (interrupt on start bit, receive the whole character in the ISR, return when the stopbit starts.)

You might be better off using one of the older non-interrupt-driven softwareSerial libraries, if your timer ISR is short and your serial speed isn't too high.

I read from the GPS using SoftSerial on pins 0 and 1.

Excuse me but this is quite stupid. On pins 0 and 1 you have a hardware serial interface so you have absolutely no need to use that crappy SoftwareSerial (it blocks interrupts during sending and receiving of complete bytes).

BTW, the priority of the interrupts is fixed in hardware, you cannot change it.

I am using an Arduino Nano to drive a stepper motor (EasyDriver Stepper) and also parsing the serial output from an EM-506 GPS. Whenever a serial message comes in from the GPS, the stepper motor stutters. Is this just too much load for a Nano, or is there a way to give SoftwareSerial a lower priority than the stepper ( using TIMER1, preload of 8, compareLimit of 1665).

Post the code that shows this effect

I'll distill it down to a small sample this afternoon and post it.

is there a way to give SoftwareSerial a lower priority than the stepper

No. The priority of interrupts is not something you can control.

This is the same problem as in your other Thread. Don't double Post.

I am suggesting to the Moderator to merge them

...R

@svenyonson, please do not cross-post. Threads merged.