Lynxmotion Tech Support

www.lynxmotion.com
It is currently Fri May 24, 2013 9:13 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Aug 07, 2011 1:36 pm 
Offline
Roboteer

Joined: Sun Aug 07, 2011 12:51 pm
Posts: 4
Hi,

I'm starting off in robotics and I've just bought a bot board 2, BS2 and a PS2 robot controller.
The BS2 and the bot board are working fine, but I just don't quite get how to program the PS2 controller.

I have two questions which I hope you will be able and willing to answer :
1) Where do I plugin in the controller's green wire ?
2) Which software, language and libraries should I be using to get started ?

Thanks in advance for your help.


Top
 Profile  
 
PostPosted: Mon Aug 08, 2011 11:51 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
We have sample code for running the PS2 from a BS2 using the older version of the Bot Board. Earlier versions of the board had the inverter for the clock line (iirc) But the current Bot Board II does not. There is a software fix, but it takes a lot of the BS2's already anemic resources to make it work. Not anything left over for the application.

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


Top
 Profile  
 
PostPosted: Mon Aug 08, 2011 3:34 pm 
Offline
Roboteer

Joined: Sun Aug 07, 2011 12:51 pm
Posts: 4
First, thanks for helping me! :mrgreen:

I've found a good program,:

Code:
'{$STAMP BS2}
clk CON 7
att CON 6
dat CON 4
cmd CON 5
PS2B1 VAR Byte
PS2B2 VAR Byte
PS2B3 VAR Byte
PS2B4 VAR Byte
PS2B5 VAR Byte
PS2B6 VAR Byte
char VAR Byte
temp1 VAR Word
temp2 VAR Word
temp3 VAR Byte

' Read PS2 Controller
read_PS2

LOW att

SHIFTOUT cmd, clk, LSBFIRST, [$01,$42]
SHIFTIN dat, clk, 3, [char]
temp3 = char

SHIFTIN dat, clk, 3, [char]
PS2B1 = char

SHIFTIN dat, clk, 3, [char]
PS2B2 = char

SHIFTIN dat, clk, 3, [char]
PS2B3 = char

SHIFTIN dat, clk, 3, [char]
PS2B4 = char

SHIFTIN dat, clk, 3, [char]
PS2B5 = char

SHIFTIN dat, clk, 3, [char]
PS2B6 = char

HIGH att

temp1 = ((PS2B3 * 4) + 250) MIN 350 MAX 1150 'MIN 250 MAX 1250
temp2 = ((PS2B4 * 4) + 250) MIN 350 MAX 1150 'MIN 250 MAX 1250

PULSOUT 12, temp1
PULSOUT 13, temp2
PAUSE 20

' DEBUG DEC temp1, " ", DEC PS2B3, " ", DEC temp2, " ", DEC PS2B4, CR
' debug dec temp3, " ", cr
' DEBUG BIN PS2B1, " ", BIN PS2B2, " ", DEC PS2B3, " ", DEC PS2B4, " ", DEC PS2B5, " ", DEC PS2B6, CR

exit_read_PS2

GOTO read_PS2

RETURN


http://www.lynxmotion.com/images/html/build036.htm

But instead of having 255 255 128 121 134 139
I' ve got 0, 255, 1111111,...
Is my PS2 controller not working properly ?


Top
 Profile  
 
PostPosted: Mon Aug 08, 2011 4:58 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Yes that is the program we used when the Bot Board had the inverter for the BS2. It no longer has the inverter on the clock, so the program will no longer work. You need an Atom Pro. Ther BS2 can't be used without making a hardware modification... the inverter. ;)

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


Top
 Profile  
 
PostPosted: Tue Aug 09, 2011 3:45 am 
Offline
Roboteer

Joined: Sun Aug 07, 2011 12:51 pm
Posts: 4
Can't I do anything?
Because Robotshop says:"Excels with the Basic Atom or Basic Atom Pro, accepts all BS2, OOPic-C or BasicX microcontrollers"
Should I ask robotshop what to do?


Top
 Profile  
 
PostPosted: Tue Aug 09, 2011 9:08 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
I have told you what you need to do more than once. Make an inverter using a transistor or a logic gate. When the clock is inverted it will work. The statement robot shop has made does not specifically mention ps2, so there's nothing to get on to them about. Robot Shop does not know the intimate technical details, they are just a reseller. You are at the right place to get the help and information you need. If you don't want to make an inverter then you need an Atom Pro.

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


Top
 Profile  
 
PostPosted: Wed Aug 10, 2011 10:43 am 
Offline
Roboteer

Joined: Sun Aug 07, 2011 12:51 pm
Posts: 4
Ok thank you for helping me.

But were should I plug the transitor and which transitor should I use?


Top
 Profile  
 
PostPosted: Wed Aug 10, 2011 11:17 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
You might want to google up the subject. Usa a 2N4401 or 2N3904 or 2N2222. Use 10k on the input and 1k on the output. Use this circuit.

Image

_________________
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  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users 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:  
cron
Powered by phpBB® Forum Software © phpBB Group