Author Topic: Ethernet board development!!!  (Read 4518 times)

0 Members and 1 Guest are viewing this topic.

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Ethernet board development!!!
« on: January 20, 2024, 05:33:00 pm »
Hi everyone,

This is my first post in this forum. Here is my problem: I would like to develop a 10/100 ethernet card with the help of which I can send some output states (ON/OFF) on some pins of microcontrolers (which will actuate some relays). I have a little introduction to Atmel and ARM STM32 microcontrollers and I don't know how I can build such a PCB as simply as possible!!!

I was thinking of using an ARM STM32F103 with 48 pins together with a LAN8720A to be able to connect the Rj-45 connector and implicitly the ethernet connection. Do you think I could make this simple ethernet board with this STM32 and LAN8720A? Or would it be even simpler to try with an Atmel microcontroller + LAN8720A? And if so, what type of Atmel microcontroller would you recommend?

Of course, any other simpler solution is welcome. I wouldn't necessarily want to use the LAN8720A!!! However, I would like something on Atmel or STM32 microcontrollers!.

Please.
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2588
  • Country: fr
    • kripton2035 schematics repository
Re: Ethernet board development!!!
« Reply #1 on: January 20, 2024, 05:42:03 pm »
 

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Re: Ethernet board development!!!
« Reply #2 on: January 20, 2024, 06:02:19 pm »
Thanks for the answer, but could I connect two such cards from your example via ethernet cable and pair them client-server, so that when I give an impulse on an input of one card, the other card responds, on a specific output pin?
 

Offline fchk

  • Regular Contributor
  • *
  • Posts: 245
  • Country: de
Re: Ethernet board development!!!
« Reply #3 on: January 20, 2024, 06:07:59 pm »
The simplest hardware solution would be a PIC18F67J60. This is a 64 pin chip containing 8 bit processor, flash, RAM, UART/I2C, SPI, Ethernet MAC and Ethernet PHY. The only thing you need to add is 3.3V power, 25 MHz crystal, some passives, and a magjack.

https://www.microchip.com/en-us/product/pic18f67j60

From a software perspective the easiest way is a Wiznet 6100 chip connected via SPI to your preferred microcontroller. This chip has got the basic Internet protocols hardwired, so you don't need any software for this.
https://www.wiznet.io/product-item/w6100/

STM32F103 is old, and you risk getting fakes. Use something newer and better. STM32F302 for example.
https://www.st.com/en/microcontrollers-microprocessors/stm32f302.html

If you want Microchip (ex-Atmel), then use the newer AVR128D* instead of the old Atmega series.
 

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Re: Ethernet board development!!!
« Reply #4 on: January 20, 2024, 07:16:29 pm »
Thanks for the reply.
I will analyze your solutions.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3710
  • Country: nl
Re: Ethernet board development!!!
« Reply #5 on: January 20, 2024, 08:05:05 pm »
I was thinking of using an ARM STM32F103 with 48 pins together with a LAN8720A to be able to connect the Rj-45 connector and implicitly the ethernet connection.

This is not going to work. The LAN8720A is a PHY that needs a RMII connection to an ethernet MAC. The STM32F103 does not have this interface.

It could be done with a STM32F407 or one of the other STM devices that have an ethernet MAC integrated as peripheral.

If it is only about switching some output pins from a server, then a solution with an already mentioned Wiznet chip like the W5500 and an AVR chip like on the Arduino nano can do the trick.

I would recommend to first buy a couple of modules and slap them together to get your software working and see if your concept works and then think of designing a PCB for it.

Sorry for links to the Dutch Aliexpress site, but the item id will be the same in what ever country/language you need them.

For instance a W5500 module example here https://nl.aliexpress.com/item/32832354059.html and a STM32F103 module example here https://nl.aliexpress.com/item/1005005764647193.html.

Or a LAN8720 module example here https://nl.aliexpress.com/item/32485939954.html and a STM32F407 module example here https://nl.aliexpress.com/item/4000602517153.html

There are many different solutions of course and my point was to make you aware of looking at the specifications of the devices you are looking at to make sure they match with each other.

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2588
  • Country: fr
    • kripton2035 schematics repository
