N2 - SPDIF wiring question for a Toslink connection

Post Reply
primer777
Posts: 6
Joined: Sun Jan 26, 2020 5:53 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 2 times
Contact:

N2 - SPDIF wiring question for a Toslink connection

Unread post by primer777 » Sun Jan 26, 2020 7:06 pm

This is a question about wiring from the SPDIF (on the N2 GPIO header) to a toslink. So I don't screw up this connection.
I've ordered a Toslink - Toshiba 1350 TOTX (F), and intend to wire it to the N2 GPIO header. (at Pin #7). Currently I'm waiting
for the TX to arrive (any day now). I see the spec's on the 1350 (F) and its 5v, (so I'm intending to use the 5v output on the header).
But I note this TX unit has no ground pins. It has 3 x N/C, 1 x Cathode, 1 x Anode. I'm closely following posted wiring connection
info "from an older SPDIF post" (on this N2 forum) Which says the C2 odroid and N2 are similar (also that this Toslink connection is
basically the same as installing an LED). I'm intending to put a 100 ohm resistor on the SPDIF line (to be safe) as recommended.
But I'm wondering if anyone can confirm whether the 5v VCC (from the N2 Header) goes to the Cathode or the Anode pin on this
Toshiba TX (or does it matter?) Also if I should connect a ground wire (from the GPIO header) to a N/C pin on the TX ?
(not sure if that serves a purpose) Or should I just forget the ground wire completely? Any advice or suggestions..... would be
greatly appreciated. Thank you.

link to Toshiba 1350 TOTX (F) spec's
https://www.mouser.ca/ProductDetail/Tos ... JxocjtQ%3D

https://www.mouser.ca/datasheet/2/408/T ... 771377.pdf

*** It wasn't possible for me to order the PhotoLink Module (as recommended with the C2 info)
This Toshiba 1350 (f) was my only viable option (here in Canada)

joerg
Posts: 942
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 13 times
Been thanked: 39 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by joerg » Mon Jan 27, 2020 2:59 am

Hello primer777,
this device has no internal amplifier as the one I posted for C2.
But you can give it a try to connect this way:
Cahode pin2 you connect to GND.
Anode pin3 you connect to a resistor of about 270Ohms and the other pin of the resistor to the Header pin7.

The idea is that normaly if the spdif is enabled, the header pin has 3.3V. To drive the led inside the TOTX you need to connect the cathode to 0V. The resistor is there to limit the current. Be careful, without resistor you can damage the N2 and also the TOTX.
I hope the N2 can drive about 5mA. It depends on how the gpio is configured. With DS=3, the datasheet of S922 says maximum 6mA. But if the gpio is configured with DS=0, then you will get not more than 0.5mA. You might come back and need to ask if the pin can easily be switched to DS=3. Or as an alternative, to spent a transistor to drive the led current.
Hope it works.
These users thanked the author joerg for the post (total 2):
rooted (Mon Jan 27, 2020 8:20 am) • primer777 (Tue Jan 28, 2020 2:12 am)

primer777
Posts: 6
Joined: Sun Jan 26, 2020 5:53 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by primer777 » Tue Jan 28, 2020 2:10 am

Hi Joerg, thank you very much for your detailed reply. Everything you said was very clear. What you suggest about connecting
the cathode (pin 2) to 0v - (ground) is something I'd considered, but I couldn't see how that would complete the circuit I was
trying to make. (lol). I knew I could complete a voltage circuit (of course) but where the SPDIF fitted in to that equation wasn't clear.
(with only two pins available). Your answer clearly explains why it can work given that I can get 3.3v from the SPDIF. I wasn't aware
there was 3.3v available at the SPDIF (when activated).... that's great news.

I'd also been thinking I "had" to use a 5v power source (for the 1350 TX) to drive it. I say that as its listed spec's show only 5v.
There doesn't appear to be any "variable voltages" for it (none that I could see anyway). I actually ordered it at a local Electronic
store (in Town) and I asked (at that time) if it was a variable voltage Toslink module (and they said "yes"). But when I read the specs
closely, I could just find (two) 5v applications examples (as shown in the PDF info doc - link below). It really doesn't state any
"min/max" voltage requirements (or any variable voltage ranges) for this particular module. I'm left assuming it may mean it can use
up to 5v (and not just 5v). I'm hoping that's the situation. It wasn't a huge concern (when my intended source was to be 5v anyway)
but now that its 3.3v (from the SPDIF) I'm left wondering about that. (especially with a 270 ohms resistor in place)

