Lynxmotion Tech Support

www.lynxmotion.com
It is currently Sun May 19, 2013 7:17 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Wed Jan 04, 2012 5:29 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
Hi Jim,

I was following your tutorial on how to synchronize the Lynxmotion wireless playstation controller and ran in to a problem. I am using the Bot Board II. I have a brand new 9V battery powering the board. The results are only FF 255. The receiver and controller red LEDs blink. The green LED on the receiver is solid on. Included is a pic of the setup and my code.

Thank you for your help!

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

'declare variables
temp var byte(19)
mode var byte
index var byte
R2 var bit
L2 var bit

;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

L2 = temp(17)
R2 = temp(18)
;-----------------------------

;-----------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 <= 05.3.0.0

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 <= 05.3.0.0

next
;-----------------------------
goto main


Attachments:
results.PNG
results.PNG [ 12.34 KiB | Viewed 723 times ]
2012-01-04_17-10-56_732.jpg
2012-01-04_17-10-56_732.jpg [ 1.17 MiB | Viewed 723 times ]
Top
 Profile  
 
PostPosted: Wed Jan 04, 2012 6:05 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
This part of the code says it will talk to the PS2 controller on these pins.

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

But you have them connected to 4,5,6,7 I think...

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
PostPosted: Wed Jan 04, 2012 6:14 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3141
Location: Online @ innerbreed.co.uk
Attachment:
abbimageShot.JPG
abbimageShot.JPG [ 52.68 KiB | Viewed 715 times ]

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Wed Jan 04, 2012 8:59 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3141
Location: Online @ innerbreed.co.uk
you will need to remove the ps2 from those pins and connect them to pins 12,13,14,15 as stated in the code.
Attachment:
PS2.JPG
PS2.JPG [ 17.2 KiB | Viewed 706 times ]

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Thu Jan 05, 2012 9:24 am 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
Thank you for the help!

I know am receiving the same results as the tutorial.

The red LEDs on the receiver and remote still blink. Do you think the remote is defective?

thanls!


Attachments:
results2.PNG
results2.PNG [ 8.94 KiB | Viewed 698 times ]
Top
 Profile  
 
PostPosted: Thu Jan 05, 2012 10:10 am 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
I got it all fixed and working. Thanks!


Top
 Profile  
 
PostPosted: Thu Jan 05, 2012 10:49 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
:shock: What was it!

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
PostPosted: Thu Jan 05, 2012 2:50 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
I moved the receiver to pins 12-15

thanks


Top
 Profile  
 
PostPosted: Thu Jan 05, 2012 3:26 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Awesome! 8) thanks

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group