nomad
02-11-2007, 05:47 PM
hi everybody
in my last postings, i have big troubles
to control 1 servo with 2 buttons.
yesterday i have hard testings:
- 1. look at my yesterday-postings
···· - LedOnOffPx.spin
···· - simulateServo1.spin
now: today i make new tests for
···· running the servo.
The results:
1) test of simulateServo1.spin with propstick = ok
2a) compare between simpleServoStick1.spin (1a)
··· and
··· servo4.spin (2a)
··· - in (1a) in the sourceCode: is this statement
········ CON
··········· _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
··········· _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
··· - in (2a) no statement
2b) compare between servo4.spin (1b)
··· and
··· servo4_demo.spin (2b)
··· result: (1b) no statement.
··········· (2b) with statement
3) now testing simulateServo2.spin with the statement
·· - CON
··········· _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
··········· _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
·· - RESULT: - with the new statement··· = NOT RUNNING
············ - without the new Statement = RUNNING
4) WRITE NEW CODE = SimulateServo3.spin
Now i write this new code with:
·· - p0 is for the servo-Pulse·
·· - p1 is the Button S1 control the pulse +···
·· - p2 is the Button S2 control the pulse -
·· - schematics ServoPulse = P0 -> 4.7K -> to servoSignal
···············
·· - button-circuit: as my servoTestBoard_NEW.jpg
···· s1·· pin 1 = gnd····· -> 4.7K ->· to board VSS (p29)
········· pin 2 = +3.3volt········ ->· to board VDD (p32)
········· pin 3 = signal·········· -> to boardPin p2
···· S2·· pin 3 = signal·········· -> to boardPin p3
········· pin 2 = +3.3volt->······ -> to board VDD (p32)
········· pin 1 = gnd -> 4.7K····· -> to Board VSS (p29)
Remarks: on 11.02.2007
- while the 1.test == run & ok without new code
· - new code
"
··· CON
······ _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
······ _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
"
RESULT:· - WITH NEW CODE-STATEMENT = system NOT RUNNING·
············ - WITHOUT NEW CODE-STATEMENT = system RUNNING
1.tests: with this new code
--- simulateServo3.spin --------------------------------------
VAR···· long· pulsetime, periode, timebase
PUB Main | new_periode
· periode·· := ((clkfreq / 100_000) * 2000)······ '20ms
· pulsetime := ((clkfreq / 100_000) * 150)······ '1,5ms·
·
· dira[0]~~·· ' Pin0 set output
· outa[0]~··· ' Pin0 set low
· dira[1]~··· ' Pin1 set input (button s1)
· dira[2]~··· ' Pin2 set input (button s2)
· timebase := cnt
·
· repeat
·····································
··· outa[0]~~········································· 'generate servopulse
··· waitcnt (timebase += pulsetime)
··· outa[0]~
···
··· if ina[1] == 1···································· 'if button pulsetime + 0,1ms
····· pulsetime += (clkfreq / 100_000)
··· if ina[2] == 1···································· 'if button pulsetime - 0,1ms
····· pulsetime -= (clkfreq / 100_000)
·····
··· new_periode := periode - pulsetime················· 'periodendauer - pulsdauer
·····
··· waitcnt (timebase += new_periode)·················· 'wait for periode end
-----------------------------------------
·
RESULTS: - 1.TIME THE SERVO IS RUNNING WITH 2 BUTTONS ==· OOK AND JUPEEE············
So the fault with a PropStickUSB :
is this:
··· CON
······ _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
······ _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
only one questions: why ????
have somebody a idea ???
On the PropellerDemoBoard with this code-statement·== servo is running
on the PropellStickUSB (no external Clock) without this code-statement
== servo is running
have somebody a idea ???
many thanks to inversi and everbody for the help.
greetings
nomad···········
··
in my last postings, i have big troubles
to control 1 servo with 2 buttons.
yesterday i have hard testings:
- 1. look at my yesterday-postings
···· - LedOnOffPx.spin
···· - simulateServo1.spin
now: today i make new tests for
···· running the servo.
The results:
1) test of simulateServo1.spin with propstick = ok
2a) compare between simpleServoStick1.spin (1a)
··· and
··· servo4.spin (2a)
··· - in (1a) in the sourceCode: is this statement
········ CON
··········· _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
··········· _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
··· - in (2a) no statement
2b) compare between servo4.spin (1b)
··· and
··· servo4_demo.spin (2b)
··· result: (1b) no statement.
··········· (2b) with statement
3) now testing simulateServo2.spin with the statement
·· - CON
··········· _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
··········· _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
·· - RESULT: - with the new statement··· = NOT RUNNING
············ - without the new Statement = RUNNING
4) WRITE NEW CODE = SimulateServo3.spin
Now i write this new code with:
·· - p0 is for the servo-Pulse·
·· - p1 is the Button S1 control the pulse +···
·· - p2 is the Button S2 control the pulse -
·· - schematics ServoPulse = P0 -> 4.7K -> to servoSignal
···············
·· - button-circuit: as my servoTestBoard_NEW.jpg
···· s1·· pin 1 = gnd····· -> 4.7K ->· to board VSS (p29)
········· pin 2 = +3.3volt········ ->· to board VDD (p32)
········· pin 3 = signal·········· -> to boardPin p2
···· S2·· pin 3 = signal·········· -> to boardPin p3
········· pin 2 = +3.3volt->······ -> to board VDD (p32)
········· pin 1 = gnd -> 4.7K····· -> to Board VSS (p29)
Remarks: on 11.02.2007
- while the 1.test == run & ok without new code
· - new code
"
··· CON
······ _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
······ _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
"
RESULT:· - WITH NEW CODE-STATEMENT = system NOT RUNNING·
············ - WITHOUT NEW CODE-STATEMENT = system RUNNING
1.tests: with this new code
--- simulateServo3.spin --------------------------------------
VAR···· long· pulsetime, periode, timebase
PUB Main | new_periode
· periode·· := ((clkfreq / 100_000) * 2000)······ '20ms
· pulsetime := ((clkfreq / 100_000) * 150)······ '1,5ms·
·
· dira[0]~~·· ' Pin0 set output
· outa[0]~··· ' Pin0 set low
· dira[1]~··· ' Pin1 set input (button s1)
· dira[2]~··· ' Pin2 set input (button s2)
· timebase := cnt
·
· repeat
·····································
··· outa[0]~~········································· 'generate servopulse
··· waitcnt (timebase += pulsetime)
··· outa[0]~
···
··· if ina[1] == 1···································· 'if button pulsetime + 0,1ms
····· pulsetime += (clkfreq / 100_000)
··· if ina[2] == 1···································· 'if button pulsetime - 0,1ms
····· pulsetime -= (clkfreq / 100_000)
·····
··· new_periode := periode - pulsetime················· 'periodendauer - pulsdauer
·····
··· waitcnt (timebase += new_periode)·················· 'wait for periode end
-----------------------------------------
·
RESULTS: - 1.TIME THE SERVO IS RUNNING WITH 2 BUTTONS ==· OOK AND JUPEEE············
So the fault with a PropStickUSB :
is this:
··· CON
······ _CLKMODE = XTAL1 + PLL16X···· 'Set to ext crystal, 16x PLL, 80MHz Clock
······ _XINFREQ = 5_000_000········· 'Frequency on XIN pin is 5 MHz
only one questions: why ????
have somebody a idea ???
On the PropellerDemoBoard with this code-statement·== servo is running
on the PropellStickUSB (no external Clock) without this code-statement
== servo is running
have somebody a idea ???
many thanks to inversi and everbody for the help.
greetings
nomad···········
··