Simplest/Cheapest Microcontroller with Native IP (Internet Protocol)

Warning: Author is a noob. I'm trying to design a distributed system of sensors and simple electromechanical controls. Though there are obviously plenty of communications protocols, both free-and-open and proprietary, commonly used in industrial systems and sensor nets, I would prefer to use the more complex but common UDP and/or TCP over IP.

My issue is that while there are numerous shields, breakout boards and a few semi-integrated Arduino boards that have IP over 802.2/11 capability, these are relatively expensive. I'm trying to find microcontrollers that have integrated IP IO that are cheap enough to buy by the dozen. I am certainly open to other Layer1/2 implementations besides Ethernet over UTP; however, Ethernet is ideal because of the ready availability of everything from Cat5E to cheap unmanaged PoE switches.

  • Manage 1 Analog Sensor
  • Manage 1 Relay/Motor Control
  • Prefer integrated PoE (802.3af)

Basically, I'm looking for an Ethernet transciever with limited microcontroller-like capabilities. Any guidance on what is available and how to narrow my search?

Enc28j60 modules are < $4 in small quantities:
http://www.aliexpress.com/item/5PCS-ENC28J60-Ethernet-LAN-Network-Module-ENC28J60-For-51-AVR-STM32-ForArduino-LPC-learning-tool-Network/1028067803.html

  • Prefer integrated PoE (802.3af)

Right now, the cost of PoE is much higher than the cost of ethernet chips themselves. (!$7-10 for a PoE module, ~$5 for an Enc28j60 module or wiznet chip.)

There are relatively few "microcontrollers" with ethernet completely built-in, but I gather that you'd accept a board-level solution?
The only micros I know of with "built-in" IP are a couple from Wiznet, essentially incorporating their intelligent controller and a cpu on the same chip (they have an 8051 version, and an ARM CM3 version.)

Most microcontrollers have serial interfaces, and could run IP over SLIP or async PPP to a suitable router.

