Page 1 of 1

A Frustrating MiSTer Problem Solved

Posted: Mon Nov 21, 2022 4:00 am
by KnuckleheadFlow
I've read of some other people having similar problems, so I thought I'd post this. TLDR; a PD/fast charging power supply may cause the MiSTer to not boot, need multiple resets on powerup and some cores to crash or lose sync.

I bought the DE10-Nano on a whim after finding out about MiSTer back in May 2019 ($188 CAD lol), then did nothing with it. Couple weeks ago I decided to finally order the SDRAM board and set up MiSTer to play cores that don't need it in the mean time. From the start I had two issues:
  • when powered on I would always need to reset it 1-10 times to get the menu.
  • the Genesis and TG-16 cores would often not load or not sync. Sometimes they would and I'd adjust the video, load a rom or reset the core and it'd either lose sync or crash. I couldn't tell which, the TV just said no input.
The arcade cores that don't need the SDRAM ran fine and if the Genesis/TG-16 core loaded then managed to load a ROM they'd also work fine.

I read a bunch, tried a bunch of things. I was afraid that either I got a bunk DE10 (now long since out of warranty) or it'd been damaged in the two and a half years since I bought it. After a week or so of frustration, on a whim I decided to power it from my laptop's USB port (I'm using a barrel connector modified USB cable). It booted to the menu when I plugged it in, right away without a reset! Over and over again. The Genesis and TG-16 cores now work flawlessly.

I had been using my workhorse 65W GaN USB-C PD power supply that I've used with lots of things without issue, including the also FPGA'ed OSSC (ironically enough when I first built it I thought I'd screwed something up because it wasn't working at all. Turned out the USB PS I was using then was underpowered).

I theorize that the fraction of a second it takes the power supply to negotiate 5V output was tripping up the DE10 or MiSTer.

Re: A Frustrating MiSTer Problem Solved

Posted: Mon Nov 21, 2022 4:52 am
by aberu
Glad you figured out the problem. In general people shouldn't use power supplies made for cellphones and stuff like that with the MiSTer, it doesn't have a way to communicate with the IC inside the USB-C PD power supplies to take advantage of the higher amps, so you were likely getting 1.5 or maybe less amps delivered to the MiSTer then.

Re: A Frustrating MiSTer Problem Solved

Posted: Mon Nov 21, 2022 4:54 am
by C-R-T
How did you even manage to get an usb c-anything connected to the mister?

Re: A Frustrating MiSTer Problem Solved

Posted: Mon Nov 21, 2022 5:43 am
by KnuckleheadFlow
aberu wrote: Mon Nov 21, 2022 4:52 am Glad you figured out the problem. In general people shouldn't use power supplies made for cellphones and stuff like that with the MiSTer, it doesn't have a way to communicate with the IC inside the USB-C PD power supplies to take advantage of the higher amps, so you were likely getting 1.5 or maybe less amps delivered to the MiSTer then.
According to its specs, at 5V it's 2.4 or 3A, depending on the port. I don't think too little current was the issue. Just its delivery.
On a side note, I really like this charger. It's GaN so it's really compact (50x50x30mm) but it'll power and charge my laptop.
C-R-T wrote: Mon Nov 21, 2022 4:54 am How did you even manage to get an usb c-anything connected to the mister?
A USB A to USB C adapter. I took a USB cable, cut off one end and attached a barrel connector to 5V and GND, leaving the other end USB A. This was supposed to be a temporary thing when I finished soldering my OSSC and realized I didn't have a power cable for it, but it's been working for years.

Re: A Frustrating MiSTer Problem Solved

Posted: Tue Nov 22, 2022 7:55 pm
by Malor
FWIW, the Mean Well GST25A05-P1J is one known-good option; it's a 5V/4A supply, usually anywhere from $15 to $20.

You can buy bigger supplies, but there's no real reason to. The DE-10 Nano has overvolt and overamp protection circuitry, so no matter how many amps are available at the barrel plug, only a limited amount of power will make it through the board and out the other ports. Unless you're using a Y connector and have something downstream that's very power hungry, there's no benefit in going above 4 amps.

You can find plenty of other 5V/4A supplies, with the correct 2.1mm barrel adapters. They're often sold for Christmas lights. And many universal adapters will work as well. The Mean Well, however, has a nice high power input range. It'll work on anything from 85 to 264 volts, so anyone, in any country, can buy one and expect it to work, without needing to flip a switch. That makes it a nice safe default recommendation.

They don't come with a wall cable, however. You'll need a cable specific to your country's outlets. They use the thick 3-pin plugs that most computer power supplies have, so any standard computer cord should work.

Re: A Frustrating MiSTer Problem Solved

Posted: Tue Nov 22, 2022 8:44 pm
by thisisamigaspeaking
If my MiSTer weren't in a computer case and under a heavy monitor I would try this out right now. If we still haven't narrowed down a cause and I remember to do so next time it is open, I will try it on the PD/fast charge chargers I have.

Of more "premium" chargers, I have an Anker "Nano II" 65W GaN USB-C and Razer 130W GaN USB-C/USB-A to try, as well as an Anker "PowerPort+ 1" 18W USB-A.

Anker calls their negotiation tech PowerIQ and I believe PowerIQ 3.0 (which both Anker fast chargers I have are) is USB BC (1.5A/7.5W) + Qualcomm + Samsung + USB PD so it has a not of negotiation to do. Now I'm very curious to see if these have any issue powering a MiSTer. I assume the DE10-Nano only wants USB BC mode or just straight 1A/5W USB, or does it speak any fast charge protocol?

Re: A Frustrating MiSTer Problem Solved

Posted: Tue Nov 22, 2022 9:52 pm
by Malor
The Mister does not speak any fast charge protocol at all. You are wasting your time hooking up any kind of advanced adapter. Get a 5V4A supply like the Mean Well, and that is all you need.

You will have only trouble trying to use smart anything.

1A is way, way not enough. The included power supply is 2A, and is often inadequate. 4A works nicely.

edit: which belatedly explains OP's problem. The charger was defaulting to the USB minimum standard because the Mister has no negotiation circuitry, and that's not enough power.

It's a brainless barrel plug, so you want a brainless power supply. 5V4A, 2.1mm.

Re: A Frustrating MiSTer Problem Solved

Posted: Tue Nov 22, 2022 10:44 pm
by thisisamigaspeaking
Ah of course, I'd forgotten what the MiSTer's power supply is even like, the barrel connector. Mine is inside a Checkmate case running of its PC power supply so I'd forgotten how it's wired.

I'm afraid I don't understand how OP had the MiSTer hooked up to a USB-C fast charger or any USB charger.

Even with a custom cable (usb->barrel), smart chargers are going to stay within spec unless something has been negotiated.

Re: A Frustrating MiSTer Problem Solved

Posted: Tue Nov 22, 2022 10:49 pm
by thisisamigaspeaking
KnuckleheadFlow wrote: Mon Nov 21, 2022 5:43 am A USB A to USB C adapter. I took a USB cable, cut off one end and attached a barrel connector to 5V and GND, leaving the other end USB A. This was supposed to be a temporary thing when I finished soldering my OSSC and realized I didn't have a power cable for it, but it's been working for years.
Ahah, that's what I get for not reading more carefully and just jumping in a thread. I had forgotten and thought the MiSTer took a USB power connector like a Raspberry Pi. Yeah, that is not going to work. Making custom cables in general is a bad idea without a thorough understanding of what's at play, cables are very complicated things these days.

I spent a ton of time researching and double checking how to hook up an LED on a case to the I/O board. There are a lot of variables even for things that seem simple. In that case it turned out a straight cable would work depending on which pins I connected to on the case's circuit board, but I could easily have blown the LED.

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 12:24 am
by KnuckleheadFlow
Malor wrote: Tue Nov 22, 2022 9:52 pm edit: which belatedly explains OP's problem. The charger was defaulting to the USB minimum standard because the Mister has no negotiation circuitry, and that's not enough power.

It's a brainless barrel plug, so you want a brainless power supply. 5V4A, 2.1mm.
I'm not trying to be argumentative but I really don't think it's a lack of current that was the problem.
If the problem was insufficient current wouldn't it shut off when the Genesis core was actually doing the most work and running a game? Like I said, if I didn't touch the video settings and got lucky, I could load a ROM and play for hours.
When defaulting to 5V a USB port can still provide more than the old minimum specified by the standard without using actual Power Delivery. I think it's 1.5A now for dumb devices. This power supply was also able to give my OSSC enough current when a regular old (0.75A or 0.9A I think) USB supply couldn't.
Wouldn't my laptop's vanilla USB A port also default to the same current as the PD power supply when using the same cable? That's what I've been using and it's running everything just fine now. Of course it probably won't be enough once I get the hub and wifi, BT, etc going on it.

I should dust off my oscilloscope and see if I can see a difference when plugging it in. I don't have a current probe but if there's weirdness in the voltage it should catch it.
thisisamigaspeaking wrote: Tue Nov 22, 2022 10:49 pm Yeah, that is not going to work. Making custom cables in general is a bad idea without a thorough understanding of what's at play, cables are very complicated things these days.
The cable works fine for what it's intended for, 5V, lowish current from a regular USB port. I've troubleshooted and repaired cellphones, TVs, monitors and arcade boards, this is simple :)

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 2:47 am
by Malor
Well, you can think whatever you want, but it's generally accepted that 2A is insufficient and prone to causing system instability. You had severe system instability, and could not have been pulling more than 2A from your power supply. The conclusion seems pretty obvious to me.

Just put a Mean Well on the sucker, or some other 5V4A dumb brick, and it should be stable all the time, in every core. Why waste time with this crap when you can spend $20 and be done with it? And if you shop around, you could probably find something that would work fine for $10 to $12.

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 2:55 am
by Lightwave
KnuckleheadFlow wrote: Wed Nov 23, 2022 12:24 am
thisisamigaspeaking wrote: Tue Nov 22, 2022 10:49 pm Yeah, that is not going to work. Making custom cables in general is a bad idea without a thorough understanding of what's at play, cables are very complicated things these days.
The cable works fine for what it's intended for, 5V, lowish current from a regular USB port. I've troubleshooted and repaired cellphones, TVs, monitors and arcade boards, this is simple :)
I picked up a commercial version of this type of cable (USB to Barrel Jack) from Amazon and haven't experienced any issues with it.

I have a MiSTer, external USB hub and 9.7" iPad screen all powered by an Anker 5-port USB charger. Works great as a portable system I can easily move around the house.

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 5:19 am
by KnuckleheadFlow
Malor wrote: Wed Nov 23, 2022 2:47 am Well, you can think whatever you want, but it's generally accepted that 2A is insufficient and prone to causing system instability. You had severe system instability, and could not have been pulling more than 2A from your power supply. The conclusion seems pretty obvious to me.

