Author Topic: Micro with easy to use ethernet  (Read 18437 times)

0 Members and 1 Guest are viewing this topic.

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Micro with easy to use ethernet
« on: April 14, 2022, 02:03:29 pm »
Any micro's out there that have easy to use ethernet ?

With easy to use ethernet i mean
- can be 10mbit or 100 mbit
- wire up a magjack, no need for phy
- a couple of registers to set mac and ip address
- built in dhcp
- built in UDP and TCP

Basically i want something that doesn't require half a megabyte ethernet stack , operating system and other fluff. or complicated learning curves. the API should have a few basic functions SetIP ,SetMac , SetDHCPserver, Openport,closeport, portstatus,Sendpacket (target_IP,port,*data) and an interrupt when a packet arrives for me.

it doesn't need security. It will sit on a dedicated lan that is not exposed to the outside world. All these things need to be able to do is send simple packets to each other. no need for web pages or anything. payloads are small ( fit in one base ethernet packet )

Before you suggest arduino and wiznet and other stuff : too large and bulky. i'm looking for a small micro. 40 pins QFN max. ( 10mmx10mm max body size. i want to tuck it under the magjack )

The idea is to have this drive an I2C bus with I/o expanders. basically remote I/O over ethernet.

Bonus points if it can do single pair ethernet
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline tepalia02

  • Regular Contributor
  • *
  • Posts: 100
  • Country: bd
Re: Micro with easy to use ethernet
« Reply #1 on: April 14, 2022, 02:10:43 pm »
What about Raspberry pi?
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3770
  • Country: nl
Re: Micro with easy to use ethernet
« Reply #2 on: April 14, 2022, 02:27:17 pm »
Simple solution is use a W5500 or LAN8720 or DP83848 module with either an AVR (Arduino) or STM32 controller or other micro's with serial or SPI or RMII. Other option is ESP32 with wifi, but that technically is not ethernet

https://nl.aliexpress.com/item/32832354059.html (Uses a SPI interface)
https://nl.aliexpress.com/item/32485939954.html (Ethernet PHY so needs a RMII interface on the micro)
https://nl.aliexpress.com/item/1893559945.html  (Ethernet PHY so needs a RMII interface on the micro)

There are plenty Arduino examples on the net where simple data is send over the ethernet connection. Not sure about the DHCP though. This requires a bit more protocol handling.

Not sure if there are micro's that have the actual PHY incorporated.

Edit: Microchip does have controllers with MAC and PHY https://www.microchip.com/en-us/products/high-speed-networking-and-video/ethernet/ethernet-mcus-and-mpus
« Last Edit: April 14, 2022, 03:10:35 pm by pcprogrammer »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27003
  • Country: nl
    • NCT Developments
Re: Micro with easy to use ethernet
« Reply #3 on: April 14, 2022, 02:47:06 pm »
I'd look at something from Wiznet with an integrated CPU: The W7500P for example ( https://www.wiznet.io/product-item/w7500p/)

Alternatively you can look at a microcontroller with an integrated PHY but I don't know any from the top of my head. If you can find some, then LWIP is reasonably simple to get going for an embedded software engineer (OS not needed). I'd recommend to run LWIP with at least 16kB of RAM. Recently I had to squeeze LWIP and a simple application into 8kB and that wasn't fun; component shortage for other parts prevented me from using the Wiznet W5500.
« Last Edit: April 14, 2022, 02:51:27 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline MarkL

  • Supporter
  • ****
  • Posts: 2135
  • Country: us
Re: Micro with easy to use ethernet
« Reply #4 on: April 14, 2022, 04:29:37 pm »
I've used these in several projects for clients:

  https://www.digi.com/products/models/dc-me-y402-lx

It might be a little overkill for what you're describing, but it's all-in-1 and not much bigger than a Magjack itself.  The IP stack just works since it's linux. You can interface to it with I2C, SPI, or TTL-level UART, but not all at the same time due to the limited number of pins.  You'll probably need to do some development on the module to support your needs unless you're happy with scripting via the serial console pins.

It's $51 qty 1.  Arrow has them in stock.
 
The following users thanked this post: thm_w

Offline MarkL

  • Supporter
  • ****
  • Posts: 2135
  • Country: us
Re: Micro with easy to use ethernet
« Reply #5 on: April 14, 2022, 04:50:56 pm »
I should also mention that Lantronix has a thing similar to the Digi module:

  https://www.lantronix.com/products/xport/

It's a simpler device and the embedded OS is not accessible like in the Digi module, but it can do the IP functions you want (DHCP/UDP/TCP).  It only supports serial, so everything has to be scripted.

It's a little bigger than the Digi module, but still not much larger than a Magjack.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21732
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Micro with easy to use ethernet
« Reply #6 on: April 14, 2022, 05:07:59 pm »
If you don't mind proprietary, Hilscher makes a line of fairly powerful SoCs.  "Easy" might be relative, I don't know.  I forget how much protocol stack they integrate, but it's some kind of multicore thing, with one (or more) fed either with mask ROM (doubtful?) or Flash, supplied by libraries.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Micro with easy to use ethernet
« Reply #7 on: April 14, 2022, 05:26:28 pm »
i'm familiar with those digi and lantronix things. too expensive and difficult to work with.
The wiznet part is also not very easy to work with.

i'm leaning towards an esp32 and maybe ditching the ethernet altogether and hop on wifi. If i flash it with Annex RDS it should be easy peasy.
Code development simplicity is what i'm after.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online Miyuki

  • Frequent Contributor
  • **
  • Posts: 907
  • Country: cz
    • Me on youtube
Re: Micro with easy to use ethernet
« Reply #8 on: April 14, 2022, 06:36:48 pm »
ESP32 supports ethernet but needs to use a phy
but can get modules with all you need for cheap
Like those and many more
 
The following users thanked this post: free_electron

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Micro with easy to use ethernet
« Reply #9 on: April 14, 2022, 07:03:04 pm »
ESP32 supports ethernet but needs to use a phy
but can get modules with all you need for cheap
Like those and many more

too complicated to use. i really do not want to delve into the software stack.

