Monday, July 19, 2021

MiSTer FPGA : User Serial Connector to C64 IEC - part 1

I have been using my own custom hacked code and hardware on the MiSTer C64 core for a few years now, but finally it's in the official core.  This is awesome for two reasons, 1) I don't have to keep recompiling my cores and 2) it uses less pins and also has reset.

Initially I was confused about how the in/out pins worked and I also got lost in a mess of wires.  Eventually, I bit the bullet and rebuilt it from scratch and it worked.


You'll note that the uIEC is powered from my USB hub.  The DE10-nano doesn't have enough juice to run it.

I even put together a board for my IEC bus and my USB Arduino Interface for my C128 keyboard. They should sit together nicely under the MiSTer. I hope it works :-) . . . ( see Part 2 )


Here is a dump of all of my notes . . .

Caveat

Be very aware that this plug contains both 5v and 3.3v and that you are connecting a 3.3v system to a 5v system.

a) Wiring this up incorrectly may destroy your MiSTer!

b) You must also use a logic level converter

c) Verify everything I have written and linked to, I am not responsible for any mistakes below.


USB Cables

Please note that the pins of the USB 3 cable ends do differ on plug in some places (not all are straight through).


C64 Core Document

You should refer to the C64 core documentation : https://github.com/MiSTer-devel/C64_MiSTer#user_io-pins


USB 3 Type A Receptacle on the I/O board and DE10-nano pins

I have previously wired my own IEC bus directly from the DE10-nano. However, please note that the official MiSTer I/O board has 100 Ohm resistors between the pins and the USB Connector. The Newer I/O boards (5.6 and up) also have 10K Ohm weak pull ups.

However the IEC bus works fine without the pull ups ( I have a 5.5 board ).


Study the schematic for the pin out on the I/O Board : https://github.com/MiSTer-devel/Hardware_MiSTer/blob/master/releases/iobrd_5.5.pdf

or this one with the pull ups : https://github.com/MiSTer-devel/Hardware_MiSTer/blob/master/releases/iobrd_5.6.pdf

Verify the pin numbering of the USB 3 Type A Receptacle on the I/O board : https://au.mouser.com/datasheet/2/837/USB1075-1948891.pdf

Verify the pin translation of the USB 3 Type a Receptacle on the I/O board : https://pinout.net/pinout-scheme/507/USB%203.0%20SuperSpeed

Make the necessary adjustments / translations for your cable!!


The pins for the USB connector ON THE I/O board are :

1) 5 V

2) RS232 Tx

3) RS232 Rx

4) GND

5) ATN

6) DATA

7) RESET

8) CLK

9) 3.3v


Logic Level Conversion

I used this Logic Level converter : [url]https://www.sparkfun.com/products/12009[/url]

Please read the data sheet for usage.

L side is MiSter side

H side is IEC side


LV1 ATN => HV1 ATN

LV2 DATA = HV2 DATA

LV connect to 3.3v

GND connect to GND to GND ( I powered the Logic Level Converter entirely from the MiSTer so it has a common Ground, if you don't then you'll need to separate the grounds to each power source, Read The Manual ).

HV connect to 5v

LV3 RESET to HV3 RESET

LV4 CLK to HV4 CLK


IEC receptacle

I used this part for the IEC receptacle on my PCB design : SDS-60J : https://au.mouser.com/datasheet/2/670/sds_j-1778983.pdf


1) SRQ ( unused )

2) GND

3) ATN

4) CLK

5) DATA

6) RESET

 

Please see Part 2 for Schematics and Design!

https://8bitshardway.blogspot.com/2021/07/mister-fpga-user-serial-connector-to_2.html 


3 comments:

  1. Congratulations on this post! lots of research from non organized information. Thank you for this great task!

    ReplyDelete
  2. Hi I ordered 10 of your boards from pcbway and I made one so far, but I have a question it seems to me that either some of your pins are mislabeled, or v+ on the one header is shorted to ground on the other. I DID finally manage to get your board to work (I didn't understand at first that your board NEEDS external power, because it shouldn't, but in my case it does; it SHOULD be able to just get 3.3 from the USER IO port). What I tried finally was giving 3.3 volts to the one 3.3v labeled pin on the far left end of the headers, and connecting ground to other header, all the way on the far right (just two pins) and that shouldn't be! I'm pretty sure that it isn't supposed to work this way, and yet this is the ONLY way that it DOES work for me. Connecting ground and 3.3 only to the one header on the left did not work. Can you confirm whether there is a mistake in the design? Because I checked and double checked and there are no solder bridges. Perhaps it's because I have version 6.1 of the IO board? Anyway, thank you very much for your design! For the last couple years, it was the only MiSTer IEC design available but now there's a new kid on the block, "SNAC2IEC!" I have an idea since I don't have a Commodore 128d but I do have a Commodore 128, and I also have a "TheC64 Maxi" modified into a USB keyboard for mister only some of the keys are mapping correctly and I was thinking of altering your sketch to translate the maxi keyboard into the correct commoner keys on MiSTer. Would that be okay with you? Thanks again,! -John

    ReplyDelete
    Replies
    1. Hi John,

      Yes, what happened is that I put +5 on the top copper pour and ground on the bottom copper pour, but I didn't join GND on J7 to the bottom pour and I didn't join +v on J6 to the top pour. So both of the those two VIAs don't attach to anything this can be corrected by scratching a little bit of the mask back and applying solder to the via and the pour.

      The board actually does not need external power and I do not use J6 or J7 at all.

      Perhaps your I/O board is a newer one and needs one these jumpers set to get 3.3v at the USB socket?

      https://www.reddit.com/r/MiSTerProject/comments/gjy1gb/what_are_these_two_jumpers_on_the_io_board_for/

      You are free to do with the sketch as you wish. I didn't write the original version I just modified it.

      I was planning on updating the PCB to add more features but I just lost interest once it was working for me.

      I'll push up then entire diptrace project to github and you can grab it and modify as you wish. ( see blog entry above soon )

      Cheers








      Delete