Just put a Mean Well on the sucker, or some other 5V4A dumb brick, and it should be stable all the time, in every core. Why waste time with this crap when you can spend $20 and be done with it? And if you shop around, you could probably find something that would work fine for $10 to $12.
What are you talking about? I'm not "wasting my time with this crap", I'm going to have get a regular 5V PS because powering it out of my laptop isn't exactly convenient. I just wanted to warn others that using a USB-C PD power supply may cause issues. Jeez.

Also, how about that right now I have complete stability, running every core I've tried so far, out of a regular laptop USB port? That's why I'm saying it can't be the current because the laptop's USB port can't be putting out more current then the power supply I was using.
Lightwave wrote: Wed Nov 23, 2022 2:55 am I picked up a commercial version of this type of cable (USB to Barrel Jack) from Amazon and haven't experienced any issues with it.

I have a MiSTer, external USB hub and 9.7" iPad screen all powered by an Anker 5-port USB charger. Works great as a portable system I can easily move around the house.
I'll look into something like that, I just got that screen in today. It's pretty great so far. I'll have to tweak its settings for the Jotego CPS cores though.

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 11:01 am
by thisisamigaspeaking
Lightwave wrote: Wed Nov 23, 2022 2:55 am
KnuckleheadFlow wrote: Wed Nov 23, 2022 12:24 am
thisisamigaspeaking wrote: Tue Nov 22, 2022 10:49 pm Yeah, that is not going to work. Making custom cables in general is a bad idea without a thorough understanding of what's at play, cables are very complicated things these days.
The cable works fine for what it's intended for, 5V, lowish current from a regular USB port. I've troubleshooted and repaired cellphones, TVs, monitors and arcade boards, this is simple :)
I picked up a commercial version of this type of cable (USB to Barrel Jack) from Amazon and haven't experienced any issues with it.

I have a MiSTer, external USB hub and 9.7" iPad screen all powered by an Anker 5-port USB charger. Works great as a portable system I can easily move around the house.
I have one of those Anker USB chargers somewhere (or another model from them) and I think it has 2.4A ports in addition to 1A? I wonder if it is "USB" or just a power supply with USB connectors that some devices accept. Mine is pretty old.

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 9:37 pm
by Malor
KnuckleheadFlow wrote: Wed Nov 23, 2022 5:19 am Also, how about that right now I have complete stability, running every core I've tried so far, out of a regular laptop USB port? That's why I'm saying it can't be the current because the laptop's USB port can't be putting out more current then the power supply I was using.
Since you're stable now, and you weren't stable before, I would argue that your assertion that the laptop can't be providing more amperage is demonstrably false.

The Mister doesn't just randomly destabilize, you know. These systems are effectively always stable if they get enough power. About the only things that make them crash are core bugs (rare) or not having enough power (extremely common.)

Ergo, you weren't providing enough power before, and you're providing enough now. It's likely to be just barely enough.

edit to add: With some Misters (mine included), excessive heat can also cause crashes.

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 10:33 pm
by aberu
KnuckleheadFlow wrote: Wed Nov 23, 2022 12:24 am I'm not trying to be argumentative but I really don't think it's a lack of current that was the problem.
If the problem was insufficient current wouldn't it shut off when the Genesis core was actually doing the most work and running a game? Like I said, if I didn't touch the video settings and got lucky, I could load a ROM and play for hours.
I don't think it's current either, I think it's due to a dip in voltage. If you run an SoC-FPGA like this undervolted, it will introduce weird undefined behavior. It won't just turn off and stop working or anything like that. Instead you will see cores crashing and you could potentially permanently damage the FPGA SoC.

Under current load of varying degrees, what is the voltage output of your adapter? Would be good to test it with a proper tool and find out. Then compare it to a Mean Well.

You can see how something like this would get measured in Porkchop's blog post on power adapters here:

https://misteraddons.com/blogs/news/i-ve-got-the-power

As your current load on the PSU increases by the device demanding more power, the voltage will naturally dip, so in your case if the current load increases and your adapter really can't sustain 5v at as high a current load as the official adapter for the DE10-Nano even, then you will be undervolting your MiSTer.

Re: A Frustrating MiSTer Problem Solved

Posted: Wed Nov 23, 2022 11:54 pm
by Malor
aberu wrote: Wed Nov 23, 2022 10:33 pmI don't think it's current either, I think it's due to a dip in voltage.
I am not an electrician, nor do I have any special electronics expertise, so this is far from an authoritative opinion.

That said, in this specific case, I believe the two ideas could amount to be more or less the same thing. If you don't provide enough amperage at the source plug, the voltage drops. As you say, it actually ends up being low voltage that causes the crash, but insufficient amperage is a frequent source of low voltage.

A water metaphor often works well for electrical flow, and definitely fits this case. If you provide enough flow (amperage) at the source, the pressure (voltage) will stay high, and the Mister will work normally.

edit: of course, it could also be actual low voltage. But since USB's minimum, to my knowledge, is 5V, that seems unlikely unless the power supply is somehow defective. Low voltage is, thus, unlikely, where low amperage, when hooking up a USB plug to a barrel connector, is nearly certain.