Hi J,Show first the exact code from
On high interrupt
Hi E,hi C.
This is the version I have been using for the demo's, needs extending for 6 timings
As jjw is helping, I will not post as well, it will cause confusion.
E
strbase = "1250,1500,1750,2000"
msg1 = strbase
Call strs2hex2(msg1)
idle_loop:
Goto idle_loop
End
'parse msg string into 4, Tmr1 count Up values
Proc strs2hex2(arg1 As String)
st0 = MidStr(arg1, 1, 4)
st1 = MidStr(arg1, 6, 4)
st2 = MidStr(arg1, 11, 4)
st3 = MidStr(arg1, 16, 4)
wt0 = StrValW(st0)
wt1 = StrValW(st1)
wt2 = StrValW(st2)
wt3 = StrValW(st3)
wt0 = 65535 - wt0 ''' wt0= NOT wt0 is the same as 65535 -wt0
wt1 = 65535 - wt1
wt2 = 65535 - wt2
wt3 = 65535 - wt3
'the wt is the TMR1 load value
Hserout #wt0, ",", #wt1, ",", #wt2, ",", #wt3, CrLf
End Proc
In #127 there is a start code before the main loop:Hi J,
All of my replies since #127 have been using that CODE.
After I found T0 didn't work, I added a WAIT only to check the SERVO is still working, and to show you, how near #127 CODE is to working.
When reading about SERVOS, I have seen reference to a 'start' signal for SERVO control I've also tried a WAIT before the T0 TMR1 INTERRUPT (No worky)
C.
Servo = 2
t1word = 65534
TIMR1H = t1word.HB
TIMR1L = t1word.LB
Hi J,In #127 there is a start code before the main loop:
Code:Servo = 2 t1word = 65534 TIMR1H = t1word.HB TIMR1L = t1word.LB
Hi J,It looks the same.
Have you tried it in simulator?
But did it work in simulator?Hi J,
Yes, I didn't change it till later.
C.
It looks ok.Hi J,
I added a third SERVO here:
Please check the program.
Now neither T0 or T1 is working, but there is a 1500uS square wave at SERVO3 T2.
C
Hi J,Do you have the servo specs?
Input current, voltage?
Current drawn by the servo?
It might be some hardware problem.
Hi J,Do you have the type of the servo, manufacturer etc.
Maybe something can be found on the net.
Where did you buy them?
Do you get the 1-2ms pulses from all pins rb0, rb1, rb2, if servos are disconnected?Hi J,
Any analog SERVO will do (e,g, Futaba 3003) I will be using motor controllers mostly so not actually SERVOs.
I just connected an RC receiver with 2x outputs with a 2x channel transmitter. On the oscilloscope, the signal is just the same as the PCB.
One thing I noticed when I added a third SERVO so trying 1 then 2 then 3, is I only got a signal at the highest number, so if I had 3x SERVOS then I only got a signal at RB2 (SERVO3). It's not out of the question that it's an Oshonsoft problem.
C.