Digital IO Board V1.2 to custom LED circuit.

Discussion of official MiSTer Project addons. (https://github.com/MiSTer-devel/Hardware_MiSTer)


Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

Hi,

I've recently installed my MiSTer inside a re-purposed Bang and Olufsen HDR-2 case. I needed a monitor raiser anyway. :-) The case comes with an LED circuit board which I'm keen to re-use - if I can. I'm wondering if anyone with electronics skills might be able to help me reverse engineer some information from the following pictures and schematic snippet.

There appear to be four pairs of LEDs corresponding to standby, timer, replay and record. The led pairs are connected in parallel to one of four transistors. There are resistors between each led and their transistor's (collector?) which I've measured at ~ 330 ohms. The resistors either side of the transistor are reading ~9K ohms and the white one underneath the right one is reading ~19.8 K ohms. Sorry for all the edits. I'll stop now!
pcb.jpg
pcb.jpg (142.48 KiB) Viewed 9761 times
The board has a six pin idc connector (+5V, uPH8_RePlay_LED, uPH8_Record_LED, uPH8_Timer_LED, uPH8_Standby_LED, GND). No idea what uPH8 means, but I'm wondering if they're maybe lower voltage signals coming off a processor board? The best I can google is that the main computer in some b&O gear is sometimes referred to as uPH8.
schematic.jpg
schematic.jpg (50.38 KiB) Viewed 9761 times
Any help working out if it's possible to connect this up to the IO board without too much extra circuitry would be very much appreciated!
User avatar
legacypixels
Posts: 91
Joined: Sun May 24, 2020 9:20 pm
Has thanked: 25 times
Been thanked: 25 times

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by legacypixels »

Well, it's a little hard to tell, but it looks like the classic way to drive LEDs using a transistor when you can't power directly from the microcontroller. uPH8 is almost certainly the microcontroller, and it probably controls the LEDs by providing a ground on the appropriate pin.

I'd try connecting +5v and gnd to pins as marked, then ground one of the LED pins. If the corresponding LEDs light, you are probably good to go, everything you need would be on the IO board LED header (P4 on IO board v6.1).

Disclaimer: This is speculation based on a picture, and could be completely wrong. If your stuff breaks or catches fire, that's not on me =D
US based seller of MiSTer addon boards. Visit https://www.legacypixels.com/mister
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

Thanks, I'll give it a try!
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

Thanks so much for the help, @legacypixels. Really appreciate it.

later...

I added power via pins one and six and a red standby led came on. Grounding any of the other pins, sadly, had no affect; so I took a punt on applying 5 volts to one of these. At that point, the corresponding led lit up, so it looks like it's expecting +V on these.

So, after doing a bit of reading I have a couple more questions for the community:
  • How bad would it be if we applied 5v to the base if it actually had a base resistor for, say, 3.3v? I'm imagining it's some kind of badness, or am I misunderstanding things terribly? I'll google what the appropriate current is for transistor bases, but I've measured 0.44 mA going through one of the signal pins when I apply 5V to it. Would the fix for over voltage be to add more base ohms so that we're less saturated?
  • If I'm lucky and it's expecting 5v on the base - and given that this board's signal pins need a positive voltage - is it still possible to use the IO board's P4 without too much extra circuitry? Do the P4 pins go low for on?
Thanks again for reading, folks!
User avatar
legacypixels
Posts: 91
Joined: Sun May 24, 2020 9:20 pm
Has thanked: 25 times
Been thanked: 25 times

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by legacypixels »

well, fooled me. I think at this point I'd just spin a board, or hide a 74HCT04 somewhere.
US based seller of MiSTer addon boards. Visit https://www.legacypixels.com/mister
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

A hex converter sounded like more fun, but I ordered one before I saw your reply. I ordered a 74hcu04 (cheaper). Should I order a t04 or is the u04 good enough? Not sure what the consequences of using an unbuffered type would be.

With the u04, I can power the leds from a ground signal using a 5v supply.
20200801_143340.jpg
20200801_143340.jpg (3.88 MiB) Viewed 9661 times
One last raft of electronic noob questions. Promise! I need to apply 5v to the hex converter input to turn the LEDs off; so, from what I've read, I'll need the inputs pulled up with resistors or I'll need to rely on the IO board's controller to pull up the led pins? Does anyone know if the controller on the board is set to do that, or should I be using pull-up resistors anyway? Does a t04 help with this in any way, over the u04 I've been playing with?

Thanks again!

Geords.
User avatar
legacypixels
Posts: 91
Joined: Sun May 24, 2020 9:20 pm
Has thanked: 25 times
Been thanked: 25 times

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by legacypixels »

Generally speaking, unbuffered logic can be made to do weird, "non-digital" things, so not my first choice. That said, for this application, almost any 7404 should work. The variants have to do with speed, logic levels (CMOS, TTL, etc). Pullups: probably not. I haven't checked, it actually depends on how the FPGA pins are configured, but It would be bad practice to leave them floating. Bottom line, you should be fine. Be sure to post pics when you are finished, I bet it will look cool.
US based seller of MiSTer addon boards. Visit https://www.legacypixels.com/mister
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

Great!

I'm planning on knocking up a little circuit board to hold the inverter and some idc sockets. Another learning opportunity!

I'll post another pic once I have LEDs going, but here's the current 'dark' unit.
20200802_142000.jpg
20200802_142000.jpg (2.69 MiB) Viewed 9643 times
My metal work and paint skills are worse than my electronics, so apologies for the wonky back panel.
20200802_141920.jpg
20200802_141920.jpg (2.93 MiB) Viewed 9643 times
If i can persuade the missus to let me have an analogue TV in the house, I'll open up the scart holes and start getting it 'Analogue Ready'. :-)

Thanks again for the replies. It's really helped me to gain some extra confidence.
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

Roomy inside.
20200802_150252.jpg
20200802_150252.jpg (2.9 MiB) Viewed 9642 times
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

So I think I'm there.

I summoned up the courage to apply Volt meter probes to the IO' board's led pins. Always terrified of shorting something important. :shock: Documenting what I found for any other noobs who need to know what these pins run at - and have hands as shaky as mine.

For future reference, I measured the following voltages on the IO board's LED pins.

1: +5(ish)V
2, 3, 4: +3.3v off, Gnd on.
5: Don't care.
6: Gnd
7: +3.3V

So it looks like the mister board's mcp23009 IO expander chip is operating with a Vdd of 3.3V, and the pins *are* being pulled high for off. Great!

And in fact upon reading the drawing on github it says this; and also "Do not pull up to 5V!". So I won't . :-)

But I think this means I'll need a hex inverter with a minimum high level input voltage of less than 3.3V.

The 74HCU04 model I initially purchased requires a minimum high level of 3.7V at 5V, so this will likely not detect the IO, board's 3.3V as high. THE HC stands for high speed CMOS and - from what I've learned - CMOS voltage levels need to be quite high for, erm, high.

If I understand what I've learned correctly, devices designed to accept TTL levels at their inputs will consider input levels above 2V to be high. The 74HCT04 suggested by legacypixel comes into it's own here as "The inputs are compatible
with TTL, NMOS and CMOS output voltage levels...": https://docs.rs-online.com/a33d/0900766b8136c8aa.pdf

The HCT bit is what we need to look for here: https://en.wikipedia.org/wiki/HCMOS . HCT means high speed CMOS with TRANSISTOR-TRANSISTOR LOGIC voltages.

So the upshot is that it looks like (as legacy pixel originally suggested) I can get get away with just an HCT. It's been a great learning experience and I've got the HCUs in the bag for if I ever need to look at crystals or "other ceramic oscillators needing linearity". Surely just a matter of time... ;-).
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

some time later...

I present to you the 'MiSTer FPGA Digital IO Board v1.2 to Bang and Olufsen HDR 2 LED Adaptor (rev 0.0.1).

Red dot for standby power, Green dot when I flick the inline power switch. Power -> Replay, Disk -> Timer, User -> Record. At least Replay and timer kinda make sense. :D

I wanted to learn a bit of PCB design as part of this project, so I download the RS Spark PCB application and drew up a little circuit board. I'd always wanted to get something in the post from PCBWay; so I took a very deep breath, uploaded the Gerber file and hit 'Confirm Order'. I also ordered an external cable set from Nat at misterfpga.co.uk at the same time. This comes with the required 2.5[4] 7 pin XH plug. More on that later.

While I was waiting for my boards, I ordered some JST PH connectors from RS to hook up both the standby power and to connect the B&O LED card. The original card comes with a six pin PH plug. I soldered up the sockets for the board and - yep - managed to solder the XH connector on the wrong way round. Of course I only had one of those... RS don't sell 2.54 XH connectors. Genuine JST XH connectors are all 2.50mm. Aliexpress is taking weeks to deliver at the moment, so I ordered some genuine JST 2.50mm spaced sockets from RS - not really expecting them to fit the wired 2.54mm plug that I'd bought from Nat. Still I held a forlorn hope that I might just be able to bash them together.