The 5ma and GPIO configuration hopefully will not be a problem......but that's another topic... .ha! ha!

https://www.mouser.ca/datasheet/2/408/T ... 771377.pdf

Anyway, when the 1350 Tx arrives, I'll put together the circuit (you've suggested) with the new 270 ohm resistor, and post here again
with the results. I just want to say once again. Thank you so much Joerg...... your suggestions have given me a path forward

joerg
Posts: 942
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 13 times
Been thanked: 39 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by joerg » Tue Jan 28, 2020 3:17 am

Hi primer777, when I review the datasheet I must say that it can also work with lower current. They say with 1.5mA the transmission distance is about 50m.
Now an example how to calculate the resistor, if there is 3.3V and the datasheet says at 1.5mA the led has 1.8V forward voltage:
U resistor = 3.3V - 1.8V = 1.5V
R resistor = 1.5V / 0.0015A = 1000Ohms
As you see you can play with the resistor value to get an optimal light. If you connect 3 resistors of 270 in serial you will get 1.5V / 810Ohm = 1.8mA.
These users thanked the author joerg for the post (total 2):
primer777 (Wed Jan 29, 2020 7:52 am) • Gburas (Mon Feb 03, 2020 10:17 pm)

primer777
Posts: 6
Joined: Sun Jan 26, 2020 5:53 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by primer777 » Wed Jan 29, 2020 7:52 am

Hello joerg, thank you once again for your help and advice. I've read your latest reply and I understand everything you've stated.
Once again, you've laid everything out clearly to follow, and the reasoning behind it. Thank you so much for that. I'm planning
now on making the 3 x 270 ohms setup as you suggest (as it makes perfect sense). I will have a few minor changes in the way I'll
be installing the wiring now (due to the extra resistors) but its nothing major. I'm not bread-boarding this, although I *will be
making jumper connections to the header, I'll be soldering the rest, and then fitting everything into a re-purposed Phone/adapter.
It's my intention to mount that box on the upper side of the N2 case (I have one of those split plastic N2 shell cases). The smaller split
side of the case will be where I'll attach the box. (that part of the case doesn't need to be taken off) because its at the rear of the N2.
The larger side of the case will be able to slide On/off (when I need access) and I won't need to disconnect any wiring doing it this way.
It won't be a professional setup by any means, (not even close) but it'll work for me. Once I put the basic wiring together (and test its
functionality) I'll post back here with the results. I'll do that before making my mounting "setup" more permanent on the case....

Also as a foot note to this. As luck (and perseverance) would have it, I've now successfully sourced the Toslink / Photolink Module I was
originally trying to get. The PLT133/T - 16 mbs. That's a module you'll be more familiar with (of course) but the good news is that soon I'll have
access to one of those too. So if this setup doesn't pan out (and I don't wreck the N2 doing it). :roll: I'll have a backup option. (the PLT133/T
was my original plan A) until I couldn't locate one. Also (not important) but just as a matter of interest the Photolink - PLT133/T (here in Canada)
is coming in at just 1/4 of the price of the Toshiba 1350 TOTX. Neither are really expensive (as such) but @ 4 x the price for the Toshiba module
(than the Photolink) its hard to figure out why.

Anyway, I just want say thank you again, and let you know I *really appreciate your advice and suggestions. As I said I'll post here (again) when
I put this together and have some results to share.

primer777
Posts: 6
Joined: Sun Jan 26, 2020 5:53 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by primer777 » Fri Jan 31, 2020 4:47 am

Hello again joerg, (and to anyone else interested in this SPDIF topic). Today I can share the results of wiring the Toshiba 1350 TOTX
(to the N2's - SPDIF on the GPIO header) As per your advice joerg:

1) Ground pin #6 on GPIO header wired to (Pin #2 cathode on Toshiba 1350) - making a 0v Ground
2) 3 x 270 ohms (in series) from Pin #7 (SPDIF on GPIO header) to Pin #3 (Anode on Toshiba 1350)

Joerg, I can confirm that this works perfectly to get 5.1 audio to the Toslink connection. I've tested it extensively using the latest CoreElec
version (booting from a micro SD card). I have pass through enabled to SPDIF (set in CoreElec). With this, I'm getting 5.1 channels - DTS -
and Dolby to my AVR now (via the newly installed Toslink). There's no Audio sync problems. There's no interference of any kind.
(even when switching between modes). This setup works, and it works very well....

I'm still getting audio over HDMI to the TV too (the TV speakers are set to "external") My Samsung TV - (a slightly older LED model)
still passes 2 channel Stereo as it always has (from the N2's / CoreElec HDMI). So I can still use that option too, when I need it
(just by switching the AVR input selector from Digital / to TV sound)

In effect I have every option that I want. :D

What kind of surprised me (just a little) is that from within CoreElec (Using the IR remote "Shutdown" feature) which is activated from
CoreElec's modified boot config file. The IR remote options feature still shuts down CoreElec (and the N2). As in , the N2 has no Red or Blue
LEd's lit afterwards, but the Toshiba 1350 - Toslink, still remains lit (red). The only way to shut down it down, (to shut off the Red Toslink LED light)
is to physically unplug the Power cable from the N2. That's more of a minor issue for me, but leaving the Toslink powered up (when the N2 is shutdown
via the IR remote feature). That may (?) reduce the life of the Toslink over time (there's a warning to that effect in the Toshiba spec's) As I said that's
not a big deal, but it looks like the SPDIF is still putting out a signal. (or a least its lighting the Toslink Red LED)... when shutdown with the IR remote option.

As a final footnote to this topic: I've now mounted the small modified telephone "Adapter box" containing the Toshiba - Toslink
(and the 3 resistors inside) onto the top of the N2's plastic split case. And everything works as hoped. So I now have a working Toslink permanently
attached to the N2 now. (albeit not a pro - job.... it looks fine and it works) Best part is there's no need to unplug any wiring to get access to the
N2's board or other features. (I can just slide the front part of the cover off)

To anyone following this thread? I can absolutely say full credits here must go to "joerg" for his excellent advice. I send my much appreciated
"Thank You" to joerg. Not only for the sound advice offered (pun intended... ha! ha!) but for actually taking your time to respond and
help me out when I was stuck without a path forward. Your suggestions have worked great. I'm 100% happy with the results. No issues
whatsoever....

Thank you once again :)

joerg
Posts: 942
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 13 times
Been thanked: 39 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by joerg » Fri Jan 31, 2020 5:00 am

Great that it works!
We have to ask to the hardkernel guys, why the gpio stays high when the board is shut down. I think when the driver unloads it does not switch the gpio to its initial state. Or there might be an option to do it by a script...
These users thanked the author joerg for the post (total 2):
Gburas (Mon Feb 03, 2020 10:18 pm) • primer777 (Mon Feb 24, 2020 8:42 am)

knutzone
Posts: 10
Joined: Fri Jan 17, 2020 11:18 pm
languages_spoken: english
ODROIDs: Odroid N2 4GB
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by knutzone » Mon Feb 03, 2020 8:50 pm

Hello there,

just want to show my solution. I ordered a Toshiba TOTX179PL via ebay, then soldered it on a breadboard and added a 100 ohm resistor to the S/PDIF pin and a 0,1µF capacitor parallel to +5,0V and GND, connected S/PDIF to pin 7, +5,0V to pin 4 and GND to pin 6 of the N2 GPIO. Works perfectly, enjoing DD an DTS now! It also poweroff the Toslink by switching the remote control.
:D
I opened it for demonstration:
Fig_1.jpg
Black: GND
Red: +5,0V
Yellow: S/PDIF
Fig_1.jpg (143.15 KiB) Viewed 856 times
Fig_2.jpg
In temporary housing.
Fig_2.jpg (66.15 KiB) Viewed 856 times
These users thanked the author knutzone for the post:
odroid (Tue Feb 04, 2020 10:14 am)

primer777
Posts: 6
Joined: Sun Jan 26, 2020 5:53 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by primer777 » Tue Feb 04, 2020 7:39 am

Hi knutzone, thank you for sharing your project and the photos :) I note that the version of the Toshiba Module you
have is of course a 3 pin (which gives you so many more options). How you wired it is a very nice setup. It's actually pretty
close to what I was planning on doing (minus the breadboard) until I had problems finding anything other than the
2 Pin Toshiba 1350 TX (that I ended up working with). You may have noticed in my previous post that I had one minor
outstanding issue (which you don't have) In that the GPIO remained high (when I shutdown with the IR remote)
That of course left the Toskink hot until the power supply was unplugged. That little issue was solved really easy in the end.
I just added a basis AC Wall Remote Switch to the N2 power supply (at its source). I still use the IR Remote to shutdown
the N2 (even though I really don't need to) but when I'm done using the N2 Odroid I shut everything off via the AC wall remote
switch. When I restart. I use the Wall Remote to put power to the N2, but unlike when you plug/unplug it doesn't boot
automatically. I can power it on then with IR remote. In truth it works even better for me this way. Anyway, I just
thought as you've very kindly posted some photos, I'd do the same. Where I mounted the Adapter box it also allows me
to slide the front part of the split N2 case off, without disconnecting any wiring.
Attachments
image#2.jpg
image#2.jpg (531.57 KiB) Viewed 810 times
image#1.jpg
image#1.jpg (369.32 KiB) Viewed 810 times
These users thanked the author primer777 for the post:
odroid (Tue Feb 04, 2020 10:14 am)

User avatar
tony.hong
Posts: 83
Joined: Tue Jun 04, 2019 1:49 pm
languages_spoken: korean
ODROIDs: All
Location: korea
Has thanked: 22 times
Been thanked: 28 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by tony.hong » Mon Feb 17, 2020 6:08 pm

What kind of surprised me (just a little) is that from within CoreElec (Using the IR remote "Shutdown" feature) which is activated from
CoreElec's modified boot config file. The IR remote options feature still shuts down CoreElec (and the N2). As in , the N2 has no Red or Blue
LEd's lit afterwards, but the Toshiba 1350 - Toslink, still remains lit (red). The only way to shut down it down, (to shut off the Red Toslink LED light)
is to physically unplug the Power cable from the N2. That's more of a minor issue for me, but leaving the Toslink powered up (when the N2 is shutdown
via the IR remote feature). That may (?) reduce the life of the Toslink over time (there's a warning to that effect in the Toshiba spec's) As I said that's
not a big deal, but it looks like the SPDIF is still putting out a signal. (or a least its lighting the Toslink Red LED)... when shutdown with the IR remote option.
Hi, primer777

Updated u-boot to fix the issue where SPDIF-out is still on when running 'shutdown'.
https://github.com/hardkernel/u-boot/co ... acea549d03

I hope this update will make your Odroid life more enjoyable. :)

PS. I am not sure when the patch will apply to CE. Ask CoreElec guys :lol:
These users thanked the author tony.hong for the post (total 2):
joerg (Tue Feb 18, 2020 1:50 am) • primer777 (Mon Feb 24, 2020 8:42 am)

primer777
Posts: 6
Joined: Sun Jan 26, 2020 5:53 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: N2 - SPDIF wiring question for a Toslink connection

Unread post by primer777 » Mon Feb 24, 2020 8:41 am

hi tony.hong

Thank you for the update (to fix the SPDIF "staying high" when its shutdown). It certainly *will makes using the Odroid that little bit safer to use,
knowing it can be shutdown completely. For now, I've been using an additional On-off Remote AC Power switch to shutdown the N2 (after shutting
down with the IR remote) and it's worked good for me without any issues. I just have to use two remotes (as opposed to one). :?

About the N2 in general (as with most things) I'm learning more and more about what the Odroid can actually do. And it's amazing! Right now
I'm just enjoying the N2 with CoreElec (for now) and running media to it from my computers. I've also added a USB 3.0 hub and that gives me even
more media options. Everything is running flawlessly! I also have Linux, that was Pre-programmed onto the Odroid (Red dot) memory, along with
the little USB programming adapter. (if I ever need it). When I'm done exploring all the CoreElec features (and get more adventurous) I'll be putting
that Linux Module into the N2 and dual booting both CoreElec (From SD) and Linux from internal. (which I presume many Odroid user are already doing).

For me? I think the Odroid is blowing away everything that's out there right now! (and that includes the Pi). The Odroid out performs all of my other
Streaming boxes (and I have a few) And also my other SBC too. (windows based). The Odroid is just way more versatile and it runs flawlessly. So for me
the N2 Odroid was a great purchase, and with the support in these forum.... its even better. Thank you! It would've been nice if the N2 had come with
an "Optical out" (or an adapter board). But I also understand many of the newer offerings don't have any optical outs either (or add on boards). It's kind
of a sad reality in some ways, as there are still many people out there who could still use a Toslink feature ..... but (in a way) its understandable too
as HDMI has taken. My problem was I couldn't find an HDMI Audio Extractor that would actually work (as in process HD video to the TV) and give
Digital Audio out too. All the ones I tried had issues. But thanks to joeg, I was able to get that TOSLINK sorted, and working perfectly, so I could
forget about HDMI Audio Extractors and all is well... (thank you once again Joeg. :) )

And Yes! That emoticon (at the end of your post, tony) I do get it ... :lol:
These users thanked the author primer777 for the post:
tony.hong (Mon Feb 24, 2020 10:43 am)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 2 guests