Re: Ethernet board development!!!
« Reply #6 on: January 20, 2024, 08:21:01 pm »
Thanks for the answer, but could I connect two such cards from your example via ethernet cable and pair them client-server, so that when I give an impulse on an input of one card, the other card responds, on a specific output pin?
yes you can do that with these cards. you need to program the esp32 one as a client and one as a server. it can be done using arduino ide for these boards.
 

Online tellurium

  • Regular Contributor
  • *
  • Posts: 231
  • Country: ua
Re: Ethernet board development!!!
« Reply #7 on: January 20, 2024, 10:09:40 pm »
A possible solution: (almost) any micro + W5500 (MAC + PHY).
Example board: W5500-EVB-Pico, which is RP2040 + W5500
https://docs.wiznet.io/Product/iEthernet/W5500/w5500-evb-pico

They share schematic, etc.

If you want TCP/IP to fly via your Ethernet connection, you'd better choose a micro with more RAM - and rp2040 there is a good choice for this regard.

Another solution is ch32v307, which has MAC + PHY onboard - and it has been discussed on this forum extensively.
« Last Edit: January 20, 2024, 10:12:23 pm by tellurium »
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Ethernet board development!!!
« Reply #8 on: January 20, 2024, 10:54:39 pm »
I second the solution for using a Wiznet chip. The easiest solution by far and nowadays they also have IPv6 versions available.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Re: Ethernet board development!!!
« Reply #9 on: January 21, 2024, 07:17:25 pm »
Thank you all for the answers.

I especially appreciate the response of the user @pcprogrammer who said, I quote: "This is not going to work. The LAN8720A is a PHY that needs a RMII connection to an ethernet MAC. The STM32F103 does not have this interface".
I will continue to analyze the solutions proposed by you. Thank you very much everyone.
 
The following users thanked this post: pcprogrammer

Offline tilblackout

  • Contributor
  • Posts: 31
  • Country: cn
Re: Ethernet board development!!!
« Reply #10 on: January 22, 2024, 03:50:55 am »
Basically, every product in my company uses Ethernet with RGMII interface. According to my experience, only high-end chips support this interface. For example, chips that support Cortex-A cores and can run Linux such as STM32 MP series, as well as high-end MCU chips such as I.MX RT series from NXP.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3710
  • Country: nl
Re: Ethernet board development!!!
« Reply #11 on: January 22, 2024, 07:42:41 am »
Basically, every product in my company uses Ethernet with RGMII interface. According to my experience, only high-end chips support this interface. For example, chips that support Cortex-A cores and can run Linux such as STM32 MP series, as well as high-end MCU chips such as I.MX RT series from NXP.

Good for your company, but the OP specifically mentioned 10/100Mbit ethernet, so no need for high end chips that support 1Gbit ethernet. Even a simple AVR with a W5500 can do the trick. There are examples around in the Arduino world where this combination allows controlling pins from another computer. This seems to be all the OP is after.

Offline elektryk

  • Regular Contributor
  • *
  • Posts: 81
  • Country: pl
Re: Ethernet board development!!!
« Reply #12 on: January 22, 2024, 09:00:59 am »
Quote
I would like to develop a 10/100 ethernet card with the help of which I can send some output states (ON/OFF) on some pins of microcontrolers (which will actuate some relays).

Easy solution to do that is ENC28J60 with AVR. For toggling some pins 10Mbps should be sufficient.
http://tuxgraphics.org/electronics/200905/embedded-tcp-ip-stack.shtml
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3700
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet board development!!!
« Reply #13 on: January 22, 2024, 10:01:07 am »
The hardware for this is trivial. Just buy some development board which has

- an RJ45 connector with integrated magnetics (Hanrun is a big name)
- a PHY chip (e.g. LAN8742)
- a CPU which can talk to the PHY chip, and has some GPIO pins which can drive whatever...

But that is about 1% of the job. The other 99% is software to make it all work. You need a TCP/IP stack on the CPU; I use LWIP which, like most high-profile open source software, does work but needs a lot of, shall we say, "integration work" :) and there is no support anywhere. Then you need an application running on the CPU which interfaces to the TCP/IP module (with LWIP you can use BSD sockets or Netconn APIs). Then you need to spend months or years googling for patches to make it all reliable. Then to get a properly finished product you need to write a user interface for configuration, via USB (VCP and/or MSC and a config file) or via an HTTP server running on your box. You can find HTTP server code all over the place, most of it horribly bloated; I started with one such and after some weeks binned it and wrote my own very simple HTTP server in a week or two.

I've done all this (with a colleague, over past 5 years) and really would not want to do it again, ever. I used a STM32F417 and one could not do it with much less by the time you have a "fully finished" product with the above mentioned user interface etc. If you read the many threads I have started here over the last few years you will get the idea :)

Now of course it is all "easy", but I am not going to post a useless statement like that here :) Yes my box does all the above and much more. So if you had a commercial requirement I could easily knock up a daughter board for it (it has an SPI expansion port) with a bunch of MOSFETs or relays. It powers up, gets an IP via DHCP (or fixed IP) and then you could just send it packets. Or you could buy my box (under $200) and design your own expansion board. It also has four serial ports so you could squirt out strings via those.

STM have various "DISCO" boards and you can use CUBE IDE to generate most of the code, and it may even more or less work at a basic level. I think most micro vendors do a similar thing. But  these are just to get you started - beyond flashing an LED they are hard work.

Another much simpler approach which was popular in the early 1990s was to forget TCP/IP and just make a box which receives UDP packets and extracts some bits from them and uses these to drive I/O signals. I used to sell such a thing back then (it was German made). The data was not routable of course, the box had no IP address, just a MAC address which was partly set up on dipswitches. That could probably be done with just the RJ45 and some PHY chip and a simple micro which can talk to the PHY chip using the standard "64 bit UART" interface etc. Or maybe there are PHY chips which are even simpler... This approach might work for you but you could not sell it generally because today everybody wants a TCP/IP product, with all the mod cons like DHCP... it would be a support nightmare because everybody thinks RJ45 = TCP/IP :)

« Last Edit: January 22, 2024, 10:59:02 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2588
  • Country: fr
    • kripton2035 schematics repository
Re: Ethernet board development!!!
« Reply #14 on: January 22, 2024, 11:29:18 am »
really, using the board(s) I gave you above, and two arduino scripts one for the server, one for the client
these scripts are in the arduino IDE examples
it is a quite simple task...
with other controllers it can be more "professional" but really more difficult to achieve...
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2588
  • Country: fr
    • kripton2035 schematics repository
Re: Ethernet board development!!!
« Reply #15 on: January 22, 2024, 11:31:43 am »

 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Ethernet board development!!!
« Reply #16 on: January 22, 2024, 11:57:27 am »
+1 for Wiznet W5500 + any cheap MCU (e.g.CH32V003)
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Re: Ethernet board development!!!
« Reply #17 on: January 22, 2024, 08:39:02 pm »
Thanks again for the answers.

Today a friend brought me a NUCLEO-G474RE board and I would like to know if I can connect another Ethernet board with ENC28J60 to that board ???
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Ethernet board development!!!
« Reply #18 on: January 22, 2024, 08:47:16 pm »
Some of the early  ENC28J60 boards had a MDIX error, meaning that they couldn't do "Auto crossover".
So you had to use a "Crossed ethernet cable".

My suggestion would be to connect both boards to an ethernet switch, and let the switch handle the crossover, and speed/duplex negotiation.

Then it ought to work.

/Bingo
 

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Re: Ethernet board development!!!
« Reply #19 on: February 03, 2024, 07:08:23 am »
If you want Microchip (ex-Atmel), then use the newer AVR128D* instead of the old Atmega series.
We are just analyzing a solution with AVR128D* microcontroller, but I can't find a USB programming board for this series of microcontrollers on the net! Can you help me with an example?
I have boards for programming the old AVR series, but it is not possible to program the AVR128D series that appeared a few years ago!
 

Offline elektryk

  • Regular Contributor
  • *
  • Posts: 81
  • Country: pl
