PSP 1000 Analog Stick to Teensy LC

Hardware-related questions that don't fit into any of the specialized hardware categories go here.
User avatar
Robots86
Posts: 268
Joined: Thu May 05, 2016 1:18 am
Location: Birmingham, UK
Has thanked: 39 times
Been thanked: 28 times

PSP 1000 Analog Stick to Teensy LC

Post by Robots86 » Tue Jul 12, 2016 3:20 am

Hi sudomod.

I have a couple of psp 1000 analogs that i wanted to test. I haven't got a clue how to wire this up to the teensy apart from that they should go to the analog pins.... First of all I'm not sure what the solder points are on the back of the psp stick. Theres 4 solder points, i understand 1 is for ground, 5v and the other 2 are the axis. Anybody know of any guides i can refer to or have any guidance they can offer? Any help appreciated.

Thanks

User avatar
tent
Posts: 32
Joined: Thu Jul 07, 2016 4:40 pm
Has thanked: 6 times
Been thanked: 1 time

Re: PSP 1000 Analog Stick to Teensy LC

Post by tent » Tue Jul 12, 2016 4:03 am

I understood that the complete version here: http://sudomod.com/forum/viewtopic.php? ... &start=450
will support that from hw point of view and maybe even sw if they will manage to get the code on the atmega35 as well..
tent:wq

User avatar
tronicgr
Posts: 143
Joined: Tue Jun 07, 2016 4:26 pm
Has thanked: 95 times
Been thanked: 67 times
Contact:

Re: PSP 1000 Analog Stick to Teensy LC

Post by tronicgr » Tue Jul 12, 2016 6:55 am

You can see the code I use for my Teensy with joystick and d-pad here:

http://sudomod.com/forum/viewtopic.php? ... 1&start=10


Actually I use two extra buttons to emulate keyboard ESC and ENTER as well ;)

Thanks
Thanos

User avatar
Robots86
Posts: 268
Joined: Thu May 05, 2016 1:18 am
Location: Birmingham, UK
Has thanked: 39 times
Been thanked: 28 times

Re: PSP 1000 Analog Stick to Teensy LC

Post by Robots86 » Tue Jul 12, 2016 12:07 pm

tronicgr wrote:You can see the code I use for my Teensy with joystick and d-pad here:

http://sudomod.com/forum/viewtopic.php? ... 1&start=10


Actually I use two extra buttons to emulate keyboard ESC and ENTER as well ;)

Thanks
Thanos
Thanks mate that code should be a great help.

Can you help me identify what to solder where on psp stick? The solder points arnt labeled and i cant seem to find any info...
Thanks

User avatar
tronicgr
Posts: 143
Joined: Tue Jun 07, 2016 4:26 pm
Has thanked: 95 times
Been thanked: 67 times
Contact:

Re: PSP 1000 Analog Stick to Teensy LC

Post by tronicgr » Tue Jul 12, 2016 12:19 pm

Scroll more down on the page on the link I gave you, you will see a photo. And always you can check with a multimeter if you can read the max ohms value between the Vcc and Gnd pins of the potentiometer.

Thanks
Thanos

User avatar
fdeluxe
Posts: 71
Joined: Tue Aug 23, 2016 10:16 am
Has thanked: 12 times
Been thanked: 27 times
Contact:

Re: PSP 1000 Analog Stick to Teensy LC

Post by fdeluxe » Sat Sep 10, 2016 8:30 am

tronicgr wrote:You can see the code I use for my Teensy with joystick and d-pad here:

http://sudomod.com/forum/viewtopic.php? ... 1&start=10


Actually I use two extra buttons to emulate keyboard ESC and ENTER as well ;)

Thanks
Thanos
Hi, can you please tell me how you calibrated your Analogstick? The axis are not recognized probably. In Windows I was able to calibrate the stick using the driver properties in printers and devices. Is there any way to hardcode this onto the teensy? I noticed you added some calibration values, but those dont work for me. How did you obtain them?

User avatar
tronicgr
Posts: 143
Joined: Tue Jun 07, 2016 4:26 pm
Has thanked: 95 times
Been thanked: 67 times
Contact:

Re: PSP 1000 Analog Stick to Teensy LC

Post by tronicgr » Sun Sep 11, 2016 9:22 am

fdeluxe wrote:
tronicgr wrote:You can see the code I use for my Teensy with joystick and d-pad here:

http://sudomod.com/forum/viewtopic.php? ... 1&start=10


Actually I use two extra buttons to emulate keyboard ESC and ENTER as well ;)

Thanks
Thanos
Hi, can you please tell me how you calibrated your Analogstick? The axis are not recognized probably. In Windows I was able to calibrate the stick using the driver properties in printers and devices. Is there any way to hardcode this onto the teensy? I noticed you added some calibration values, but those dont work for me. How did you obtain them?
I got through max values by printing out to serial terminal the values as I was moving the pots to the max positions.

But there is another way to automatically scale them. You can read the center position while powering up, then double that number and use it as max. It's easy change to do if you want autocalibration on power up.

Thanks
Thanos

User avatar
fdeluxe
Posts: 71
Joined: Tue Aug 23, 2016 10:16 am
Has thanked: 12 times
Been thanked: 27 times
Contact:

Re: PSP 1000 Analog Stick to Teensy LC

Post by fdeluxe » Sun Sep 11, 2016 5:50 pm

[mention]tronicgr[/mention]

the map function only seems to remap the upper and lower bounds. But to calibrate my joystic I also net to remap the center postion. That means the mapping must not be linear. Here's what I mean:
whatimean.PNG
whatimean.PNG (223.28 KiB) Viewed 6205 times

User avatar
tronicgr
Posts: 143
Joined: Tue Jun 07, 2016 4:26 pm
Has thanked: 95 times
Been thanked: 67 times
Contact:

Re: PSP 1000 Analog Stick to Teensy LC

Post by tronicgr » Mon Sep 12, 2016 4:22 am

The potentiometers are not completely linear, that's true but the travel distance is too small to make much difference.

You can see the piece of code I used to scale the values I read

Joystick.X(map(analogRead(0),170, 853, 1023, 0));
Joystick.Y(map(analogRead(1),170, 853, 0, 1023));

The lower value I use is 170 which is same as 853 (low and high position of that axis). This is then scaled to full range on the output 0-1023 that the Joystick needs.

Thanks
Thanos

User avatar
fdeluxe
Posts: 71
Joined: Tue Aug 23, 2016 10:16 am
Has thanked: 12 times
Been thanked: 27 times
Contact:

Re: PSP 1000 Analog Stick to Teensy LC

Post by fdeluxe » Mon Sep 12, 2016 6:24 am

@tronicgr

My problem is that the max raw value of my stick for both axes is 1023, while the lower values lie somewhere near 200. When I remap like this

map(analogRead(pinX), 200, 1023, 0, 1023 )

the Stick is way of center. My thought was to add 1 maxValue to the low value and use it as fromHigh

map(analogRead (pinX), 200, 200+1023, 0, 1023)

Now the stick is centered, but it doesnt move over its full range.

Did you have a look at the screenshot I posted? The high and low values are noted in dxtweak

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest