PS2 viberation not working

Nope, still no viberation. I used this code here.

Just a thought

But is says “not required for the lynxmotion one” and thats the one i have.

[code];-----------Bot Board Selection----------
;PS2 Controller / BotBoard I
;DAT con P4
;CMD con P5
;SEL con P6
;CLK con P7

;PS2 Controller / BotBoard II
DAT con P12
CMD con P13
SEL con P14
CLK con P15
;-----------------------------

index var byte
temp var byte(19)
mode var byte
Small_Motor var byte
Large_Motor var byte

;PS2Init
high CLK

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$43\8,$0\8,$1\8,$0\8] ;CONFIG_MODE_ENTER
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$44\8,$00\8,$01\8,$03\8,$00\8,$00\8,$00\8,$00\8] ;SET_MODE_AND_LOCK
high SEL
pause 100

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$4F\8,$00\8,$FF\8,$FF\8,$03\8,$00\8,$00\8,$00\8] ;SET_DS2_NATIVE_MODE
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$4D\8,$00\8,$00\8,$01\8,$FF\8,$FF\8,$FF\8,$FF\8] ;VIBRATION_ENABLE
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$5A\8,$5A\8,$5A\8,$5A\8,$5A\8] ;CONFIG_MODE_EXIT_DS2_NATIVE
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8] ;CONFIG_MODE_EXIT
high SEL
pause 1

main

;-----------PS2 Mode----------
low SEL
; asking “mode” to PS2 controller
shiftout CMD,CLK,FASTLSBPRE,$1\8]
; reading “mode” from PS2 controller
; 73(hex) is dualshock1 (digital buttons)
; 79(hex) is dualshock2 (analog buttons)
shiftin DAT,CLK,FASTLSBPOST,[mode\8]
high SEL
;-----------------------------

pause 1

;-----------PS2 Data----------
low SEL
; asking data to PS2 controller
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8]
; reading data from controller
; (don’t use a “for-next” loop, it’s too slow to read PS2 data)
shiftin DAT,CLK,FASTLSBPOST,[temp(0)\8,temp(1)\8,temp(2)\8,temp(3)\8,temp(4)\8,temp(5)\8,temp(6)\8,temp(7)\8,temp(8)\8, |
temp(9)\8,temp(10)\8,temp(11)\8,temp(12)\8,temp(13)\8,temp(14)\8,temp(15)\8,temp(16)\8,temp(17)\8,temp(18)\8]
high SEL
;-----------------------------

pause 1

;-----------PS2 Vibration motors----------
Small_Motor = 1 - Temp(1).bit5 ; Numeric right arrow button (Small Motor on/off)
Large_Motor = Temp(8) ; Analog left arrow button (Large Motor speed)

low SEL
; asking data to PS2 controller (again)
; sending at the same time the vibration motors speed to perform
; (using the previously read analog buttons position ( <- : large motor, -> : small motor )
; the more you press on these buttons, the more the corresponding motor vibrates fast
; some wireless PS2 controllers react only to the large motor command and some have no motor at all.
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8,$0\8,Small_Motor\8,Large_Motor\8]
; we don’t care about reading the data from the controller here.
; so, why not use this to read PS2 data the first time? because it’s not working:
; as the PS2 controller is starting to send data just after receiving the
; “shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8…”<------here
; and as we are sending after that some data for motors “… ,$0\8,temp(7)\8,temp(8)\8]”
; it’s now too late to read all the data from the PS2 controller
; because there’s already some bytes sent by it and lost (no buffer here).
high SEL
;-----------------------------

;-----------Basic Micro IDE terminal----------
; sending carriage return (CR = 13) and the PS2 mode(hex) to the PC
serout S_OUT,i57600,[13, hex2 mode\2] ; Basic Micro IDE <= 02.2.1.1
'serout S_OUT,I8N1_57600,[13, hex2 mode\2] ; Basic Micro IDE <= 05.3.0.0
;serout S_OUT,i57600,[13, hex2 mode\2] ; Basic Micro Pro IDE <= 08.0.1.7