Re: Ethernet board development!!!
« Reply #20 on: February 03, 2024, 09:48:35 am »
There are some dev boards for AVR128, for example https://www.microchip.com/en-us/development-tool/dm164151

If you need programmer only, then check MPLAB Snap.
« Last Edit: February 03, 2024, 09:50:06 am by elektryk »
 

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Re: Ethernet board development!!!
« Reply #21 on: February 03, 2024, 10:09:39 am »
I have seen MPLAB® SNAP at various online stores, but the user manual is quite shallow. For example, in the case of programming some AVR microcontrollers, not exactly all types of microcontrollers supported by this PCB programmer are mentioned and the output connector (see the image below) does not show how to connect it to an AVR or Atmega microcontroller, where we have MISO, MOSI, SCK etc pins???
« Last Edit: February 03, 2024, 12:20:21 pm by pub2024 »
 

Offline elektryk

  • Regular Contributor
  • *
  • Posts: 81
  • Country: pl
Re: Ethernet board development!!!
« Reply #22 on: February 03, 2024, 03:05:48 pm »
 

Offline pub2024Topic starter

  • Contributor
  • !
  • Posts: 11
  • Country: ro
Re: Ethernet board development!!!
« Reply #23 on: February 04, 2024, 07:40:05 am »
Thanks.
 

Offline elektryk

  • Regular Contributor
  • *
  • Posts: 81
  • Country: pl
Re: Ethernet board development!!!
« Reply #24 on: February 05, 2024, 05:31:30 am »
I'm not sure if they improved it in newer revisions but I had to add pullup in mine to work with UPDI (just added pullup without removing pull down).
https://ww1.microchip.com/downloads/en/DeviceDoc/ETN36_MPLAB%20Snap%20AVR%20Interface%20Modification.pdf
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8178
  • Country: fi
Re: Ethernet board development!!!
« Reply #25 on: February 05, 2024, 11:50:52 am »
I second the solution for using a Wiznet chip. The easiest solution by far and nowadays they also have IPv6 versions available.

Yeah. I have to add though that even this isn't completely problem free solution, though it bypasses a large part of peter-h's complaints, but not everything. The chip implements ARP, TCP and IP on-chip, but not only you have to interface with this chip, you also need DHCP and DNS software implementations, and the code supplied by Wiznet is broken (e.g., overindexing memory) so you need to either fix it or find working implementations which still need integration work. But sure, DNS and DHCP are both very simple protocols. And if you need TLS, integration work for something like mbedTLS is needed too.

But sure, bypassing monstrosity like lwip helps, and time-to-market with Wiznet is probably faster. One extra word of caution: this chip comes with weird compatibility issues with some routers, on the lowest physical level, which require workarounds like forcing the link to 10Mbit mode. This is well documented by many once you Google it ("wiznet" "tp-link"). Just something to watch out for.
 
The following users thanked this post: tellurium

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3387
  • Country: ua
Re: Ethernet board development!!!
« Reply #26 on: February 07, 2024, 08:44:44 am »
You can use some FPGA chip wih about 6k LE to implement UDP stack connect to PHY chip with GMII or MII.
In many cases there is even no need for MCU, you can do all things in hardware on FPGA.
In case of needs you can even implement your own MCU core on FPGA... :)
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Ethernet board development!!!
« Reply #27 on: February 07, 2024, 05:08:55 pm »
I second the solution for using a Wiznet chip. The easiest solution by far and nowadays they also have IPv6 versions available.

Yeah. I have to add though that even this isn't completely problem free solution, though it bypasses a large part of peter-h's complaints, but not everything. The chip implements ARP, TCP and IP on-chip, but not only you have to interface with this chip, you also need DHCP and DNS software implementations, and the code supplied by Wiznet is broken (e.g., overindexing memory) so you need to either fix it or find working implementations which still need integration work. But sure, DNS and DHCP are both very simple protocols. And if you need TLS, integration work for something like mbedTLS is needed too.

But sure, bypassing monstrosity like lwip helps, and time-to-market with Wiznet is probably faster. One extra word of caution: this chip comes with weird compatibility issues with some routers, on the lowest physical level, which require workarounds like forcing the link to 10Mbit mode. This is well documented by many once you Google it ("wiznet" "tp-link"). Just something to watch out for.
Interesting but by the looks of it all these problems are caused by hardware or software errors made by the people trying to integrate it into their design, not the chip itself. If the Wiznet chips where that bad, they would have fixed them by now.
« Last Edit: February 07, 2024, 05:11:08 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8178
  • Country: fi
Re: Ethernet board development!!!
« Reply #28 on: February 07, 2024, 05:26:14 pm »
Interesting but by the looks of it all these problems are caused by hardware or software errors made by the people trying to integrate it into their design, not the chip itself. If the Wiznet chips where that bad, they would have fixed them by now.

The TP-LINK issue is widely documented using Wiznet's own modules, too, so I don't think it's a signal integrity problem - in other words, my own PCB design which works perfectly with 99% of the routers fail with exact same routers others have problems with, too, using Wiznet's own PCB designs. The minimum code to reproduce the problem is absolutely trivial, because the problem appears by the chip not being able to bring the PHY up at all; I have not scoped it to see if it's in autonegotiation logic or something else, but I'm 99% sure it's the "chip itself". I'm not surprised they haven't fixed it. World is full of products and semiconductors with problems that are not getting fixed, especially when there is at least some kind of workaround available (see all STM32 microcontrollers, for example - nothing gets fixed). In fact, I would be surprised if this kind of complex product was flawless.
« Last Edit: February 07, 2024, 05:28:31 pm by Siwastaja »
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet board development!!!
« Reply #29 on: February 07, 2024, 08:28:17 pm »
You can use some FPGA chip wih about 6k LE to implement UDP stack connect to PHY chip with GMII or MII.
In many cases there is even no need for MCU, you can do all things in hardware on FPGA.
In case of needs you can even implement your own MCU core on FPGA... :)

Only for very niche solutions with fixed IP addresses. Otherwise, you want ICMP ping to work, DHCP to pick up address, resolve IP to MAC address using ARP, etc. You will also need a hardware muxer, which would redirect all UDP traffic to FPGA logic and all ARP/ICMP/TCP traffic to softcore.

Ask me how I know...  ;D
 
The following users thanked this post: nctnico, tellurium

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3387
  • Country: ua
Re: Ethernet board development!!!
« Reply #30 on: February 07, 2024, 09:45:55 pm »
Only for very niche solutions with fixed IP addresses. Otherwise, you want ICMP ping to work, DHCP to pick up address, resolve IP to MAC address using ARP, etc.

Yes, I'm done it, I'm using UDP stack with DHCP, ARP and other things on FPGA, ethernet part eats about 3-4 kLE on Cyclone 4. It automatically requests IP from router with DHCP, it responds on pings and streams realtime high speed data (at 100-500 MBps) between PC and my circuit implemented in the same FPGA... And there is no MCU, all is done on FPGA in verilog :)
 
The following users thanked this post: tellurium

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet board development!!!
« Reply #31 on: February 08, 2024, 02:52:46 am »
Only for very niche solutions with fixed IP addresses. Otherwise, you want ICMP ping to work, DHCP to pick up address, resolve IP to MAC address using ARP, etc.

Yes, I'm done it, I'm using UDP stack with DHCP, ARP and other things on FPGA, ethernet part eats about 3-4 kLE on Cyclone 4. It automatically requests IP from router with DHCP, it responds on pings and streams realtime high speed data (at 100-500 MBps) between PC and my circuit implemented in the same FPGA... And there is no MCU, all is done on FPGA in verilog :)

That's cool. I was working on high speed data reception over UDP (video streams), which required a packet type based mux in HW. All non-UDP packets were routed to Nios running LwIP for the data handling. UDP packets were handled in FPGA logic. The whole thing utilizing up to 7 video stream reception took 98% of EP3C55...
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11747
  • Country: us
Re: Ethernet board development!!!
« Reply #32 on: February 08, 2024, 05:06:00 am »
And there is no MCU, all is done on FPGA in verilog :)

Assuming none of that microblaze ... stuff, that's impressive.   

Online tellurium

  • Regular Contributor
  • *
  • Posts: 231
  • Country: ua
Re: Ethernet board development!!!
« Reply #33 on: February 09, 2024, 03:23:06 am »
Yeah. I have to add though that even this isn't completely problem free solution, though it bypasses a large part of peter-h's complaints, but not everything. The chip implements ARP, TCP and IP on-chip, but not only you have to interface with this chip, you also need DHCP and DNS software implementations, and the code supplied by Wiznet is broken (e.g., overindexing memory) so you need to either fix it or find working implementations which still need integration work. But sure, DNS and DHCP are both very simple protocols. And if you need TLS, integration work for something like mbedTLS is needed too.

Second that, and want to add one point:
Wiznet chips implement TCP/IP stack internally and provide socket API via SPI.
But they also provide a so-called "raw socket", meaning it is possible to fully bypass Wiznet TCP/IP implementation, and use W5500 only as a way to send/receive raw Ethernet frames. Of course in that case the MCU must implement the TCP/IP stack.

One might ask - but what's the point. There are two: first, this is a workaround for Wiznet bugs, and second, LWIP is not the only option here. Allow me to mention https://github.com/cesanta/mongoose/ once again - it implements W5500 driver, TCP/IP stack, DNS, ARP, DHCP, HTTP/MQTT/Websocket, and TLS 1.3 - in a single file. As an example, here is a tutorial for SAMD21 + W5500 on Arduino: https://mongoose.ws/documentation/#xiao-m0--w5500-module
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3700
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet board development!!!
« Reply #34 on: February 09, 2024, 05:17:08 pm »
Quote
You can use some FPGA chip wih about 6k LE to implement UDP stack connect to PHY chip with GMII or MII.
In many cases there is even no need for MCU, you can do all things in hardware on FPGA.
In case of needs you can even implement your own MCU core on FPGA...

The above is a windup, surely.

How many man-years?

Come on guys, try to help the OP by not suggesting such totally esoteric approaches.

The reality is that this stuff is a lot of work. There is no way around it. I see my name has been referenced in the usual places ;) so yeah the main difference between me and most others is that I

- post questions with a lot of detail so somebody smart can actually help me (most people just post "help me" questions)
- post the solution afterwards (99% of people never do that, sometimes for company policy reasons (leeching is allowed) and mostly because why should they?)

:)


Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Red Squirrel

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: ca
Re: Ethernet board development!!!
« Reply #35 on: February 09, 2024, 08:59:04 pm »
I'm looking at doing similar stuff as OP and been doing some research myself so this this is NOT expert recommendation, but I found the PIC18F97J60 which looks like an interesting chip.

It's a MCU but also has an ethernet MAC and the PHY built in, which a lot of chips only have one and not the other so you would need extra components but this chip has it all and you only need the magnetics (two small transformers which isolate the ethernet signal).  From my understanding the MAC is basically the software implementation of Ethernet (ex: OSI layer 2) which is often found on MCUs and the PHY is the layer 1 section which drives the actual Ethernet signal, which often is it's own chip.

 You also need transformers (referred to as magnetics) and of course the jack itself.  Some jacks have it built in but it ends up more expensive per unit but if you're only making a few it's a way to go.   If you want to do POE you need a separate chip to control that too.  Make sure you get magnetics that have split transformers as the middle is used for the POE signal.

 Once you have that going you essentially have a device that can talk over an ethernet network at layer 2.  Ex: send ethernet frames.  If you want TCP or UDP you'd have to implement it in your code and that's rather involved.  DHCP, ACK, DNS, etc....  Me personally I will probably just work with raw frames as my device is not technically designed to go on a computer network, I just chose to use ethernet because it can make use of existing infrastructure such as patch panels, jacks, switches etc.

At least that's the jist of what I've figured out so far, someone correct me if I'm off on something. 
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3387
  • Country: ua
Re: Ethernet board development!!!
« Reply #36 on: February 10, 2024, 03:53:20 am »
Assuming none of that microblaze ... stuff, that's impressive.

I don't use soft processor, ARP, DHCP and ICMP protocols are implemented as hardware state machine in plain verilog.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3387
  • Country: ua
