PSX USB Host/Device Experiments

Start a work log and update it occasionally with your projects progress
Post Reply
danhans42
BANNED
BANNED
Posts: 330
Joined: Nov 28, 2012

PSX USB Host/Device Experiments

Post by danhans42 » October 23rd, 2020, 3:50 am

Its been a while since ive posted here, so thought I would update on something I have been working on.

Nicolas over on the discord mentioned a device that he had looked at that, that could provide USB device/host functions and was bus compatible with the PlayStation.

The device is the CH-376. There is a 375 version which is broadly the same, however it lacks FAT filesystem support, so went with the 376.

The first thing I did was to get it into the memory map.. which meant I needed something handle the address decoding. My initial experiments were with a Altera EPM240, as when I started out I was using an Raspberry Pi+CPLD for comms - however for this exercise its akin to using a sledgehammer to put a picture on the wall. Managed to pick up what I needed to in Quartus pretty quickly luckily.

Anyway, so the CPLD was replaced by an modern version of the PAL/GAL type devices, the ATF22V10. Cheap as chips at £1.40. So i managed to get WinCUPL working and learned that a bit, and I programmed that up for the following :-

1F000000 - 1F03FFFF 256KB FLASH
1F040000 USB CONTROLLER DATA
1F040001 USB CONTROLLER CMD
1F040002 USB CONTROLLER DATA / I2C CONTROLLER DAT
1F040003 USB CONTROLLER CMD / I2C CONTROLLER CMD

1F060000 ENABLE SWITCH
1F060002 USB CONTROLLER /INT PIN

Forget about the second controller/i2c for now. I used to have two CH's rigged up at the same time for development...
Image

Basically you may notice its similar to an xplorer. Reason being, you can repurpose the chip select from SRAM enable and use a CH module on an xplorer, rather than starting from scratch. Makes for a much tidier experience..
Image

Initially, I got USB working sending data back and forth. Thanks again to Nicolas for pointing me in the right direction, and managed to work up a quick example to transfer data back and forth.. USBtool was born.
Image
USBtool is basically like psxserial.. except its crazy fast in comparison, around ~350kb/sec. allows upload/download of memory, execution, memory viewing etc.

Next thing to look at is USB mass storage. So did some reading around.. the manufacturers datasheet are rubbish btw,
Started working up a simple file manager ; Working title is psx explorer, video below :-




I know its a little scant on detail, ill probably edit this post over time so its more complete. My goal is, once done.. to design a PCB for this, that can be made easily and built by the hobbyist. So you can add as little or as much as you like to it.

Hardware Goals
[*]Rewrite the code for the ATF22V, so it can incorporate a 74HC245 internally.
[*]Design a board which can house a 39SF040, ATF22V10, 2xCH376 and the NXP I2C Controller which will provide
2 grove connectors and an i2c RTC module(which provides a tiny amount of useful nvram too )
[*]Release the board design as open, so can be ordered by anyone. All thru hole design (apart from the I2C), so it can be populated as fully as needed.. or just even with an eeprom so it can be used for UNIROM.

At the moment, I will be concentrating on making usbtool as slimline as possible and have the option in it to load usb explorer from the USB drive itself when needed.

So.. what have I been using to do all this stuff?

c - Linux at the moment - on both Raspberry Pi and x64
wiringpi on the rpi for GPIO/CPLD experiments to start with
Quartus - initial experiments with an EPM240
PsyQ - PSX Side code (to start with)
PsyQ Parser libs + pcsx-redux/openbios - interim solution for PSX side code
nugget/helloworld_and_flappycredits example - by sickle. I have used this example a a foundation for my code now. Modern GCC and whatnot.. and no PsyQ code at all.

Big thanks to everyone on the discord who has been helpful with daft questions. Cant believe what ive picked up in the past 8 months..
You do not have the required permissions to view the files attached to this post.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests