+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Newbie level 2
    Points: 19, Level: 1

    Join Date
    Jun 2015
    Posts
    2
    Helped
    0 / 0
    Points
    19
    Level
    1

    PIC18F877A Stepper Motor Controller, Proteus Simulation

    Click image for larger version. 

Name:	stepper motor.png 
Views:	8 
Size:	45.1 KB 
ID:	118087

    that is the pattern and the code to vary the speed of a stepper motor with push-button how do this function with ADC thank you


    Code:
    char a,b;
    void interrupt()
    {
    if(intcon.rbif)
    {
    if(portb.b4==0) {a++;}
    if(portb.b5==0) {a--;}
    if(a==10) a=9;
    if(a==0)  a=1;
    }
    intcon.rbif=0;
    }
    speed();void speed()
    {
    for(b=0;b
    
    Last edited by imedx86; 3rd June 2015 at 00:48. Reason: correction

    •   AltAdvertisement

        
       

  2. #2
    Member level 5
    Points: 1,272, Level: 8

    Join Date
    Oct 2011
    Location
    Thodupuzha, India, India
    Posts
    89
    Helped
    19 / 19
    Points
    1,272
    Level
    8
    Blog Entries
    2

    Re: PIC18F877A Stepper Motor Controller, Proteus Simulation

    set some levels in between 0 an 1024. then compare the read value with these levels and assign values to variable b. for example if you want 10 different speeds as in your program one level should be of size 93 (1024/11) and they are 0-93, 93-186, 186-279 etc. Now get the current ADC reading compare it with the levels . if its in the first level then assign variable b=1 and so on. if you have any doubts about the ADC programming let me know.
    SpS



    •   AltAdvertisement

        
       

  3. #3
    Newbie level 2
    Points: 19, Level: 1

    Join Date
    Jun 2015
    Posts
    2
    Helped
    0 / 0
    Points
    19
    Level
    1

    Re: PIC18F877A Stepper Motor Controller, Proteus Simulation

    hi, i m just a beginner in Mikro C if you are free and want to help by do a programme for me thank you in advance



--[[ ]]--