Johnny 5 and PS2 not communicating

I won a Johnny 5 in a raffle (thanks Precision Motion Devices) and hav spent the last couple of weeks assembling the robot. While I was doing that I have been browsing the forums and got the idea I could a PS2 controller to control the robot wirelessly. It was not till after I received the controller that I realized this was not common practice but I have the controller so I will make it work (though not without some help). :slight_smile:

So I tested the SSC-32 and everything seems to work other than the visual sequencer V1.16 says there is no EPROM I think I have the wrong firmware SSC32-V2.03XE.
SSC32 Jumpers TX RX VS1+=VS2+ and VS1-=VS2- all in VS=VL Out

Then I connected the BOT Board II (with Atom Pro 28) to the battery and tried to connect the PS2 controller as per a tutorial I had read. It kinda worked but I don’t see the values change when I press the buttons. Someone posted the same problem and the advice was to repeat the tutorials and see where a problem is first noticed.
BOT Board II Jumpers All I/O to +5V, Speaker IN, VS=VL IN A, B and C OUT

So I went to:
Built147htm (link removed)

Which should cause a count to appear on the terminal (which it does) and cause the speaker to beep (which it does not).

I also loaded and ran the Bot Board Testing program which ran without error,

Finally when I loaded and ran the PS2 comm program (from this tutorial build034htm (again link removed)) and

my terminal looked like the example but there is no change when I press the buttons or move the joy stick. It is a wireless controller and cable harness from Lynxmotion. The receiver Green light is on solid and the Red light is flashing steady. Sometimes the Red light on the controller flashes, I am not sure what causes this. It worked briefly while writing this the stopped working.

This is what I see in the terminal window:
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000

I have tried to attach photos but the system says they are invalid. OK so this morning I read the part about no links or pics for 24 hrs, more details tomorrow.

Images would help so we will wait. All this information is great, but when it comes time to troubleshoot we will need to focus on one tutorial. We will verify the wiring and jumper settings. If you have access to an old PS2 system it can be used to test the controller as well.

Yes the reason SEQ does not see the eeprom is because the GP firmware needs to be installed.

Quick note:

The PS2 data that was printed out, looks correct to me.

That is it is showing you are in Analog mode with 9 extra words of data, that no buttons are pressed, that the joysticks are centered and there is no pressure on any of the buttons.

So it sounds like to me that the part of the PS2 is working, but that the transmitter/receiver are not communicating properly. First thing I would check is fresh battery in transmitter.

Next I would check that the receiver is getting +5v and not VS. Been hit by this before…

It is also probably not the issue, but I have also had issues before if you ask the PS2 for data too often, it does not leave it time to talk to the transmitter and adding a pause fixes this. But since the data is being printed, I doubt that this is it.

Kurt

Also here is a thread of a guy who made a similar in scope bot. You might be able to get some ideas from his code. viewtopic.php?f=20&t=6805

After talking to Jim, the card is on its way back to Lynxmotion.

Hey Guys,

I received the card back and it seems to work correctly but I still cannot connect to the wireless controller.

I have looked through the forums but cannot find anything that addresses being connected to the receiver but not communicating to the actual controller.

Here is the code of the test program:

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

This was copied straight from a forum and the appropriate sections are uncommente (the last two serout commends)

This should give me the input data on the Terminal window, but just like before all I get is:
79 255 255 128 128 128 128 000 000 000 000 000 000 000 000 000 000 000 000

Same as before. On the receiver, the green light is on steady and the red light flashes. On the controller the red light flashes.

At one point it was working but the it quit and I noticed one of the Black wires had pulled out of the pin and the white wire did not seat correctly in the header so I removed all the pins, re soldered the loose ground wire and connected the individually

At this point I am out of ideas and could use some direction. The two images should show jumper settings.


Pullup resistors?

Alan KM6VV

KM6VV, I thought the pullup resistors were part of the BB2, that is why they use those pins.

Yes BB2 has PU resisters on P12 and P15. I am not sure about the order of your IO pins. Does not match any color schemes I know for these connectors.

Kurt

I metered the wires back to the connector for the receiver then using this tutorial:
lynxmotion.com/images/html/build034.htm
I mapped the colors to these signals:
Black Ground
Red +5 V
Brown DAT
White CMD
Yellow ATT
Blue CLK

I do not have a PS2 so have no way to test the controller

We can test the PS2 controller for you if you send it to us. I’m scared off by the cable. You really need to add heat shrink to protect them from shorting together.

Sorry, despite recent economic news I have been very busy at work.

Yes about the heat shrink. The board is off the unit at the moment so I can work on one issue at a time, but there may be a loose strand or something making life difficult so I will properly insulate before I post again - which will most likely be in 2 weeks.