problem with stepper!!


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Here is something to try.

    Add this to the beginning of your program before MAIN and remove lines:
    eeprom 1,[00]
    P VAR BYTE
    read 1,p
    WRITE 1,P
    P=P+1
    P = P-1
    Code:
        cnt var byte        'A VAR for counting the FOR/NEXT
        Pb1	var	byte   'The VAR that is being counted and saved
        P var byte          'The VAR that the saved data is read into to show position
        Plog data 0         'DATA storage area
        
        READ Plog, P        'At program start, reads saved DATA into P
    Now for a SUB routine.
    Code:
        POS_1:              'LABEL
        for cnt = 1 to 1    'Write DATA one time
        Pb1=Pb1+1           'Pb1 is increased by one
        write Plog, Pb1     'Write Pb1 into Plog
        read Plog, P        'Makes P = to Pb1
        pause 100           'Time to write to DATA area
        next                'See if FOR/NEXT is finished
        RETURN              'Return to SENDER
    Put a GOSUB POS_1 inside of all the SUB routines that move the motor. "RIGHT1" for example.
    Last edited by mackrackit; - 7th August 2007 at 16:44.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. 18f4431; driving a stepper IN HARDWARE mode
    By DDDvvv in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st January 2010, 16:49
  2. Replies: 11
    Last Post: - 6th November 2008, 10:27
  3. Controlling stepper motor with PIC
    By The Master in forum Off Topic
    Replies: 3
    Last Post: - 1st July 2008, 10:21
  4. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59

Members who have read this thread : 0

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