Joymega adapter with 74LS0X - UP causes UP+Z

Page 1/2
| 2

By Wild_Penguin

Hero (644)

Wild_Penguin's picture

17-10-2015, 16:41

Hi,

I've build a JoyMega adatper into one of the very cheap and well known SMS pads from DX.com. I had some spare 74LSXX chips left over from another MSX related project, but no 7404 (well, actually that project is unfinished but I didn't feel like going to the store for <1€ parts, I can always get new ones). As a basis I was using the instructions from FRS's page.

EDIT: Forgot to mention, I've been using joytest 2.3b from FRS's page (utils section).

I used a HD74LS00P (quad NAND gate) at first. I though I need to short both inputs to get an inverter, but it didn't work as expected (I still don't know why, but I used pins 9-10, and 8 as output, and I presume it is possible that gate is broken).

Since that didn't work, Then I made another adapter with a SN74LS02J. I used another protoboard, an IC socket and some jumpers so I can test / troubleshoot with the NAND gate too :)

I presumed it should work without shorting the inputs. But, it didn't work as expected, either, but was detected as a 3-button SMS pad with left and right (!) both shorted (pressed) all the time. Using the pad does cause some reactions, but obviously it was not usable.

Then, I presumed I may have misunderstod something in the truth tables, so I tried to short both input (2&3). This way the pad works perfectly, all buttons! I believe was mixing (N)OR with X(N)OR logic. Only problem is, whenever I press up, "Z" button is also detected.

Then I tried the NAND gate again, this time with pins 1-3. Now it too works! It doesn't matter, wether I short pins 1&2 or not, which I find quite weird, but I believe I may have mixed up / misunderstood when the signal is low and when it is high in the circuit. So the chip may be broken (since pins 8-10 didn't work, but pins 1-3 work in otherwise identical circuit), or the other protoboard I'm using is broken somehow (I have double checked all solders, but I could always have made a mistake).

So, it seems that I'm using the logic gates the right way (please do correct me if I'm doing something wrong here!), but still something is wrong, since up causes Z to be detected ;) . This occurs with both logic gates. Any ideas what might be going on, or if I'm using the gates correctly? Or are they even usable this way?

Cheers!

Login or register to post comments

By Wild_Penguin

Hero (644)

Wild_Penguin's picture

17-10-2015, 16:56

Now that I though this a little bit more:

FRS's page: wrote:

The 6-button joystik is a bit more complex, we have 4 more buttons: X, Y, Z and Mode using the same connector, as it should be compatible with the 3-button joystick. To obtain the status of the new buttons have to send a sequence of 3 ones to the multiplexer, so we have to quickly change the state of pin 7 this way: 010101. Doing so will show the status of X, Y, Z and Mode buttons on pins 3, 2, 1 and 4 respectively. Before sending the last 1, when the multiplexer is set to 0 the joystick will return zero on pins 1, 2, 3 and 4, and this will tell you whether this is a 6-button control. To have the joystick showing the state of the normal buttons again, just reset the multiplexer to zero. Anyway it will return itself after a certain time (less than a 1/60s I think, although I'm not sure).

I believe this may be a timing issue? Whenever up is pressed, when the PSG registers are cycled, the "UP" is misunderstod as button Z? So, something is too slow or too fast?

But I'm no expert, so I'll wait until someone more experienced will comment Wink

By Wild_Penguin

Hero (644)

Wild_Penguin's picture

17-10-2015, 17:13

Another comment - maybe I should have read the readme more carefully:

Joytest 2.3 readme wrote:

Warning: *Never* connect any Megadrive device directly to the MSX as it can
damage your computer and/or the device! Always connect them using the joymega
adapter. You can buy one in the MSX community, or DIY following the
instructions shown here:
http://frs.badcoffee.info/hardware/joymega-en.html

I've understod / though previously that the SMS controllers can be used without any kind of adapter, only one button will work?!! Anyways, I've tested them this way (not used much since I've got other joysticks, but I believe both have been connected to the MSX at some point without any modifications). So that can mean that either of the pad(s) I've been using could have been damaged somehow before I've modified them.

By syn

Prophet (2113)

syn's picture

17-10-2015, 21:09

It is the buttons thats the problem afaik. I tested mine too without adapter (very stupid, since it was an original sega pad not a knockoff). Luckily I only pressed the B button (which is mapped correctly).

Also you are a bit confused in your posts,

SMS = Sega Master system (which has 2 buttons)

BUT

those 6 button pads pads from dx.com are for Sega Megadrive.

You probably read the info about the SMS pads that you can connect them for 1 button. (of which I dont know if its true or not)

By Wild_Penguin

Hero (644)

Wild_Penguin's picture

17-10-2015, 21:45

Yes, I was mixing up SMS and Megadrive. I was typing without thinking (a Sega is a Sega, heh Smile ).

The way I look at the pinout (and compare it to the MSX), I *think* that the MSX could Output to Megadrive GND pin, but that should not happen in vast majority of Games. The Output is low normally, or I'm totally lost. (Actually any piece of software that uses anything else besides the basic 2-button joysticks was extremely rare back in the day - well there was only MSX1 in Finland AFAIK - and even today I only have SymbOS, and Joytest). But I guess that could damage the Gamepad.

Conversely, the pad could short the MSX output pin to GND if start is pressed - but again, I read somewhere that this should not damage the MSX.

So it seems it is more dangerous to the pads than for the MSX - but then again, I'm not any kind of electronics expert Smile

By Wild_Penguin

Hero (644)

Wild_Penguin's picture

03-12-2015, 18:45

I got some (hex) inverters (74LS04) and put them in my adapters instead of the NOR and NAND gates, as in the original instructions. But - I still got the exactly same result: UP causes UP+Z!

Does anyone know what could be happening here? Also, does anyone know where to contact the original author (if you do, perhaps point him to this thread) - I tried an email I found in the docs, but it was not in use anymore. Maybe he has an idea what's going on... perhaps a timing / incompatibility with msx-engine (S3527) or something else in an NMS8255?

By Daemos

Paragon (2044)

Daemos's picture

03-12-2015, 19:01

It is much better to use the transistor version that roadfighter once came up with somewhere on this forum. i have built those 74LS04 versions as well and it was like a lottery. The transistor version worked 1:1 directly without problems. Drop me a email I will send you the document.

By Wild_Penguin

Hero (644)

Wild_Penguin's picture

03-12-2015, 21:10

Hi Daemos,

Do you mean this one? (from this thread)

EDIT: in English!

I saw it already, but I had the lolgic ports handy and thought they will work as well... I will try that one later!

By Daemos

Paragon (2044)

Daemos's picture

03-12-2015, 21:21

Thats the one Wink You just have to draw out how to built it in. I did the modification internally and it always works.

By tvalenca

Paladin (747)

tvalenca's picture

04-12-2015, 13:53

hi,

First of all, I'm assuming you're using a 6-button sega joypad.

Since Z button and UP are read from the same pin, They can't be detected at same time. Could be anything that can cause a timming issue, since you have multiplexed reads (but the PSG isn't the culprit here). Have you tried another joypad (of the same model, of course)? Do the same thing happens on the other joystick port, or another MSX? If it only happens on the joystick port you're using right now, I'd check on pin 1 pull-up resistor, or your adapter itself.

I mean no offense with that, but bad soldering skills and bad design could create a minimal short, and cause a slight delay on pin 1.

Did you place a power decoupling capacitor on 74LSXX? Did you hooked it right? (between pins 7 and 14) because if you placed a capacitor, and it is on wrong place, you can mess with the switching signal, thus causing the multiplexer to be read in a wrong way. Anyway, the bad soldering issue could cause something here too.

And if this is the case (you're not doing the adapter the right way) I should recommend you to DON'T TOUCH THE JOYPAD INTERNALS. Sorry, but you'll make things worse if you crack open it. (same goes for opening your MSX to find a faulty pull-up resistor)

By Wild_Penguin

Hero (644)

Wild_Penguin's picture

04-12-2015, 16:27

Hi tvalenca, Thanks for your suggestions!

I got two identical joypads here - both from DX, as stated in my original post (link); 6-button, or 7 if you count start, or 8 if you count mode button (but mode is only on the PCB, no physical button on the casing). Both pads have the adapter built in, so it's two separate but identical adapters. (Actually, I have 4 pads of the same kind, but the other two have Nyyrikkis ABx3 mod).

The error is consistent on both joypads and on both ports 1 & 2 on my NMS2855 (it was obvious to test on both ports, of course, but I didn't mention it before). Of course it is possible I've made an error - but identical one on both adapters? Consistently? I haven't tested on another MSX, since I haven't got one with a DOS to run the test program - except I just recently got a MegaFlashRomSCC+SD, which means I could actually test this on my MSX1 machines. Haven't got around to doing that yet.

There is no decoupling capacitor. Do you thing adding one could fix this? I mean, the 5V gous trough a fairly long cable... to the 74LSXX. I have measured the voltage and it is 5V, but I really don't know if that is enough to determine, if it's sustained during / for proper operation. I guess a slow response could cause this, but why only with UP?

But some kind of a timing issue if my guess, too (as I mentioned previously). I'm no expert, but my guess is that the circuit is a bit of a hack and doesn't work as expected with all hardware. NMS825X are so common, though, that I'm surprised no-one has come accross this issue yet - so I'ts certainly possible I'm doing something wrong in my adapters. That's half of the reason why I asked, am I only one who has had this issue - the other being, of course, maybe to find out what is happening here.

Cheers!

p.s. I'm fairly confident in my soldering skills. Well, I'm not a professional, but a hobbyist, and I do some soldering every now and then, though still, I consider myself a novice. I have read some guides on soldering, and think I can spot cold solderings, and know how much solder to use - not too muchs or little - to use etc. (I do have some friend who do electronics more professionally to consultate face-to-face, too - and they've seen my solderings). Generally, I check everything by eye and quite neurotically with a multimeter too, if there's even slightest bit of doubt (before actual use), and have double-checked everything by now several times, since there seems to be some error.

p.p.s. Also, My NMS8255 has been cracked open several times by now :D
(there's memory upgrade, DOS2, and OPAMP mods built in). I've never touched the joystick ports, though.

Page 1/2
| 2