When the RS sockets arrived I was really surprised to find that they fitted the plug perfectly. I've compared the genuine and Chinese XH sockets and I really can't see any difference in the size. Not any. My guess is that lots of 3rd part XH sockets are actually 2.50mm but are marketed as 2.54 as it's a more common size - and close enough that most PCBs designed for a 2.54 row with a small number of pins will have enough tolerance to take a 2.50 spaced socket. The 2 pin PH connectors have not arrived yet, so I designated one of the PCBWay boards as a practice board and soldered the standby power directly onto it. I'll swap it out for one with a socket when they arrive.

But yes, I now have lights! It's a long shot I know, but let me know if you find yourself putting your own mister into one of these cases, and want a board. I have three spares!
20200905_144252.jpg
20200905_144252.jpg (1.57 MiB) Viewed 9565 times
20200905_145237.jpg
20200905_145237.jpg (235.87 KiB) Viewed 9565 times
20200905_145257.jpg
20200905_145257.jpg (198.75 KiB) Viewed 9565 times
20200905_145250.jpg
20200905_145250.jpg (304.8 KiB) Viewed 9565 times
User avatar
legacypixels
Posts: 91
Joined: Sun May 24, 2020 9:20 pm
Has thanked: 25 times
Been thanked: 25 times

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by legacypixels »

Looks Great! Nice job.
US based seller of MiSTer addon boards. Visit https://www.legacypixels.com/mister
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

Thanks for all the pointers!

Seems to work with all the cores I've tried so far.

The only slight bit of weirdness is the minimig core.

When a i run a game via whdload, the led driven by the inverted power signal dims. It comes straight back when i exit the game. Weird.

My circuit doesn't put a cap between the 5v pin and ground on the io pins. And ground for the led power is coming straight off the power plug whereas the inverter gets its power from these io board pins. The two grounds for these supplies are not connected on my pcb.

If any of those sound like possible causes I might incorporate fixes into rev 0.0.2. :)

But weird its just happening on minimig when i whdload a game...
Geords
Posts: 28
Joined: Sun Jul 26, 2020 1:20 am

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by Geords »

I think the minimig power dim 'issue' might be this!
https://eab.abime.net/showthread.php?t=49245

It sounds an awful lot like what I'm observing.

So maybe no need for rev 0.0.2?
User avatar
legacypixels
Posts: 91
Joined: Sun May 24, 2020 9:20 pm
Has thanked: 25 times
Been thanked: 25 times

Re: Digital IO Board V1.2 to custom LED circuit.

Unread post by legacypixels »

Yes, power LED control is in the core: (minimig.v)

Code: Select all

// 03-12-2006	-added dimming powerled


//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------

// power led control
reg [5:0] led_cnt;
reg led_dim;

always @ (posedge clk) begin
  led_cnt <= led_cnt + 1'd1;
  led_dim <= |led_cnt[5:2];
end

assign pwr_led = ~(_led & led_dim);
US based seller of MiSTer addon boards. Visit https://www.legacypixels.com/mister
Post Reply