Teensy 4.1, Ethernet Interface and SMB Server

Hi Everyone

Apologies if these questions have been asked in other threads, but I've done a number of searches and not been able to find any references.

I have my Teensy 4.1 up and running. Now I want to add an Ethernet socket and talk to my network. I have a Sparkfun MagJack - is there any reason I can't hardwire to that? Do I need any capacitors to make it work? I saw a post which suggested a 0.1uF was required but it wasn't obvious to me which pins to connect it across.

I want to gather data with the T4.1, connect to an SMB server on my network, create a file and write data to it on the network server. Is there any code out there to help me achieve this?
 
I was just looking at the Sparkfun magjack schematic yesterday. It appears to include the required capacitor inside the magjack. So no external components are required.
 
Which Sparkfun product? These are the 2 magjacks I was able to find on their site.

https://www.sparkfun.com/products/8534

https://www.sparkfun.com/products/13021

Both of these require you to add a 0.1 uF capacitor, connected to these pins:

magjack.png

To use these with Teensy 4.1, you need to short the P3 and P6 pins together, and then connect a 0.1 uF capacitor between those wires and the GND pin on Teensy 4.1. The other signal pins, P1, P2, P7, P8 connect directly to the 4 ethernet signal pins.

You should also connect GND to the shield. But that 1000 pF capacitor connected to the 75 ohm resistors is not enough. It only provides the "Bob Smith termination" for the 4 unused wires in the cable. That's a completely different thing than the 0.1 uF capacitor needed between the transformer center taps and Teensy GND.
 
Hi Paul

Thanks for your detailed reply which not only worked first time, but also taught me stuff about the Ethernet hardware interface I should have known years ago :)

Does anyone knows of any code examples which would let a T4.1 access an SMB server to create files? The alternative is to store data files on an SD card and implement a Web Server on the T4.1 to make them accessible over my local network, but that's been done, so less fun.
 
Hi DazedAndConfused (or anyone else who knows), would you mind just clarifying the connections you used to the Sparkfun board (assuming you're using the breakout board)? I've been scratching my head over this for some time this morning!

I get the bit about shorting P3 and P6 then a cap to GND. But as for the rest, are we talking something like this?


T+ -> P1
T- -> P2
R+ -> P7
R- -> P8


And then GND and LED to one of the LEDs (does it matter which?). I've never needed to look at the connections to an ethernet socket before, and just want to minimise the number of things I've possibly got wrong before I start on the code!
 
Thanks Paul - I'd already bought the parts to make my own, before you started selling yours. And, being in the UK, it's a little more tricky (or expensive) to get hold of anyway.
 
Perfectly fine to DIY build it. If you get it working with the Sparkfun board or any other hardware, hope you'll share a photo. Might help anyone else who later finds this thread and want to try building it themselves.
 
Well that seems to work, so for anyone else using the Sparkfun magjack breakout, here's the connections to the 6-pin ethernet header on the Teensy 4.1:

Teensy Sparkfun Magjack.png
 
Back
Top