Custom JVS I/O - MEGA JVS

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • There's a bit of a learning curve for milling PCBs. I think I'm on my 6th or 7th attempt after several redesigns. The biggest factors in my failures so far are end mills not up to the task and poor quality copper clad blanks with very thin copper. I'm certain my CNC machine is up to the task for high precision, but the v-bit I have just tears through the copper, ripping up traces if they're too thin.

      I just received an order of end mills that are supposed to be better for PCB milling and I've got a PCB designed with much larger traces than before. It's in the process of cutting now, but so far it's looking like it will be successful.

      Ugh, but I broke the drill bit that was the correct size for the holes, so I'll probably need to track down another... X/
    • Here is a dry fit of parts on my custom PCB. I will have to wait until I get a chance to solder parts on for testing and working on software.

      The upper USB port is the JVS port that would plug right into the game motherboard. The 4 pin header to the right takes the 5v and GND that plugs into the Sega IO board. Then there's a 60 pin header for the digital connector and a 40 pin for analog. The lower USB port would be used to plug into a PC for configuration/PC controls.

      It occurred to me that while I can turn it into a HID controller, I can only do that by flashing the onboard firmware and I would lose the normal serial connection to the board over USB. This can be remedied by either communicating with the board via another method (separate serial port or I2C) or keep the serial USB connection and come up with software on the PC side to read the serial data and translate to PC controls. I could maybe optionally introduce a slave device to manage HID standard over USB...
      Images
      • Pcb dry fit.png

        646.09 kB, 612×612, viewed 39 times
    • I've got my work cut out for me... I soldered my test board together, plugged it up and didn't get what I expected. I then realized I had wired up the JVS (USB Type B) port incorrectly, fixed that and still didn't get what I expected.

      Currently I'm testing with a Chihiro and it never registers that a JVS board is plugged up. :(

      So now I've got 2 Arduino Mega 2560's wired up with RS-485 modules to do a kind of loopback test and make sure I'm sending/receiving serial data correctly over these modules.
    • I'm not sure what to make of it, but I'm getting faulty data back in my loopback test. Though I succeed in both sending and receiving data on both modules and both Megas in one-way tests... It might be a timing issue on the loopback, but proving that I'm sending/receiving is sufficient for now. I'll see what, if anything, I receive from the Chihiro when wired up to it with my current serial communication code.
    • I made very little progress today in spite of messing around with this for a long time.

      I confirmed I can sniff the communication between the Chihiro and the Type 1 JVS board. At least I think it's both... The RS485 is in half duplex mode where all communication in both directions is done on the same wires. It's not like RS232 where there's a clear send and receive to tap into. I didn't record anything yet, so I don't currently have any logs to decipher.

      Where I seem to be running into issues on my emulator hardware is handling the Sense line. I've tried this the way it's done in the TeensyJVS project (set Arduino pin as input and use a diode to ground) and the SaturnJVS project (set pin as output and set high or low as needed - no diode). In either case I'm not seeing where the Chihiro is sending anything after the Reset command, making me believe it isn't accepting that the Sense line has been brought low and therefore it isn't sending any further commands.

      I measured with the stock Type 1 board plugged in and the Sense line seems to be brought from 5v down to a low negative voltage.
    • For reference, here is a Japanese manual with information on the JVS protocol:
      superusr.free.fr/arcade/JVS/JVST_VER3.pdf

      I was following its diagrams for the USB Type B port, but I believe they have the diagram incorrect for the location of Pin 1 and 2.

      At any rate, with some bad translation, I can get some information about the Sense line:


      Control and address allocation of the terminator by SENSE line

      sense line is 0V, 2.5V (2~3V), to define the three voltage of 5V. 5V guess is ahead of I / O board

      It shows that no (this time terminator is ON), 2.5V the previous I / O board address setting other than

      It indicates the previous state, 0 V indicates that the preceding I / O board is completed address setting. Address of the set

      See Attachment 3 for instructions. (Sense input side to pull up to 5V).

      Even sense output is not power is supplied, do not become 0 V (drawn current to GND

      Absent). In the case of the middle of the I / O power supply OFF, it can detect power outage on the main board.


      SENSE output circuit example

      Even in the state of each node (I / O board) is the power OFF, be in the circuit, such as not to catch a sense line to GND

      Rukoto (*not sure what this is...).

      Here's a translated diagram of the output:


      I take this all to mean that I should be outputting 2.5v rather than 5v. I think the MEGA has 5v TTL whereas the Teensy might be 3.3v and, in the case of the TeensyJVS project, wouldn't need the voltage divider...

      So... this leads me to believe I've got 2 things going on:
      1. My voltage measurement on the stock hardware might have been off?
      2. I likely need to incorporate a voltage divider into my output, per the diagram, and try again with my emulator hardware.


      Scratch that... If I'm reading that diagram correctly, the Output of the IO board is simply driving a transistor that sinks the Sense line to ground. I don't think I have to mess with a voltage divider or worry about my TTL level.

      The post was edited 1 time, last by winteriscoming ().

    • This Sense line has me baffled...

      I'm not getting anything after the reset command.

      In looking at the stock hardware, I'm seeing the following:
      1. Without anything plugged up to it, the Chihiro is outputting 5v on the SENSE line.
      2. Without anything plugged up to it, the Type 1 IO is showing a little over 2v.
      3. All plugged up, the SENSE line shows about 2.5v until I assume the reset command where IDs are assigned, and then becomes 0v. It stays at 0v indefinitely.

      I've tried each of the following:
      1. Sink Sense to ground via a MOSFET driven by an output on the Arduino. This results in 0v on SENSE when receiving the reset command.
      2. Use a voltage divider and output 2.5v onto the Sense line like it looks like the Stock IO is doing. I can't remember the exact results of this at this point, but it did not sink to 0v (assuming the Chihiro is responsible for doing that).
      3. Use a combination of 1 and 2, where 2.5v sits on the SENSE line an another output drives a MOSFET to sink Sense to ground. This resulted in about 2.5v on sense when plugged up to the Chihiro and 0v after the reset command.
    • Hey @winteriscoming, question: out of curiosity, what is your background in this field? Do you have a degree in EE and a minor in Computer Science? I always wonder what type of skills are required to even attempt such a project. Answer if you feel comfortable. Thanks!
      Arcade Multi Systems:
      • Sega: ST-V, Naomi w/Net Dimm, Naomi w/CF Boot (DIY and OG versions), Taito: G Net, Taito F3, Taito Type X², Capcom CPS2, Capcom CPS3, Neo Geo MVS 4-Slot
    • acblunden2 wrote:

      Hey @winteriscoming, question: out of curiosity, what is your background in this field? Do you have a degree in EE and a minor in Computer Science? I always wonder what type of skills are required to even attempt such a project. Answer if you feel comfortable. Thanks!
      I'm a computer science dropout. I didn't even get through a full year before deciding it wasn't for me. I got my degree in art. I've always loved programming and electronics, so I've incorporated them in personal projects and artwork for years now. I'll be the first to admit that I don't know everything, and I usually go into projects not knowing what I'm doing, but do my best to figure it out along the way.

      My programming isn't the most efficient, and my EE skills are lacking, but I haven't burned down the house yet! :P
    • Here's another translated diagram:


      I / O board to allow multiple connections , has a series A, of both of the B connector , re- termination based onSo that only the plate can be ON the terminator , by the voltage detection of the sense lines , A that can be ON / OFFEquipped with an active terminator .

      This has me confused when looking at the previous diagram. This diagram leads me to believe the output on the I/O board is simply 0 or 2.5v and the Main Board senses these voltages and acts accordingly... the other diagram makes it look like the output from the I/O board sinks the sense line coming in on the B connector to ground... ?(
    • Good news! I'm getting to the next step, so it's accepting what I'm doing to the Sense line!

      I went back to a simple output with a voltage divider and nothing else. I'm really not sure why it's working this time and wasn't before, but maybe I didn't wire it up correctly previously. So now the output should be putting either 0 or around 2.5v on the sense line.

      I'm getting to the point of receiving the Set Address command, but I'm getting nothing more after replying.

      I'm still on the TeensyJVS code for all communication, so I'd expect it to work... This makes me think I've got an issue with the data I'm sending. Perhaps the output over the RS485 module is getting corrupt, like I was seeing in my loopback test. I'll have to do some more testing to make sure that the module I currently have wired in is working correctly.
    • I haven't played around with the protocol at all but the impression I got when I was first researching it is that the sense line is just a stacked voltage divider...


      in essence each I/O board in the chain adds more resistance and divides the voltage in half, up to 4 units. this allows the host console to know the total number of units and for each individual unit to know their location in the chain. EDIT: I was confusing this with a different I/O protocol

      IIRC the documentation on this is pretty crap and you'll get a much better understanding if you just look at an I/O board with both A and B ports and see how it's built.
      "Information wants to be free"
      VOOT | RFM | Kraylix V3 | FiF Jr. | KI2 | UMK3 | E29 | E29| TOTD | DDR
      Follow my projects on Instagram: instagram.com/twistedchu

      Buy my 3D Printed Parts: bit-district.com

      The post was edited 1 time, last by twistedsymphony ().

    • twistedsymphony wrote:

      haven't played around with the protocol at all but the impression I got when I was first researching it is that the sense line is just a stacked voltage divider...

      in essence each I/O board in the chain adds more resistance and divides the voltage in half, up to 4 units. this allows the host console to know the total number of units and for each individual unit to know their location in the chain.
      I suppose that's possible, but it's not looking like it works quite that way to me.

      The Sense line isn't continuous through the IO boards. It looks to me like each IO board is responsible for sensing an IO board beyond it. The main board doesn't need to know anything other than that each I/O board is ready to be assigned an ID, which could be as simple as the first board not affecting the main board's sense line until the next board is ready.

      Then when the Set Address command is sent out, each board replies with its ID and the main board knows how many are plugged up based on how many replied.

      That's just a guess, though, based on what I'm seeing it the diagrams.

      Is there a limit of 4 I/O boards? RS-485 allows up to 32 nodes.
      According to this page:
      wiki.pcbotaku.com/wiki/JVS_I/O

      NODE
      Node is the destination address. Node 0 is the master node, and the one that sends out requests to slaves. Slaves, or I/O boards, are numbered 1-31.The I/O board furthest away from the master, physically, has the lowest id. The special node 0xff is a broadcast, i.e. all slaves should process it.
    • maybe it's a limitation of certain specific implementations of the spec? I seem to recall in my testing the NAOMI not recognizing more than 4 nodes.
      "Information wants to be free"
      VOOT | RFM | Kraylix V3 | FiF Jr. | KI2 | UMK3 | E29 | E29| TOTD | DDR
      Follow my projects on Instagram: instagram.com/twistedchu

      Buy my 3D Printed Parts: bit-district.com
    • Also, some more interesting, and relavent info per: wiki.pcbotaku.com/wiki/JVS_I/O

      At powerup the master sends a RESET request, telling all slaves to go
      to their uninitialized state, with no node id and sense output line to
      high. The spec says you should send this packet twice.
      After the reset request, the master starts to initialize the slaves with node numbers. It starts with node #1, and continues until all slaves have addresses set. This procedure serves the samepurpose as DHCP in the IP world.
      A slave should ignore the the address offered if the input sense is high. That way, the lastI/O board gets the first address - 1 – since it has no eastbound neighbors. The slave that picks up the request sends an ACK back to the master, and pulls it’s output sense to 0.
      If the masters input sense, after receiving an ack for slave id #1, is not 0 after 1ms, it sends out a new set address set request with an increased node number for the next slave. This continues until either id>31, or sense is 0.
      So I take this to mean that the main board keeps assigning IDs until its sense line is 0v, which would be controlled by the IO board directly plugged into it. Each IO board knows when its turn is by the next IO board's sense line being 0v.

      At any rate, I'm only implementing a single board, with no plans to accommodate multiple nodes, so I'm most interested in causing the behavior that lets it know the one board is initialized and has been assigned an ID.

      I'm seeing per the same page:

      [E0][FF][03][F0][D9][CB] - Broadcast, reset all I/O boards
      [E0][FF][03][F1][01][F4] - broadcast, register I/O board 1
      [E0][00][03][01][01][05] - to master, empty ACK message, I/O board 1 is now initialized
      Maybe I'm not doing what I need to with the sense line still... I'm starting out with Sense high (2.5v) and going low (0v) when receiving the reset command. Then I'm getting the command to register board one, setting Sense high (2.5v) and sending out the ACK message, but getting nothing after that... Maybe I need to be doing the reverse... start out low, go high during reset, and low again during the assigning of the address and sending the acknowledgement.
    • @winteriscoming you know that E0 and D0 are translated as D0DF and D0CF respectively right? Additionally the CRC must match in each message.

      I'm going to support this project in the best way I can given my limited time. I have a program in C that communicates with any JVS as a HOST. you just need to connect a I/O JVS to the COM port in your PC using a rs485-rs232 adapter like this one:

      ebay.com/itm/Passive-DB9-9-Pin…c4a559:g:XvcAAOSwWBJXA1Nt

      and you will see how it connects and what responses you get. I'll give you the code in C so you can modify it as you like.

      I don't have the time but it would be great if someone could finish it so that it will work both as a host and as a client, so everyone could develop their own devices or tools, etc.

      You know what, I'll share it here so everyone can use it. I use Bloodshell Dev C++ to compile and debug it.
      Files
      • Read_JVS.zip

        (2.95 kB, downloaded 40 times, last: )
      * Arcade-projects, the site where you get the most of your arcade games.
      * If you want Drama go to Neo-Geo forum ---Darksoft
    • Darksoft wrote:

      @winteriscoming you know that E0 and D0 are translated as D0DF and D0CF respectively right? Additionally the CRC must match in each message.
      I haven't even gotten to that point yet in my own code. I'm still using the TeensyJVS code, and it looks to be handling communication correctly, and generated the reply for setting up the board as:
      [E0][00][03][01][01][05]
      This matches the ACK shown in the pcbotaku example, so I'm assuming it's correct. My issue now is why isn't the main board responding after that.

      Thanks for sharing what you've put together! I'll have to dig around and see what I can figure out from it.