Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

timer concept for stepper motor

Status
Not open for further replies.

embed_v

Junior Member level 1
Joined
Aug 10, 2010
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,432
hiii
i am new with stepper motor .
so i want some basic information related to timer used for stepper motor application in C.

1)when the timer is overflow? and then what will be the next step.

2) i saw some code ther is milli. and micro. delay function both are used WHY ?
Here is the some code ... so plzzz explain me the follwing code bcause i want to be impliment like the same
(IT IS FOR FULL STEPPING )
void Milli_Delay(unsigned int ms)
{
while (ms--)
Micro_Delay(100);
}

void MicroDelay(unsigned int us)
{

us += T1TC;
while (T1TC < us);

}
WHAT IS THE TIMER CONCEPT BEHIND IT TO USED MILLI AND MICRO FUNCTION????
 

Hi,

1. Overflow depend on type of timer, this is mentioned in specifications of the timer; eg- normally if it is 8bit timer it may overflow and trigger interrupt when rollback at 255 to 0;

2. I think MicroDelay(unsigned int us); should be Micro_Delay(unsigned int us); If so,
Milli_Delay is used for larger time of delay, it calls Micro_Delay for several (ms) times. ie. to achieve ms X MicroDelay(100) time delay.

T1TC might be a counter of a running timer. Micro_Delay is for smaller time delay; based on a timer to achieve precise timing. It was only used by Milli_Delay.

Ultimately Milli_Delay will achieve precise time delay need for stepping.

Hope this helps you to understand.
 
  • Like
Reactions: blooz

    blooz

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top