The 32k of program memory on an Uno-class processor is pretty tight for implementing a reasonable TCP/IP implementation AND a user program that uses it (that's why the official ethernet shield uses a smart ethernet chip.) Typical internet applications tend to be pretty large as well, if only in the amount of data that they expect to deal with.

It's pretty sad. :frowning:

At a systems level, the cheapest solution is probably to put custom software on one of the cheap mass-produced routers.

ralphd:
Enc28j60 modules are < $4 in small quantities:
http://www.aliexpress.com/item/5PCS-ENC28J60-Ethernet-LAN-Network-Module-ENC28J60-For-51-AVR-STM32-ForArduino-LPC-learning-tool-Network/1028067803.html

Thanks. These are a great price, but they require a microcontroller and in IP stack. I was hoping to find something with an integrated CPU, MAC, PHY and a few IO pins.

westfw:

Right now, the cost of PoE is much higher than the cost of ethernet chips themselves. (!$7-10 for a PoE module, ~$5 for an Enc28j60 module or wiznet chip.)

I did not know that, but since PoE seems to be almost entirely marketed at the "enterprise" (aka cost-insensitive) market, it makes sense.

There are relatively few "microcontrollers" with ethernet completely built-in, but I gather that you'd accept a board-level solution?
The only micros I know of with "built-in" IP are a couple from Wiznet, essentially incorporating their intelligent controller and a cpu on the same chip (they have an 8051 version, and an ARM CM3 version.)

That is the solution I had been leaning towards. It just seems excessively expensive at the consumer level. For $20-25 for a controller board and $25 for the WizNet board and $5-15 for sensor/relay/controller and other bits, that is $50-75 per node. I can find hundreds of used Android phones/tablets with backlit LCDs, cameras, USB, 2-3 separate radios (wifi, bluetooth, cell), huge flash, integrated batteries and charging, etc. for the same price. Obviously, these are not for customization or prototyping, but the disparity is painful.

Most microcontrollers have serial interfaces, and could run IP over SLIP or async PPP to a suitable router.

I had though of that. The router side should be easy enough, but I'm unsure about the node IP stack. For me the major attraction of IP is that it is extremely widely implemented and very easy to develop for. Any sort of non-IP physical layer introduces translation layers that seem to make development and maintenence more challenging. Expecially since I am tremendously more familiar with IP communications than anything else.

The 32k of program memory on an Uno-class processor is pretty tight for implementing a reasonable TCP/IP implementation AND a user program that uses it (that's why the official ethernet shield uses a smart ethernet chip.) Typical internet applications tend to be pretty large as well, if only in the amount of data that they expect to deal with.

All I care about is getting simple data out and commands in. At most a couple of thousand SLOC. No UI to speak of, more along the lines of a really basic SNMPv1 implementation. Even encryption is a low priority and I have no minimum bitrate requirements beyond that necessary to prevent timeouts by upstream devices. Info vaguely related here: draft-hamid-6lowpan-snmp-optimizations-03. It won't fit in 32k, but I just built tinysnmp tinysnmp/INSTALL at master · segfault87/tinysnmp · GitHub using clang -0s on an x86-64 box and it ended up being 53325 bytes. And that is will all security functionality enabled. Stripping the openssl and gcrypto related code and it will be quite tiny. Expecially compiled for a microcontroller not a Core i3. :slight_smile:

It's pretty sad. :frowning:

I wholly second that sentiment.

If you are talking wired ethernet, there is always the Rasberry Pi model B for $35. It has a wired ethernet port, runs Linux which comes with a full network stack, and can access the GPIO pins to run sensors. It is programmed completely differently than an Arduino, and you would probably get more information from http://www.raspberrypi.org about the capabilities, and such.

For $20-25 for a controller board and $25 for the WizNet board and $5-15 for sensor/relay/controller and other bits, that is $50-75 per node.

I had in mind the all-in-one module/chips like the W7100 and W7200. I don't know of any low-cost boards, though.

The [SLIP/PPP] router side should be easy enough

Don't forget about the added cost. Serial-equipped routers tend to be more expensive per port than ethernet :frowning:

but I'm unsure about the node IP stack. Any sort of non-IP physical layer introduces translation layers...

IP is a network layer, not a physical layer. SLIP or PPP is a link-level protocol that runs underneath IP, so you'd still have all of the IP (and up) layers; SLIP/PPP essentially replaces the ethernet drivers.

more along the lines of a really basic SNMPv1 implementation.

I have never seen a "small" snmp. The 32k has to support your app, PLUS all the tcp/ip/link/physical drivers. The 76-line "UDPSendReceiveString" example for Arduino is about 10k bytes of code, even though it's using a chip that does the IP/UDP for you. If you use a lower-level chip that needs to implement arp/dhcp/ip/udp/etc, 32k is pretty much gone before you start.

I just built tinysnmp tinysnmp/INSTALL at master · segfault87/tinysnmp · GitHub using clang -0s on an x86-64 box and it ended up being 53325 bytes.

Statically linked with all the necessary default libraries?

I think the most promising thing I've seen was the Stellaris Ethernet/Serial "eval module" ( http://www.ti.com/tool/rdk-s2e )
Reasonably powerful and tiny CM3 CPU with built-in ethernet (incuding PHY) But TI deprecated the whole Stellaris product line, and has not yet introduced a replacement ethernet-capable part :frowning:

There are a bunch of processor chips with built-in radio transceivers of various sorts, which is sort-of interesting, but they tend not to implement IP stacks (BT, BTLE, Zigbee, ANT, etc, etc, etc. All of which have in common that they don't directly gateway to IP infrastructure :frowning: ) Note that these are typically chips with 128k to 256k of flash, and IT'S ALL USED UP by the network stacks that are frequently packaged with them. And/or they don't let them be used programmed. The TI CC3000 module is attractive, and does WIFI/IP/TCP (!), but ... Radio is also a nightmare from a regulation point of view :frowning:

My issue is that while there are numerous shields, breakout boards and a few semi-integrated Arduino boards that have IP over 802.2/11 capability, these are relatively expensive. I'm trying to find microcontrollers that have integrated IP IO that are cheap enough to buy by the dozen.

So, NXP has an offering in the AN11053 and freescale has the MFC52233. The freescale appeals to me, but the demo board is still $99. Both NXP and freescale identify their offering listed above as microcontrollers, but freescale also has a line of microprocessors for systems.

It would appear that if you are going for dozens of nodes that you will probably need a development environment that is well supported by the manufacturer. So, you are going to have to "eat" this cost. The bigger concern is production costs and that is going to translate to parts since board costs will generally be the same for the same complexity - that is, the board is a common cost or a cost of doing business! Only you know the end production requirements and number of production runs you forecast, so the research is going to have to be something you (or a colleague) is intimately involved. IMO

Ray

Perhaps you could look at the BeagleBoard Black? Completely different than Arduino (runs Linus, uses Java for programming). However, it uses the same Ti chip (Sitara) that the TRE has adopted.

ODwyerPW:
Perhaps you could look at the BeagleBoard Black? Completely different than Arduino (runs Linus, uses Java for programming). However, it uses the same Ti chip (Sitara) that the TRE has adopted.

You can easily write programs in C/C++ under Linux; the Linux kernel is written in C.

3 years later, but found via Google search for "MCU with ethernet MAC"

Not much has changed it seems. I've been looking for lowest cost wired TCP/IP solution.

The Stellaris chips with onboard PHY mentioned above are defunct, but the TM4C129 have Ethernet MAC and PHY built in. It's a fairly expensive Cortex M4 though.

The other chip I found is the FT90 series from FTDI. It's a proprietary 32 bit CPU but they provide a compiler and IDE. The price is comparable to an STM32F103 + PHY.

Otherwise apart from some obscure SOCs, that seems to be about it. Any chips I've missed?

I haven't seen as much action around wired ethernet - There's much more interest in WiFi nowadays, and the WiFi-enabled ESP8266 is available at cup-of-coffee prices.

Did you see the Orange Pi Zero?

http://www.orangepi.org/orangepizero/

I am somewhat intrigued by the idea of a separate debug port.

3 years later, but found via Google search for "MCU with ethernet MAC"
Not much has changed it seems. I've been looking for lowest cost wired TCP/IP solution.

Yes, not much has changed. Wires are sort-of dead.

the TM4C129 have Ethernet MAC and PHY built in. It's a fairly expensive Cortex M4 though.

The associated Launchpad development boards are bargains, though!

I think that today, you would need to much more strongly consider the various "small linux boards" that are available. Many with ethernet built-in. Raspberry Pi has "succeeded" and spawned a bunch of even lower-cost wanna-bes, and board with an ethernet connector and linux to provide the "firmware" is smaller than an Arduino shield, even if it does have more than a single chip.

westfw:
Wires are sort-of dead.

RIP :slight_smile:

I think that today, you would need to much more strongly consider the various "small linux boards" that are available. Many with ethernet built-in. Raspberry Pi has "succeeded" and spawned a bunch of even lower-cost wanna-bes, and board with an ethernet connector and linux to provide the "firmware" is smaller than an Arduino shield, even if it does have more than a single chip.

I've spent all my life working in embedded software, I used to be confident that jobs would involve a DSP, small MCU or maybe ARM SOC. Now there are many requests for "embedded developers" with primary skills as Unix ecosystem. Possibly before I retire I will need to learn some new tricks. Application programming with Python and Qt is the new embedded.

Btw, I found Wiznet do a Cortex-M0 MCU with their TCP stack and an onboard PHY, but apparently there are issues with the PHY.

Btw2, I am intending to respin the WebRadio project with a new MCU, since the LM3S range was canned. WebRadio