joymon - R/W/X-capable monitor over the controller port

Start a work log and update it occasionally with your projects progress
Post Reply
User avatar
socram
Verified
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: Mar 01, 2021
I am a: Programmer
PlayStation Model: SCPH-102
Location: Valencia, Spain
Contact:

joymon - R/W/X-capable monitor over the controller port

Post by socram » December 6th, 2022, 1:52 am

So debugging some quirky behaviour in tonyhax, and the classic process of copying the executable to a USB, then loading onto a PS2, running uLaunchELF, then copying onto the PS1 memory card, then booting the console, was getting old really fast.

A sensible person would've probably used something like a PS1 fat with a SIOCONS cable, to boot executables straight into the console's RAM. But I have no fat PS1, and I'm no sensible person :D

So first idea was "hey, maybe I could do something with an Arduino". Did it, much like what ackerman did (except I was unaware of his project), and then "hey, how far can I simplify this?". And this is what I ended up with.
20221205_152045.jpg
That ominous "M" (for "monitor") is a small, 1KB monitor code written in pure assembly. It that talks over the controller ports, and it needs no Arduino or any special part. All you need is a regular, off-the-shelf 3V USB-UART adapter, a controller cable, and a singular 1N4148 diode.
bitmap.png
Since it can be launched from either a CD-R or FreePSXBoot, this project is thus fully capable of working on either a fat PS1, a slim PSone, and highly likely also every PS2 console. It works also at a very snappy 115200 bps, so you get a total of 11.5KB/s of throughput for loading binaries on the console's RAM.
terminal.png
The computer-side part of things is a very small Python library which is capable of reading, writing and executing from arbitrary memory locations, and load and execute PS-X EXE files. The protocol is really simple, so it can be implemented also in any other language you can prefer.

Available at: https://github.com/socram8888/joymon
You do not have the required permissions to view the files attached to this post.
Last edited by socram on December 6th, 2022, 12:53 pm, edited 2 times in total.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 535
Joined: Nov 12, 2012
Contact:

Post by nocash » December 6th, 2022, 4:40 am

Nice simple beautiful design. I guess a lot of people are much too focused on transferring the Data through the DATA pin, and won't consider to use any of the other pins instead.
Last edited by nocash on December 6th, 2022, 9:39 am, edited 1 time in total.

User avatar
socram
Verified
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: Mar 01, 2021
I am a: Programmer
PlayStation Model: SCPH-102
Location: Valencia, Spain
Contact:

Post by socram » December 6th, 2022, 9:16 am

Available here: https://github.com/socram8888/joymon. It's still quite rough, but does work.

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » December 6th, 2022, 9:35 am

This is awesome. While it's not that hard to add a serial port to PSOne, not having to open it makes this so much more awesome. Great job :clap

If you attach ESP8266 to it you could even get PSOne to Internet through the controller port :D
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
socram
Verified
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: Mar 01, 2021
I am a: Programmer
PlayStation Model: SCPH-102
Location: Valencia, Spain
Contact:

Post by socram » December 6th, 2022, 10:20 am

Shendo wrote: December 6th, 2022, 9:35 am While it's not that hard to add a serial port to PSOne, not having to open it makes this so much more awesome.
I know, but I didn't want to drill my console to put a serial connector! :D

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » December 6th, 2022, 10:52 am

socram wrote: December 6th, 2022, 10:20 am
Shendo wrote: December 6th, 2022, 9:35 am While it's not that hard to add a serial port to PSOne, not having to open it makes this so much more awesome.
I know, but I didn't want to drill my console to put a serial connector! :D
No need to drill anything. Just use Bluetooth or WiFi RS232.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Xavi92
Verified
C Programming Expert
C Programming Expert
Posts: 161
Joined: Oct 06, 2012
PlayStation Model: SCPH-5502
Contact:

Post by Xavi92 » December 6th, 2022, 11:40 am

Awesome job, socram! There is definitely some interesting, unexploited potential to the controller ports.

User avatar
masterg0r0
Active PSXDEV User
Active PSXDEV User
Posts: 61
Joined: Jul 18, 2021
I am a: Modder and Hobbyist Developer
Motto: Everything is hackable 100%!
PlayStation Model: 1002+7502
Location: United Kingdom

Post by masterg0r0 » December 6th, 2022, 4:33 pm

That looks epic. I'm going to try this out for myself.

ackerman
Curious PSXDEV User
Curious PSXDEV User
Posts: 29
Joined: Aug 21, 2019

Post by ackerman » December 9th, 2022, 12:12 am

Congratulations socram on the project.
Regarding the serial usb converter, is a specific model of FTDI chip required, with line inversion, or similar, or does any of them work?

User avatar
masterg0r0
Active PSXDEV User
Active PSXDEV User
Posts: 61
Joined: Jul 18, 2021
I am a: Modder and Hobbyist Developer
Motto: Everything is hackable 100%!
PlayStation Model: 1002+7502
Location: United Kingdom

Post by masterg0r0 » December 10th, 2022, 4:59 am

Do fake FT232RL chips work? It's just that I've got a few of them.

User avatar
socram
Verified
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: Mar 01, 2021
I am a: Programmer
PlayStation Model: SCPH-102
Location: Valencia, Spain
Contact:

Post by socram » December 11th, 2022, 6:55 am

ackerman wrote: December 9th, 2022, 12:12 am Congratulations socram on the project.
Regarding the serial usb converter, is a specific model of FTDI chip required, with line inversion, or similar, or does any of them work?
No line inversion required - regular UART with 3.3V for logical 1 and 0V for logical 0. The outputs are actually inverted but that's something that's taken care of in software by the monitor software by re-inverting them before sending/after receiving via the I/O pins.
masterg0r0 wrote: December 10th, 2022, 4:59 am Do fake FT232RL chips work? It's just that I've got a few of them.
Should do, yes. I'm using the cheapest USB UART I could get based on a CH340G.

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » December 11th, 2022, 10:34 am

socram wrote: December 11th, 2022, 6:55 am
ackerman wrote: December 9th, 2022, 12:12 am Congratulations socram on the project.
Regarding the serial usb converter, is a specific model of FTDI chip required, with line inversion, or similar, or does any of them work?
No line inversion required - regular UART with 3.3V for logical 1 and 0V for logical 0. The outputs are actually inverted but that's something that's taken care of in software by the monitor software by re-inverting them before sending/after receiving via the I/O pins.
masterg0r0 wrote: December 10th, 2022, 4:59 am Do fake FT232RL chips work? It's just that I've got a few of them.
Should do, yes. I'm using the cheapest USB UART I could get based on a CH340G.
I read that the fake chips don't work well on Linux, only on Windows. Is this the case with Joymon?

User avatar
socram
Verified
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: Mar 01, 2021
I am a: Programmer
PlayStation Model: SCPH-102
Location: Valencia, Spain
Contact:

Post by socram » December 11th, 2022, 9:28 pm

alexfree wrote: December 11th, 2022, 10:34 am I read that the fake chips don't work well on Linux, only on Windows. Is this the case with Joymon?
I've not tried that particular case. As long as it can send standard, non-inverted data on the data pins it should work with joymon.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 535
Joined: Nov 12, 2012
Contact:

Post by nocash » December 12th, 2022, 2:38 am

socram wrote: December 6th, 2022, 1:52 amIt works also at a very snappy 115200 bps
Did you try faster transfer rates, too? Ackerman mentioned reaching "71680 bps" on the SPI data lone (=144360 bps on the SPI clock line). So the upper limit might be near 144360 bps, or perhaps faster when removing the 100pF capacitors in the console.

User avatar
socram
Verified
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: Mar 01, 2021
I am a: Programmer
PlayStation Model: SCPH-102
Location: Valencia, Spain
Contact:

Post by socram » December 12th, 2022, 10:23 am

nocash wrote: December 12th, 2022, 2:38 am Did you try faster transfer rates, too? Ackerman mentioned reaching "71680 bps" on the SPI data lone (=144360 bps on the SPI clock line). So the upper limit might be near 144360 bps, or perhaps faster when removing the 100pF capacitors in the console.
I really did not try any other speed, other than 115200.

I settled from the very beginning on 115200 because:
  • It's a very commonly used speed which every USB UART device supports
  • Leaving enough leeway for processing - 115200bps leaves 294 instructions between each byte for further processing, like checksumming transmissions (which I am implementing in another branch)
  • It's reasonably fast
I did not have a scope to poke on the data lines, when I did this so I didn't want to push the data speeds too high either.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests