Page 1 of 1

CommLinkUSB

Posted: July 3rd, 2015, 4:25 pm
by Greg
Build your own USB version of the Comm Link ISA card, info: https://github.com/gpoteau/CommLinkUSB

Re: CommLinkUSB

Posted: July 3rd, 2015, 5:29 pm
by Shadow
Very cool. Thanks for sharing!

Re: CommLinkUSB

Posted: July 13th, 2015, 5:47 am
by CosmoGuy
Great job bro, will try to make that board myself :D

Re: CommLinkUSB

Posted: July 13th, 2015, 11:16 am
by Greg
Thanks, soon I will finish to add all features to PSEXEU and I will work on XLinkUSB ( USB link for xplorer / xploder ).

Re: CommLinkUSB

Posted: July 13th, 2015, 11:49 am
by Shadow
Greg wrote:Thanks, soon I will finish to add all features to PSEXEU and I will work on XLinkUSB ( USB link for xplorer / xploder ).
Let me know if you get the 'XLinkUSB' running. We can get some cartridges made that will become the long and overdue "PSX Blaster" based on your hardware :P

Re: CommLinkUSB

Posted: July 18th, 2015, 4:30 pm
by sickle
What's the plan with XLinkUSB, Greg?

I tried using LTP emulation with catflap over a serial connection, but obviously having to send the Strobe/Ack sequence values in the same stream slowed things down lots... and it's already pretty slow.

On the other hand using a buffer between the two meant rewriting every routine on catflap's end to dump all the data to the board's memory, then programming the board to deal different Strobe/Ack sequences (e.g. upload, download, reset, pause, etc), buffering return values and the likes. Caetla just further complicates things with it's weird ordering and ack table.

I even toyed with connecting the board to both the parallel and serial ports so the cart can be triggered to reset/read/write/etc while your program is running, but again, it's a bit messy and on my board at least needs softserial.

I don't fully understand what's going on from the schematic/binaries, but I'm guessing one of the boards is being used as some kinda transparent USB->tty serial interface... but then what? Does the other board translate in realtime or buffer up and run the upload sequence? What commands does it actually support? What sort of speed can we get?
(but hey, at least the Xplorer already has a pair of 74hc373's so we dont need the 74hc573's)

If I had an arduino style board like the R3 but with about ~3mb of RAM and a slightly beefier processor I'd be pretty happy rewriting catflap to handle some kinda protocol like
->command=upload,length=0x1234,loc=0x1234,pc=0x80010000
<-ready
->[data]
<-complete / fail
[card uploads to XPlorer]
<-25%
<-50%
<-75%, etc
<-jumping to 0x80010000
[card executes jump on Xplorer]

Would all be a nonissue if I just went ahead and used the serial but, y'know I enjoy developing ROMs and XFlash kicks all kinds of ass. I tried contacting Tim (author) to grab the source and maybe add serial support, but I can't get ahold of him :\

Re: CommLinkUSB

Posted: July 19th, 2015, 8:52 am
by Greg
@sicklebrick
Let's start by the speed result ;-)
I love inc^lightforce's rectangle demo: http://www.psxdev.net/forum/viewtopic.p ... demo#p1972, so I used it as a bench mark, here the results.

Filename : rect.psx
Filesize : 192512
--Transfer size : 0x0002E800

Code: Select all

╔═════════════════╤═══════════════╤═══════════════════╗
║Software         │Time in Second │Hardware           ║
╠═════════════════╪═══════════════╪═══════════════════╣
║PSXSERIAL 1.3    │20 Seconds     │Serial Cable       ║
╟─────────────────┼───────────────┼───────────────────╢
║Catflap 2.36 PAR │1.5 Seconds    │ISA Comm Link Card ║
╟─────────────────┼───────────────┼───────────────────╢
║Catflap 2.36 XP  │8.562 Seconds  │Printer POrt       ║
╟─────────────────┼───────────────┼───────────────────╢
║PSEXEU.EXE       │1.688 Seconds  │CommLinkUSB        ║
╚═════════════════╧═══════════════╧═══════════════════╝
Now heavy load result

Filename : trex.psx
Filesize : 1316864
--Transfer size : 0x00141000
Pxexeu.exe : Time 7.031 Seconds

The board is a replication the comm Link ISA card, I just change the chip that communicate with the ISA port by a mcu that support usb natively, to resume it's a pure usb device, that why it can achieve those pretty speed.

For the command it's just a few:
send 1 byte receive 1 byte: useful for sending command to the caetla or check state, other than that it's to slow.
Bulk send or bulk receive: minimum size 64Byte, No max size, for send and receive big block
send and receive [2Byte to 64Byte variable size].

The XLinkUSB's hardware must be more simple than the CommLinkUSB, I have to check the voltage at the Xplorer pin to know if the mcu can handle it.

About Arduino, I still has the sketch from the earlier version of CommLinkUSB. ;)
It was a long way to arrive at the actual version; BAsic Stamp for the proof of concept, arduino for the speed up, FTDI chip in native usb, Atmega 2313 with soft usb (low Speed 1.5Mbit no bulk transfer), and finally Atmega32u4 hardware USB support (Full Speed 12Mbit).

Re: CommLinkUSB

Posted: July 19th, 2015, 3:32 pm
by Shadow
Reckon you could design the PCB into a 2 layer board that is a self contained cartridge?
Also, does it work with PSEXE.COM? (I'd imagine it would).

Re: CommLinkUSB

Posted: July 21st, 2015, 10:33 am
by Greg
Shadow wrote:Reckon you could design the PCB into a 2 layer board that is a self contained cartridge?
Also, does it work with PSEXE.COM? (I'd imagine it would).
Yes it's possible, but the cartridge's connectors are hard to found.
About PSEXE.COM, it does not work, but I already write a new software like PSEXE.COM, name PSEXEU.EXE (Just add a U for USB ;) ) same functionality as PSEXE.COM, actually I work on some features like the < -C Console Mode >....

Re: CommLinkUSB

Posted: July 21st, 2015, 11:24 am
by danhans42
Fantastic work, I have been wanting a USB solution for years :-)

Just have a quick question, Its probably no, but will ask anyway..

I already have a few ATMEGA AT32U4 based boards lying around, they go under the name AT32U4 Pro Micro.. Would it be possible to use one of these in lieu of the Adafruit board? It 5V and 16MHz but unsure if the correct IO pins are broken out or not?

Cheers

Re: CommLinkUSB

Posted: July 21st, 2015, 12:45 pm
by Greg
danhans42 wrote:Fantastic work, I have been wanting a USB solution for years :-)

Just have a quick question, Its probably no, but will ask anyway..

I already have a few ATMEGA AT32U4 based boards lying around, they go under the name AT32U4 Pro Micro.. Would it be possible to use one of these in lieu of the Adafruit board? It 5V and 16MHz but unsure if the correct IO pins are broken out or not?

Cheers
Yes it's suppose to work if those following pins are availables:

PE6 ( Use for Led, even if you do not use a led on the pin, make sure it's free )
PB0, PB1, PB2 ( use for Flag: Write, Read, Status)
PD0-PD7 (use for Data D0-D7)

If this is the case you can use the firmware: ADAFRUITU4.hex
If not, you just need 11 I/O Pins, and I will write a firmware for you particular board.

Re: CommLinkUSB

Posted: July 21st, 2015, 8:12 pm
by danhans42
Hi Greg

Thanks for the reply, I believe this is the schematic for the board I have.

Image

Looking at it PE6 isnt used. PB0, PB1 and PB2 are available. PD0 through to PD7 are also available with the exception of PD5 which is wired up as a Tx LED.

It also uses a different bootloader to the boards listed, it detects as an Arduino Micro

Image

Thanks Dan

Re: CommLinkUSB

Posted: July 21st, 2015, 8:29 pm
by sickle
Greg wrote:...About PSEXE.COM, it does not work, but I already write a new software like PSEXE.COM, name PSEXEU.EXE
Aah, this is what I was getting at - because you're doing pretty specific sequences like send, recv, send, send, recv send and the card will lock up if you get it wrong it's a bit of a pain modifying older software to handle more straightforward serial-style comms.

With Caetla for example, the following rapidly toggles "PC is in control"... I use this to test:

Code: Select all

  
  doByte( 'C' );
  backAck();
  
  doByte( 'L' );
  backAck();
  
  doByte( 02 );
Or this to jump to $BFC00000

Code: Select all

  
  doByte( 'C' );   //Sends byte (strobes pSelect high)
  backAck();      //
  
  doByte( 'L' );
  backAck();
  
  doByte( 0x17 );

  doByte( 0xBF );
  doByte( 0xC0 );
  doByte( 0x00 );
  doByte( 0x00 );
  //Don't need to ack anything since the machine has just reset

Where backAck() reads a byte back a little like this:
(The tables/ack/nAack routines are based on Catflap/X-Killer's routines with the 8x8 table)

Code: Select all

    
    void backAck(){
      
            int in1,in2,in3;
            
            in1 = XpAck1();
            goHigh(); //sets pSelect hi
            
            in2 = XpAck1_N();
            goLow(); //sets pSelect lo
            
            in3 = XpAck1();
            goHigh();
            
            XpAck1_N();
            goLow();
            
            XpAck2_N(); 
            //Fuckit?
            
            returnByte=( ((in1&0x30)<<2) | (((~in2)&0x80)>>2) | ((in2&0x30)>>1) | (((~in3)&0x80)>>5) | ((in3&0x30)>>4) );
    }
(Sending a byte just does the regular goHi(), XpAck1(), goLow(), XPack2() sequence if you're using Catflap terminology)

Meaning you can't get away with just a stream of characters unless every second character was a control character to determine the other pins @ 0x379 & 0x37A and telling it when to read. Kinda like this?

'S' 'C' //Send 'C'
'R' 0 //Read a value
'S' 'L' //Send 'L'
'R' 0 //Read a value
'S' 0x17 //send 0x17 ('jump')
'S' 0xBF
'S' 0xC0
'S' 0x00
'S' 0x00

Or have you made an LPT replacement driver/protocol over USB (you mentioned true USB vs USB->Serial driver)... so for example something like this would be trapped, sent over USB and the board would emulate the DB25 pin states?

__ASM{
mov al,40h
mov dx,0x378
out dx,al
}

'Cause if that were true, then the old PSEXE.COM should work fine...

How does it actually work? >.< heheh

Re: CommLinkUSB

Posted: July 22nd, 2015, 7:56 pm
by Greg
@danhans42
According to the schematic, PD6 is not used, it will be not easy to connect a wire directly to the chip, the better option is to map new ports and rewrite the firmware, I will tell you when it's done.

Re: CommLinkUSB

Posted: July 22nd, 2015, 8:04 pm
by Greg
@sicklebrick
I plan to make a prototype of XLinkUSB and do some test this weekend, I will give more details after.

Re: CommLinkUSB

Posted: July 22nd, 2015, 8:37 pm
by danhans42
Thanks Greg.

These boards are very cheap, around £4 so would cut down the cost of making these adaptedlrs quite a bit, as the teensy and adafruit boards are around £17 here in the UK.

I have the other parts in the mail so will be able to test it quite quickly.

Look forward to giving it a whirl.

Thanks

Re: CommLinkUSB

Posted: July 23rd, 2015, 8:12 pm
by sickle
Greg wrote:@sicklebrick
I plan to make a prototype of XLinkUSB and do some test this weekend, I will give more details after.
Awesome, can't wait!

Re: CommLinkUSB

Posted: July 23rd, 2015, 11:06 pm
by danhans42
I'd love a decent dev board hanging off the back of a cart so could do code upload over ethernet or WiFi and doing away with cables altogether. Something like a raspberry pi or Edison board would be cool, would be like a ps1 tool almost :-)

I've been experimenting with an esp8266 board on the serial port for code upload but haven't made much progress thus far.

Re: CommLinkUSB

Posted: July 24th, 2015, 1:59 am
by Greg
I had a raspberry pi approach, but the need of a Logic Level Converter made me search for a cheaper solution. The PAR/XPLORER are 5v signaling, and the Pi's GPIOs are 3.3v
But use the Pi still could be a cool project.

Re: CommLinkUSB

Posted: July 25th, 2015, 9:51 am
by Yuri^Cybdyn
hmm, we have on psio mcu w/ usb 2.0 and fpga for xfer buffer. so speed is quite fast if aim is to load ps-exe, or excahnge data. we even can play games w. video in games/
ok, it's not cheap way, enad easy to DYI... but idea add some wireless comuniation is interesing)))

for such case like DYI, we unfortunatelly didnt finish usb-expolorer. it uses FTDI chip and few logic ic. and big advantage is direct bus acceess to FTDI chip. so if use some of last version w/ usb 2.0 support like 2232 we can get fast and cheap hw for data exchange.

just my 2 cents