for index = 1 to 18 ; temp(0) contains a dummy variable so we don’t send it to the PC
; sending all the data to the PC
serout S_OUT,i57600," “, dec3 temp(index)\3] ; Basic Micro IDE <= 02.2.1.1
'serout S_OUT,I8N1_57600,” “, dec3 temp(index)\3] ; Basic Micro IDE <= 05.3.0.0
;serout S_OUT,i57600,” ", dec3 temp(index)\3] ; Basic Micro Pro IDE <= 08.0.1.7
next
;-----------------------------

goto main[/code]

Your first post says you are using a madcatz controller and now you are saying you are using a lynxmotion controller, so which is it. :wink:

I thought that the lynmotion controller was made by Madcatz. (Ok, i must have come up with that on my own digit :blush: )
(just added this in) here it is

But regardless, i’m using the lynxmotion controller advaliable on this website.

Can you post some simple code that will make the viberation motors work so i can see if my controller is fully functional? Everything else works great.

Bane

I was hesitant to get involved with helping you troubleshoot a madcatz controller. :wink:

time elapsed…

Ok I have good news and bad news.

The bad news is it doesn’t work on my testing here either.

The good news is I will ask Laurent to look into it.

Yes!! For once i’m not going insane! (i’ve tried alot of things)

I’ll be looking forward to your research. :smiley:

bane

Hello Bane,

I have tried all code modifications i can think of…with no positive result :cry:
sorry for this issue :unamused: :blush:

Hmm, thats interesting :confused: . Do you know if enabling the viberation motors is even possible with the lynxmotion controller? Just out of curiosity, was this tutorial ever done by anyone else that had trouble. I find this odd being that all the other tutorials haven’t gave me any trouble :frowning: .

Bane

This remains a mystery to me. Both Laurent and I thought this worked in the past. It’s possible that the second batch of controllers we received didn’t have this feature, but it’s really difficult to nail down. We are still working on it.

Are there any modifications made to this controller?

bane

No modifications, it’s a genuine imitation PS2 games controller. 8)

Do you mean that you made the tutorial on a different brand controller? If so…that sux, i had a great idea for a robot.
:cry:
Bane

Yes the original code was written for the MadCatz controller and also verified with the Sony brand one. I am working with the mfg to get some help. I don’t know if we will be successful but we are trying.

Sony will never release any code examples for the controllers. All of the code commands we are using were found on the internet a long time ago. They were posted by people who have attempted to reverse engineer it. We continue to fine tune and further modified the code to fix inaccuracies.

Because the motors work on the PS2 console then it’s just a matter of fine tuning our code to make it work. This is easier said then done.

any luck?

is there anything i can do to help?

Bane

Nothing yet. With the language barrier, the competition, the Sony factor… I will prod them again.

question: why do you have the green connected to VS in this picture? http://www.lynxmotion.com/images/assembly/eh3rv2/big/eh3r12b.jpg

Can i get a controller that will work or should i hunt for one of those good old controlles :wink: .

Bane

The green wire is used on some controllers for the vibrating motors. However on the Lynxmotion ones the wire is not used.

Over the week end i got the viberation motors to work with this code:

However, i can’t get control of any bottons or the d pad. Only have limited control of right and left joys.

[code]DAT con P4
CMD con P5
CLK con P7
SEL con P6

temp1 var byte
index var byte
temp var byte(21)
cntr var byte
mode var byte

small var byte
large var byte

high CLK

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$43\8,$0\8,$1\8,$0\8] ;Config Enable
high SEL

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$44\8,$00\8,$01\8,$03\8,$00\8,$00\8,$00\8,$00\8] ;Set Mode and Fix(Analog
high SEL

pause 100

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$4D\8,$00\8,$00\8,$01\8,$ff\8,$ff\8,$ff\8,$ff\8] ;Vibration Enable
high SEL

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8] ;Config Exit
high SEL

