Step Motor Control


Closed Thread
Results 1 to 3 of 3
  1. #1
    Blasfemy's Avatar
    Blasfemy Guest

    Default Step Motor Control

    Hey, i'm new here but i would like some help on a program for a step motor.
    I'm using a timer to operate at 300Hz and the same timer to operate as a delay of 1800.
    So, first i turn on the first bit during some time and then my interrupt routine just calls the 2 timer after the first is finished. But i think i have some error on my interrupt routine and function so i will just copy it and you could comment it:

    void init_timer1(){
    OPTION_REG=00000011; //0xDF;
    //t0cs = 0;
    //psa = 0;
    //ps2=0; ps1=0; ps0=1;
    TMR0=0x0F;//47 Este timer começará no valor apropriado de modo a fazer o overflow no tempo certo
    Flag=1;
    }

    void init_timer2(){
    OPTION_REG=00000011; //0xDF;
    //t0cs = 0;
    //psa = 0;
    //ps2=0; ps1=0; ps0=1;
    TMR0=0x0F;//221 Este timer começará no valor apropriado de modo a fazer o overflow no tempo certo
    Flag=0;
    }


    void interrupt Timers(void)
    {
    if (TOIF==1 && Flag==1)
    {
    TOIF=0;
    Flag=0;
    init_timer2()

    else

    if (TOIF==1 && Flag==0)
    {
    TOIF=0;
    Flag=1;
    init_timer2()
    }

    void Halfstep(){
    while(1){
    init_timer0();
    PortA = 0x08;//1 0 0 0////

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    I would've thought that this URL:

    www.PICBASIC.co.uk

    should've been a big enough hint...
    Guess not...
    forum.microchip.com
    Last edited by skimask; - 19th May 2008 at 18:47.

  3. #3
    Join Date
    Mar 2012
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: Step Motor Control

    Hello, I know it's a bit late, but did you use any Input Capture for your control? If so, please let us know. If you remember eventually...

Similar Threads

  1. Motor Stepper Example
    By Melanie in forum Code Examples
    Replies: 134
    Last Post: - 3rd January 2015, 17:58
  2. Skipping link step. Not all sources built successfully
    By Jalves in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th March 2009, 19:25
  3. motor step
    By fox_53 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2008, 03:05
  4. m looking for those who deal with step motor drivers
    By Augur in forum Forum Requests
    Replies: 2
    Last Post: - 6th July 2007, 05:52
  5. explanation of step array
    By Rabm in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th September 2006, 18:00

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts