SwingeyP
Member
I have the oshon pic basic compiler. I am writing a routine to pulse 3 servos at the same time. Now it sems I can't do this in pic basic so I have included some simple ASM o see what happens. It compiles ok pic basic but wont produce the assembly. Can anyone tell me why please?
For i = 1 To 10
ServoOut leg1servo1, midposition
ServoOut leg1servo2, midposition
ServoOut leg1servo3, midposition
Next i
For i = 1 To 10
ASM:bsf PORTB,7
ASM:bsf PORTB,6
ASM:bsf PORTB,5
WaitMs 10
ASM:bsc portb,7
ASM:bsc PORTB,6
ASM:bsc PORTB,5
Next i
Actually I guess it would be better to put a binary pattern on port b so they all go high an dlow around the same time. How do I get this to compile to assembly with oshon?
Regards - Paul
For i = 1 To 10
ServoOut leg1servo1, midposition
ServoOut leg1servo2, midposition
ServoOut leg1servo3, midposition
Next i
For i = 1 To 10
ASM:bsf PORTB,7
ASM:bsf PORTB,6
ASM:bsf PORTB,5
WaitMs 10
ASM:bsc portb,7
ASM:bsc PORTB,6
ASM:bsc PORTB,5
Next i
Actually I guess it would be better to put a binary pattern on port b so they all go high an dlow around the same time. How do I get this to compile to assembly with oshon?
Regards - Paul