main

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8]
shiftin DAT,CLK,FASTLSBPOST,[mode\8]
high SEL

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8]
for index = 0 to 2
shiftin DAT,CLK,FASTLSBPOST,[temp(index)\8]
next
high SEL

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8,$0\8,large\8,small\8]
for index = 3 to 6
shiftin DAT,CLK,FASTLSBPOST,[temp(index)\8]
next
high SEL

serout S_OUT,i57600,[13,hex2 mode\2]
for index = 1 to 6
serout S_OUT,i57600," ",dec3 temp(index)\3]
next

small = temp(7)
large = temp(8)
goto main[/code]

please help, i’ve tried a lot of things and i just can’t seem to get viberation and full control all at once!

Bane

I asked Laurent to look at your code to see if you may have found something here.

Hey Bane ! you found something,

using “old” PS2 DualShock 1 mode ($73) makes the Lynxmotion Pad to be able to vibrate :stuck_out_tongue: .

so, here’s some explanations about your program which was not working :

  • Temp( 7 ) and temp( 8 ) were not read, so they were filled with random values
  • using for-next loop is too slow to read PS2 flow, so we must read all data within a line
  • “large” and “small” variables were inverted in the “shiftout” line, the first one to be sent is “small” then “large”

some pauses are added
temp array is reduced to 7 bytes
temp1 and cntr variables deleted

please note :
using DS1 mode ($73), all buttons are numeric, no more analog.
so here’s the corrected code (SEL and CLK lines were swapped to see pin assignment incremental)

Thanks for your help solving this :wink:

[code]; PS2 Controller Program for BB1/BB2
; PS2 mode $73, Dualshock 1 mode, compatible with DS1 and DS2 PAD
; 16 numeric buttons and 2 X 2 axis analog joysticks
; vibration compatible with PS2 Lynxmotion controller
;
; push right arrow to enable the small vibration motor (only “on” or “off”)
;
; push left arrow to allow the large vibration motor, keep pressed
; then move the right joystick vertically to control the large motor speed

;BotBoard I
DAT con P4
CMD con P5
SEL con P6
CLK con P7

; BotBoard II
;DAT con P12
;CMD con P13
;SEL con P14
;CLK con P15

index var byte
temp var byte(7)
mode var byte

small var byte
large var byte

high CLK

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$43\8,$0\8,$1\8,$0\8] ;Config Enable
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$44\8,$00\8,$01\8,$03\8,$00\8,$00\8,$00\8,$00\8] ;Set Mode and Fix(Analog
high SEL
pause 100

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$4D\8,$00\8,$00\8,$01\8,$ff\8,$ff\8,$ff\8,$ff\8] ;Vibration Enable
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8] ;Config Exit
high SEL
pause 1

main

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8]
shiftin DAT,CLK,FASTLSBPOST,[mode\8]
high SEL

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8]
shiftin DAT,CLK,FASTLSBPOST,[temp(0)\8,temp(1)\8,temp(2)\8]
high SEL

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8,$0\8,small\8,large\8]
shiftin DAT,CLK,FASTLSBPOST,[temp(3)\8,temp(4)\8,temp(5)\8,temp(6)\8]
high SEL

serout S_OUT,i57600,[13,hex2 mode\2]
for index = 1 to 6
serout S_OUT,i57600," ",dec3 temp(index)\3]
next

small = 1 - temp(1).bit5
if temp(1).bit7 then
Large = 0
else
large = 255 - temp(4)
endif

goto main[/code]

Yes! It’s about time things start working on my project :smiley: .

Are you saying that its not possable to have temp array to 19 bytes (full capasity of controller)?

If not, can i just make the modification to the code that the viberation doesn’t work on?

Thanks for helping me out on this, i spent quite a bit of time fooling around with the code (with no clue what i’m doing :imp: ), I’m still a noob at all this advanced basic coding.

Bane