Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3691506
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:09:20+00:00 2026-05-19T04:09:20+00:00

I have a question regarding stepper motor control while using the Microchip TCP/IP stack.

  • 0

I have a question regarding stepper motor control while using the Microchip TCP/IP stack.

In the past I have used a timer for my stepper motor control. I set the period of a timer to the required time between pulses and then I change the motor phase outputs as needed in the timer tick ISR. In the cases where I have done this my stepper was moving at a maximum rate of around 400 pulses per second which means the interrupt was occurring every 2.5 milliseconds. And I was using USB for communication to the host.

I am now working on a new product which will use the TCP/IP stack to communicate with a PC over Ethernet. It will also be communicating with other devices via SPI and UART modules. This new device must be capable of operating a stepper up to 2000 pulses per second which means the interrupt may be firing every .5 milliseconds if I use the same timer/ISR approach to drive the stepper. The stepper is turned on and off based on commands received from the host, so communication with the host and operation of the motor need to occur harmoniously and simultaneously. If the stepper speed varies slightly that would not be a problem but it is not ideal. Also, if the stepper were to pause for say a 30ms in the middle of it’s move that WOULD not be acceptable.

I am considering using a PIC24F with the instruction clock speed of 16MHz (32Mhz/2 using the internal FRC+PLL) for this project. Do you think that the interrupts for the stepper will disrupt the Ethernet communication or vise-versa? Is there a better way of doing this?

I have considered using a separate PIC for the stepper control and then I could send that pic target position commands or halt commands to start and stop the movement but that would add another firmware into the mix and complicate things all around.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:09:20+00:00Added an answer on May 19, 2026 at 4:09 am

    It depends on the hardware, and the best answer is to give it a shot and try.

    Your other options are to either use a separate PIC for stepper control like you mention, use pseudo-threading (userland threading, but that’s usually not available in most compilers for the PIC platform).

    But perhaps what will work best for you is to have the main loop of your software control the stepper motor (for …. move, sleep, continue) and then use interrupts to handle the TCP/IP requests coming in with which you will modify the state registers/variables.

    Using interrupts is a good idea, but when you have something this high-priority, polling & looping are better options. To make sure everything is smooth, you’ll need to be able to guarantee that your TCP/IP interrupts won’t exceed xxx cycles (or milliseconds, same thing on a PIC, really), or else adding stepper control code to the TCP/IP interrupt handler.

    Now none of this would be necessary if your PIC controller has prioritized interrupts. In that case, just put the stepper interrupt on a higher priority than the TCP interrupt and you’ll be good to go. However, I don’t believe PIC has that for user functions, but I could be mistaken. It may also be a good idea to migrate to another platform that does support prioritized interrupts, because that’ll make for much cleaner code and make your life easier overall.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have question regarding the use of function parameters. In the past I have
I have a question regarding the best practise of handling formated text when using
I have question regarding shared memory segmentation in c using POSIX system calls. Is
I have a question regarding calling methods from different threads. Well I am using
I have question regarding about finding subview using '.tags' in one UIView. for (UIView
I have a question regarding how to use the formula property to be used
I have silly question regarding Ajax and fancy box.i'm new to Ajax. i'm using
I have a question regarding smarty templates, I'm using PHP and Smarty in order
I have question regarding the SQLAlchemy. How can I add into my mapped class
I have question regarding disabling browser caching. I have already found few solutions, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.