4
\$\begingroup\$

I am working on a project, (still in the nascent stage) where I have to implement a serial communication interface and an Ethernet interface. I tried to find out as much as I can and got the following information:

  • For the serial interface I can implement using (DB9/DB25 via max232 line driver)
  • For RJ45 interface I am in doubt which method is right. Either:

    1. RJ45 => Ethernet Controller IC => Microcontroller(with SPI) would this method interfere with the serial communication port as SPI would require rxd and txd pins of micro-controller which are used to connect with pins of line driver (totally confused)
    2. RJ45 => Micro-controller( I doubt it)

Kindly advise, please forgive my ignorance I am quite new to networking arena.

\$\endgroup\$
  • \$\begingroup\$ Check out at91sam from atmel \$\endgroup\$ – AKR Sep 7 '13 at 20:48
3
\$\begingroup\$

Your option 2 is only viable if your microcontroller has built in Ethernet hardware. Most controllers don't, but they exist especially at the higher end of the spectrum.

Your option 1 with a separate Ethernet controller is pretty common. You may want to check several open hardware microcontroller boards and get yourself inspired by how they solve Ethernet (and which chips they use). Most of the time circuit diagrams and libraries are fully available, but mind the license that they come with. I know there exist Arduino compatible boards with Ethernet, but I'm not sure of its name.

\$\endgroup\$
  • \$\begingroup\$ thanks J, could you please suggest some ICs for first option. would I need to write code separatelyfor implementing the ethernet or the ethernet controller will take care of that..? \$\endgroup\$ – Himanshu Sourav Sep 7 '13 at 16:24
  • 1
    \$\begingroup\$ There are some moderately low end micros with Ethernet MAC/PHY too - shipped a lot of instruments based on the HC9S12NE64 a few years back... It does help to have more RAM than an Arduino ATmega328's 2KB though. \$\endgroup\$ – Chris Stratton Sep 7 '13 at 16:35
  • \$\begingroup\$ @Himu I do not personally have hands on experience with any of those chips. I believe Beagle Bone Black is open hardware and has Ethernet hardware on the main micro. But it is a pretty beefy controller that runs Linux. \$\endgroup\$ – jippie Sep 7 '13 at 16:51
  • \$\begingroup\$ Yes, a beagle bone is about 100x as much computer as the '9S12. Since then there have been a lot of flash memory ARM parts with Ethernet MAC, but devices with onboard PHY are relatively rare, and when trying to keep a PCB design simple that can matter. Looks like the poster is going for a bridge module though - some of those are basically contained in the RJ45. \$\endgroup\$ – Chris Stratton Sep 7 '13 at 20:01
2
\$\begingroup\$

Generally speaking, microcontrollers that have both a UART interface (for RS-232) and SPI interface (for Ethernet, etc.) use separate physical pins for the two interfaces.

If UART and Ethernet are literally all you need for your project, you might consider the Wiznet W7100A, which integrates an 8051 core, a complete 10/100baseT Ethernet interface, a UART, a few timers (and not much else).

I once set one up as a local LAN time (NTP) server, using the serial port to get information from a GPS receiver. Worked quite well.

\$\endgroup\$
  • \$\begingroup\$ thank You Dave, I am now going through the w7100a datasheets and my requirements. \$\endgroup\$ – Himanshu Sourav Sep 7 '13 at 16:29
2
\$\begingroup\$

The PIC 18F67J60 and related contain a ethernet MAC/PHY and at least one UART. The higher pin-count parts in that family have two UARTs.

This is about at integrated as you're going to find. On the ethernet side, you only need to add the RJ-45 jack, the magnetics, and a few resistors, caps, and the like. On the RS-232 side, you need to add the DB-9 connector, a conversion chip like the MAX 232 or one of the many variants from other companies, and a few capacitors.

\$\endgroup\$
1
\$\begingroup\$

1) For this I can recommend the KSZ8851SNL part. Easy to use and get running and works great. It is also somewhat popular so you can find ready made drivers. Take a look at the Dallas Logic CMI2001 that can allow you to do this

2) There are a few microcontrollers out there with Ethernet. Typically they are Cortex M3/M4. TI had the Stellaris microcontrollers with Ethernet, but they have been phased out. New TIVA microcontrollers are coming out with Ethernet in the near future (no news from TI about it yet).

From ST you can find the STM32F107VC that has Ethernet.

Remember that you need to pick a microcontroller that has good performance for Ethernet, otherwise it might be a bit frustrating to use (pages taking seconds to load). In the MSP430 it will also bog down the CPU.

\$\endgroup\$
  • \$\begingroup\$ Thank You Gus... please correct me if I am wrong here but as I can see on the website the STM32F107VC board has only one UART Connector, so I wont be able to interface both ethernet and rs232 module simultaneously..? or is there any way around? \$\endgroup\$ – Himanshu Sourav Sep 14 '13 at 13:58
  • 1
    \$\begingroup\$ Why would the Ethernet claim that single UART? And typically the STM chips have many UARTS, but they may not be broken out with a level shifter on a given board. \$\endgroup\$ – Chris Stratton Sep 20 '13 at 19:04
1
\$\begingroup\$

If you are planning to transmit some specific data E.X. temperature periodically you could emulate the Ethernet packet with the ip data. Since your application is for non data guarantee communication you could use only the RTP protocol (which is simple to emulate) so you have to use only 1 pin (1 pin for TX only) of the micro-controller and simulate the Ethernet packet.

1st) you should calculate the bit time based on the cpu clock time, you could emulate 10mbps 2nd) create a Ethernet Frame prototype. 3nd) create a IP rtp frame prototype. 4nd) Alter only the bytes of data at the RTP/IP frame prototype. 5nd) Emulate the transmission with Pulses On/Off.

http://en.wikipedia.org/wiki/Ethernet_frame

The rtp frame consist from : http://en.wikipedia.org/wiki/Real-time_Transport_Protocol

\$\endgroup\$
  • \$\begingroup\$ @Himu - that line of questioning really has nothing to do with c.chaspais's answer. Anyway, what you may discover here is the quality/availability of software support matters more than the prices of the first eval board. Something from an extreme discount channel is likely to be poor in that regard, unless it is a functional clone of some other better supported board. \$\endgroup\$ – Chris Stratton Sep 23 '13 at 17:38
  • \$\begingroup\$ Thanks Chris, you are right..my guide told me the same thing. \$\endgroup\$ – Himanshu Sourav Sep 24 '13 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.