But. an ESp32 combined with a W5500 looks like the way to go. I can use the Pico-D4 flavor (raw chip , no modules) and load Annex RDS on it. Simple BASIC interpreter with all the simple functions i need without needing muckery with a stack , compilers and whatnot.
All this thing has to do is listen to incoming control packets , read and write some I/o chips and reply . 2 bytes in , 1 byte out   (target port + data byte and reply with current state of port. LSB of target port controls read or write operation. basically i2c over ethernet

0x20,0xA1 : write 0xa1 to i2c address 0x20 ,reply with one byte holding current value
0x21,0x00 : read from 0x20 , 0x00 is just a dummy byte , reply with read result

that's all it needs to do. data will be plain ascii
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3770
  • Country: nl
Re: Micro with easy to use ethernet
« Reply #10 on: April 14, 2022, 07:12:49 pm »
Not cheap, but probably does what you want:

https://store.ncd.io/product/ethernet-to-i2c-converter/
https://coptonix.com/en/products/lan-i2c-adapter-ms/

just google "i2c ethernet adapter"

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2595
  • Country: fr
    • kripton2035 schematics repository
Re: Micro with easy to use ethernet
« Reply #11 on: April 14, 2022, 07:43:28 pm »
ESP32 supports ethernet but needs to use a phy
but can get modules with all you need for cheap
Like those and many more
too complicated to use. i really do not want to delve into the software stack.
you program them with the arduino IDE ! configure them as web client or server like an esp32 wifi, or esp8266
it's dead simple !
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Micro with easy to use ethernet
« Reply #12 on: April 14, 2022, 07:47:33 pm »
you program them with the arduino IDE ! configure them as web client or server like an esp32 wifi, or esp8266
it's dead simple !
That in itself is too complicated. compile , flash , find the bug , compile , flash, find the bug... Boooooring. and arduino is not an IDE ... it can't even set breakpoints , watchpoints, trace or singlestep code. i expect more in 2022.

Anyway. problem is solved. i'm going the esp+5500 route and using a simple interactive way of developing code
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2595
  • Country: fr
    • kripton2035 schematics repository
Re: Micro with easy to use ethernet
« Reply #13 on: April 14, 2022, 07:48:12 pm »
some modules are even POE.

 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Micro with easy to use ethernet
« Reply #14 on: April 14, 2022, 07:59:54 pm »
Not cheap, but probably does what you want:

https://store.ncd.io/product/ethernet-to-i2c-converter/
https://coptonix.com/en/products/lan-i2c-adapter-ms/

just google "i2c ethernet adapter"
That doesn't cut it. It requires the usage of a controlling PC. Once this thing is built it will have no control. One ESP32 will run a time scheduler that fires commands to the slaves. There is no user interface or controlling PC. It runs standalone (after configuration)

It's a sprinkler controller.  the network cable carries a tx pair, a rx pair and the other two pairs are phantom POE power. Each "node" can drive 8 valves. The node can detect valves (it senses current). So if a valve coil fails open it can be detected and reported. you can also interrogate it how many valves and what channels are attached. ( it sense the coil resistance)

It makes large landscape management easy. Ethernet switch , a bunch of slaves wired with simple CAT5 and a master controller. The master controller has a command line style UI. You can see which channels have valves. if the current state deviates from the stored state we have a broken valve. the rest is a list with channel number and runtime. driven by an RTC. a simple display shows what channel is active and how much longer. the list is processed based on a clock event. It's tuesday 6am ? launch list 32.
You connect to the master controller through a web interface ( can be opened in a browser , but it itself is not connected to the internet , you need to be near it). it talks to the slaves over a wired, sealed off network.




Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1643
  • Country: nl
Re: Micro with easy to use ethernet
« Reply #15 on: April 14, 2022, 09:21:00 pm »
There is the PIC18F97J60 family with integrated ethernet mac+phy. But it's in LQFP-64.. and being a 8-bit niche PIC, probably not most widely supported device out there. I have some around, but never got around to get firmware loaded onto it and see what a TCP/IP stack can do with it.

But its perhaps acceptable for an I/O module. 
« Last Edit: April 14, 2022, 09:22:51 pm by hans »
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6447
  • Country: ca
  • Non-expert
Re: Micro with easy to use ethernet
« Reply #16 on: April 14, 2022, 09:45:24 pm »
That in itself is too complicated. compile , flash , find the bug , compile , flash, find the bug... Boooooring. and arduino is not an IDE ... it can't even set breakpoints , watchpoints, trace or singlestep code. i expect more in 2022.

Anyway. problem is solved. i'm going the esp+5500 route and using a simple interactive way of developing code

Arduino IDE is horrible, there have been better alternatives for years now, eg: https://visualgdb.com/tutorials/arduino/esp32/
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Micro with easy to use ethernet
« Reply #17 on: April 14, 2022, 11:05:23 pm »
There is the PIC18F97J60 family with integrated ethernet mac+phy. But it's in LQFP-64.. and being a 8-bit niche PIC, probably not most widely supported device out there. I have some around, but never got around to get firmware loaded onto it and see what a TCP/IP stack can do with it.

But its perhaps acceptable for an I/O module.
oh i happen to know that one. chamberlain uses it in their garage door openers with My-Q internet connectivity.
But that's again beyond my requirements. I don't want to deal with a stack or the learning curve. I want simple to use that just works.
Can't beat a basic interpreter.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4207
  • Country: us
Re: Micro with easy to use ethernet
« Reply #18 on: April 14, 2022, 11:26:00 pm »
Quote
- wire up a magjack, no need for phy
Micros with an ethernet Phy are remarkably uncommon.
Quote
- built in dhcp
- built in UDP and TCP
That makes it not so much a "micro", but a "module" with SIGNIFICANT amounts of internal software.  That's been done for Bluetooth and WiFi (keeping the network stack proprietary and within legal control (esp radio) seems to be difficult enough that having a user-programmable section in the same micro is less common than implementing a separate "networking module.")

The WizNet products are probably closest at the chip level.  At the generic "module" level there are a bunch more options (which have been mentioned), and if you can put up with a single-connection specific purpose ("serial to tcp/ip") you get even more.

There is/was a neat Luminary Micro LM3S6432 chip with built in phy, used on the cute little MDL-S2E board, that I had high hopes for, but it doesn't seem to be one of the chips that TI "kept" :-(  Still seems to be sold, though.

None of these seem to be the sort of thing that you're looking for, though.  Good Luck.
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Micro with easy to use ethernet
« Reply #19 on: April 15, 2022, 01:16:55 am »
Micros with an ethernet Phy are remarkably uncommon.
in this internet of things age you'd expect to find those things under every rock you turn. Same for pre-embedding the entire stack and having a simple API using only a few registers.
set your mac and IP , the routers IP. a few bits to fire off a DHCP and autodiscovery.
Then simply specify target ip and write your data into a buffer and flip the transmit bit. kind of like a uart for ethernet.

It's 2022 and we're still mucking around like we are in the dos days and trying to install novell...  IOT: Idiots Owning Trinkets...

anyway. I'm going the esp32 +w5500 route. Probably the Pico D4 or similar ( bare chip with Flash + psram on board.  i'm rolling my own board. no modules. )
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14542
  • Country: fr
