Am I reading this assembler correctly?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Thanks Chris,

    Isn't it great that you can jump in and out of ASM at will?
    The most powerfull feature of PBP.

    It looks like Step 12 is still the same.
    Maybe it just didn't get changed in the attached file, but I want to make sure you've tried it.
    <table border=1 cellpadding=8><tr><td align=center>ASM</td><td align=center>PBP</td></tr><tr><td valign=top><pre>paso_12h:<br> bsf PORTB,0<br> bsf PORTB,1<br> bcf PORTB,2<br> bcf PORTB,3<br> bcf PORTB,4<br> bcf PORTB,5<br> movlw 11<br> movwf paso_h<br> call retardo_velocidad<br> return</pre></td><td valign=top><pre>'* step 12*<br>A=1<br>I0A=1<br>I1A=0<br>B=0 <br>I0b=0<br>I1B=1 ; should be 0<br>PAUSEUS TIME</pre>
    </td></tr></table>

    Looking at the rest in the mean time.
    DT

  2. #2
    Join Date
    Apr 2007
    Location
    Santiago, Chile
    Posts
    77


    Did you find this post helpful? Yes | No

    Wink Thanks Darrel

    Really Darrel, You always seem to spot the errors quick.

    Like usual I didn't see that small error in step 12, even though you mentioned it.
    Now it is rotating very smoothly.
    If you have any other nasties you can see in that code please tell me.


    ManyThanks

    Chris

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by crhomberg View Post
    Really Darrel, You always seem to spot the errors quick.
    It's a Curse, really.

    I can spot things in other peoples programs like it's got a blinking red light on it.
    But in my own programs, it can take weeks to find a simple bug.

    er - ok well I think it works that way for everyone. I just never ask for help.

    If you have any other nasties you can see in that code please tell me.
    Well, if it's turning smoothly then I think the "Nasties" are gone. But I might be able to make some new ones for you.

    Sorry, my other curse is the need to reduce redundant code (RRC).
    So here's my idea.
    Code:
    Qstep  VAR BYTE
    Coils  VAR BYTE
    
    StepForward:
        Qstep = Qstep + 1
        IF Qstep >= 16 THEN Qstep = 0
        GOTO DoStep
    
    StepReverse:
        IF Qstep = 0 then Qstep = 16
        Qstep = Qstep - 1
          
    DoStep:
        LOOKUP Qstep,[%001101,%001111,%001100,%001010,%101000,%111000,%100000,%010000 _
                     ,%000100,%000110,%000101,%000011,%100001,%110001,%101001,%011001], Coils
        PORTB = (PORTB & %11000000) | Coils
        PAUSEUS TIME
    RETURN
    Completely un-tested.
    Last edited by Darrel Taylor; - 13th November 2007 at 05:50. Reason: Reverse is a reserved word. DOH!
    DT

  4. #4
    Join Date
    Apr 2007
    Location
    Santiago, Chile
    Posts
    77


    Did you find this post helpful? Yes | No

    Talking Thanks Darrel

    Very neat Darrel, very neat!
    Why donīt you ask when you have problems, even the best professionals can be helped by a second set of eyes to check the design.

    Again,

    Thank you very much

    Chris Rhomberg

Similar Threads

  1. Reading temperature using multi DS18B20
    By KVLV in forum Code Examples
    Replies: 16
    Last Post: - 3rd November 2017, 19:48
  2. PIC assembler forum?
    By Lajko in forum Off Topic
    Replies: 1
    Last Post: - 29th September 2008, 05:34
  3. Assembler problem
    By om3bc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th March 2008, 19:12
  4. Pot reading jumping like crazy!!!
    By champion in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 20th November 2006, 21:24
  5. Which assembler are you using?
    By picnaut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st November 2005, 20:34

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