Some time ago I added Ethernet to some of my PCB designs. I used the KSZ8851SNL SPI Ethernet chip. The main reasons for doing this were :-
- Single chip MAC & PHY
- Supported by an ESP IDF module
- No built in TCP crap (just raw packets), so avoiding issues with lack of IPv6, etc
- Available from JLC
To my surprise I have actually done NINE PCB designs with this now. OK, two are test boards, but that is still a lot. The reason that matters is because I am changing them all to use a CH390D SPI Ethernet chip now. Why am I doing this... Well let's compare.
KSZ8851SNL
This is the recommended circuit. As you can see, we have the chip, crystal, magnetics, RJ45, and some 27 passive components. The circuit worked - well seems to - since initial designs that have worked well I have had batches that are unreliable, which is actually a big concern.
It also gets hot, I have measured 65C, even with thermal vias under the chip, as recommended.
CH390D
This is the recommended circuit. As you can see, we have the chip, crystal, magnetics, RJ45, and some 6 passive components.
Some key tricks here are that the chip includes the 50Ω resistors for Ethernet, and the 12pF capacitors for the crystal.
As a result, it takes a lot less space...
So I ordered test boards, and had a slight panic!
The code change was a search and replace, crazy simple. ESP IDF have a CH390 module.
It started well - first couple of boards said ATE “PASS”. Wow. Then an “eth init fail” - tried again and “PASS”. Odd. Then OK. Then more needing two goes. In the end three would not PASS at all!
Worst kind of error - intermittent. It was a reset timeout. I poked with settings in ESP IDF for reset timings and timeouts. No joy!
But some boards did start. Good. Let’s look at those. Connected Ethernet cable and, nothing. No errors but no packets. Dead! Argggg! And this was all of the “working” ones.
I was really getting a bit down. Then, on an off chance it removed the reset GPIO from setting leaving it to float (weak pull up). Bingo. All boards now start up and pass packets. They work perfectly. WTAF.
I have now made my code do a controlled reset before invoking ESP IDF, and telling ESP IDF there is no reset GPIO. This all works. Phew!
Comparison
- KSZ8851SNL $3.92, CH390D $1.18
- KSZ8851SNL 65C, CH390D 45C
- KSZ8851SNL 5x5mm and 27 passives, CH390D 3x3 and 6 passives




No comments:
Post a Comment
Comments are moderated purely to filter out obvious spam, but it means they may not show immediately.