Re: Micro with easy to use ethernet
« Reply #20 on: April 15, 2022, 03:10:35 am »
Micros with an ethernet Phy are remarkably uncommon.
in this internet of things age you'd expect to find those things under every rock you turn.

Well, yes but no. The whole IoT trend has exploded concurrently with the explosion of wireless communication. Neither vendors nor users (except for niche applications/or some pro applications maybe) care for Ethernet, for the most part. Fewer and fewer home users (for which the bulk of IoT devices is made) actually have an Ethernet network! And since it's more expensive to implement (connectors, PHYs, size of the connectors themselves requiring relatively bulky devices), it has become an almost no-go.

That's a shame, but just the way it is.

That said, some MCUs support Ethernet and only require an Ethernet connector (with integrated transformer, which are very common these days), so hardware-wise, that's an easy task.
The NXP iMXRT MCUs for instance. For quick prototyping, all it would take is a Teensy 4.1 for instance, with the cheap Ethernet kit: https://www.pjrc.com/store/ethernet_kit.html

Software-wise, that's something else but I'd expect Wi-fi to be pretty similar for the network stack. lwIP works decently.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3770
  • Country: nl
Re: Micro with easy to use ethernet
« Reply #21 on: April 15, 2022, 05:26:49 am »
anyway. I'm going the esp32 +w5500 route. Probably the Pico D4 or similar ( bare chip with Flash + psram on board.  i'm rolling my own board. no modules. )

It's a sprinkler controller.  the network cable carries a tx pair, a rx pair and the other two pairs are phantom POE power. Each "node" can drive 8 valves. The node can detect valves (it senses current). So if a valve coil fails open it can be detected and reported. you can also interrogate it how many valves and what channels are attached. ( it sense the coil resistance)

You probably already thought about galvanic isolation since you are choosing ethernet, but make sure to use a similar setup for your power supply. If the POE you mention is actual POE from a network switch, I guess it will already have a small transformer in the DC/DC converter needed to bring the voltage down to what is needed.

If not true POE, using ethernet won't make a difference when lightning comes in to play.

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4207
  • Country: us
Re: Micro with easy to use ethernet
« Reply #22 on: April 15, 2022, 09:10:03 am »
Quote
it's more expensive to implement [ethernet]
I noticed that an ESP8266 wireless module (which does essentially what you want by default - send it AT-like dial commands and get a simple TCP connection to somewhere) is cheaper than (just) a CAT5 Ethernet cable of reasonable length (say, 10ft.)
(On Amazon:  ESP8266 module: 3 for about $12.  10ft "Amazon Basics CAT6 Ethernet cable": about $7.)

That's just ... really weird.
 

Offline ali_asadzadeh

  • Super Contributor
  • ***
  • Posts: 1908
  • Country: ca
Re: Micro with easy to use ethernet
« Reply #23 on: April 15, 2022, 09:42:42 am »
If you want my help I can design it for you, it would take under 5 hours to make a webserver and it has all the bells and whistles that  you need, any ARM cortex device plus a simple PHY like KSZ8081RNAIA would do it, it has a very easy layout too!
This combo is cheap and has very good bang per buck,

STM32H750VB + KSZ8081RNAIA

If you do not like this, Just choose your ARM cortex Device and let me do the reset >:D
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13771
  • Country: gb
    • Mike's Electric Stuff
Re: Micro with easy to use ethernet
« Reply #24 on: April 15, 2022, 10:48:20 am »
The wiznet part is also not very easy to work with.

In what way? - I've used the W5500 for UDP applications and once you have the SPI set up right and understand the buffer pointer handling it's pretty straightforward - about 100 lines of C to implement and Artnet receiver. I don't know if TCP/IP is any trickier though.
The only limitation I've found is it doesn't support fragmented UDP packets
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