Re: Ethernet board development!!!
« Reply #37 on: February 10, 2024, 03:59:53 am »
Quote
You can use some FPGA chip wih about 6k LE to implement UDP stack connect to PHY chip with GMII or MII.
In many cases there is even no need for MCU, you can do all things in hardware on FPGA.
In case of needs you can even implement your own MCU core on FPGA...

The above is a windup, surely.

How many man-years?

using open-source verilog code from github, UDP + ARP can be setup for your FPGA within several hours.
Adding state machine with DHCP and ICMP can take longer time, but you can also find examples on github.

Look at this implementation: https://github.com/alexforencich/verilog-ethernet
It works very stable and supports 10M/100M/1G/10G/25G link.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Ethernet board development!!!
« Reply #38 on: February 10, 2024, 10:52:31 am »
If you want to do POE you need a separate chip to control that too.  Make sure you get magnetics that have split transformers as the middle is used for the POE signal.
Unless you need the higher-power flavours of PoE (at/bt), the receive side can be very simple and doesn't need a chip to control - all you need is a couple of rectifiers, a resistor (25K if I recall correctly), and a voltage detector+MOSFET so you don't draw any current until the supply comes up to ~48V
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Ethernet board development!!!
« Reply #39 on: February 10, 2024, 02:20:01 pm »
If you want to do POE you need a separate chip to control that too.  Make sure you get magnetics that have split transformers as the middle is used for the POE signal.
Unless you need the higher-power flavours of PoE (at/bt), the receive side can be very simple and doesn't need a chip to control - all you need is a couple of rectifiers, a resistor (25K if I recall correctly), and a voltage detector+MOSFET so you don't draw any current until the supply comes up to ~48V
That is it in a nutshell but gettting the softstart to reset in time due to a short interruption is the tricky part. A good idea is to use a power supervisor (reset) chip to take care of that. The softstart is important to prevent large surges to blow up the ethernet chip and/or damage the contacts on the connector. All in all, you'll end up with a bit of circuitry and using a chip made for POE is just easier.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2588
  • Country: fr
    • kripton2035 schematics repository
 

Offline Red Squirrel

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: ca
Re: Ethernet board development!!!
« Reply #41 on: February 11, 2024, 01:10:51 am »
If you want to do POE you need a separate chip to control that too.  Make sure you get magnetics that have split transformers as the middle is used for the POE signal.
Unless you need the higher-power flavours of PoE (at/bt), the receive side can be very simple and doesn't need a chip to control - all you need is a couple of rectifiers, a resistor (25K if I recall correctly), and a voltage detector+MOSFET so you don't draw any current until the supply comes up to ~48V
 

Hmm that's a good point. I kinda forgot about this while going down the rabbit hole myself. Of course you will want some form of SMPS and transformer if you want to isolate the power out since it will not be isolated. But if you're only using it to power relays or the MCU itself and the power never leaves the device I don't think isolation is needed.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3700
  • Country: gb
  • Doing electronics since the 1960s...
Re: Ethernet board development!!!
« Reply #42 on: February 12, 2024, 02:54:51 pm »
Quote
Ex: send ethernet frames.  If you want TCP or UDP you'd have to implement it in your code and that's rather involved.  DHCP, ACK, DNS, etc....  Me personally I will probably just work with raw frames as my device is not technically designed to go on a computer network, I just chose to use ethernet because it can make use of existing infrastructure such as patch panels, jacks, switches etc.

Sure, but without TCP and the rest like DHCP you do not have a marketable "ethernet" product.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Ethernet board development!!!
« Reply #43 on: February 12, 2024, 04:13:33 pm »
Quote
Ex: send ethernet frames.  If you want TCP or UDP you'd have to implement it in your code and that's rather involved.  DHCP, ACK, DNS, etc....  Me personally I will probably just work with raw frames as my device is not technically designed to go on a computer network, I just chose to use ethernet because it can make use of existing infrastructure such as patch panels, jacks, switches etc.

Sure, but without TCP and the rest like DHCP you do not have a marketable "ethernet" product.
That depends on your product. Artnet for example only needs UDP and ARP.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf