Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Ethernet communication using microcontroller

Status
Not open for further replies.

Mithun_K_Das

Advanced Member level 3
Advanced Member level 3
Joined
Apr 24, 2010
Messages
899
Helped
24
Reputation
48
Reaction score
26
Trophy points
1,318
Location
Dhaka, Bangladesh, Bangladesh
Activity points
8,254
I want to make a device that will send a link to local host via LAN/Ethernet. So what is called? Ethernet communication? What will be the way to send the link to a local host.

Host PC is connected with the device via LAN cables, switches/routers and there will be over 100+ same devices which are doing the same. In this case how the system should be arranged?

Dose it need to give each device a IP address for each? And how these devices will send the data to the main PC or local host?
 

Hi,

yes, it is an ethernet connection, the communication can be established either by implementing TCPIP or UDP protocol.

Yes you will need an IP address for each device.

If you need 100+ devices, I think the price per unit will be a crucial. Furter, your MCU application would be of interest too (which requirements).
ARM Cortex MCUs from ST (e.g. STM32F407) in combination with a RTOS (ChibiOS) and lwIP (lightweight IP) whould be a (easy/quick) possibility to realize your project.

BR
 

or an arduino with an ethernet shield which could cost less than anything.
 

depends on the programming language you're using for the pic, but I find generally arduino easier to use for simple projects like that ?
hardware speaking, they are almost the same devices.
 

I agree with Kripton2035, the use of an arduino would be propably the easiest way to realize the project (there is so much code available in the web). But as I already mentioned, it depends on your application. E.g. the ethernet connection of an ardiuno uses the SPI bus. Thus your data rate is much lower than using Reduced Media Independent Interface (RMII) or Media Independent Interface (MII) as it can be done with an ARM (e.g. STM32F407).

Your suggested ethernet shield makes also use of a SPI bus, so it seems the required throughput is not very high. If you are used to work with PIC MCUs I would use your suggested constellation. But you haven't mentioned the application until now.

BR
 

The application of the device is in a factory. Device will have 3/4 buttons for item counting of a factory production. These counting will be saved in a local host. Thus there will be a data logging system for each worker. How many items they completed in a month. That is the use of the device.
 

if your factory is not too perturbated to radio waves, you could also use an esp8266 via wifi. that way everything is contained in a $3 esp8266 module. add your 3 buttons and some line of code and voilà.
 

What about a single-chip solution using pic18f67j60?
 

I'm planning to use a PIC microcontroller with ENC28J60 module

Considering that you're at the initial stage of the project, you could also consider other Ethernet options. The ENC28J6 does not appear to be a full ethernet controller, it needs to have an external tcp stack implemented in firmware whereas the W5100 has a built-in stack and has a socket-oriented API, becoming it easiest to work. I recommend you to buy Arduino shields for both and make some experiments before choosing which one to use. Unfortunately, it seems that uC manufacturers are in a declining tendency to embed fully integrated ethernet modules on chip. An interesting solution was provided in some devices of Texas LM3S6000's family having both hardware MAC+PHY controller, requiring no additional external devices than the microcontroller itself along with a RJ45 connector, just it. Anyway, although this series is currently discontinued, these devices are still heavily supplied in some distributors.
 
What need to do if I just want to send a data (a link/text) to a local PC through LAN port from a microcontroller? assume that a module ENC28J60 is used with SPI interface with a microcontroller.
 

What kind of data to you want to send?
Do you want to use HTTP protocol or TCP or UDP?

Do you have already chosen the microcontroller?
Anyway, the simplest way is most likely the ENC28J60 module and Arduino or something.


The simplest way would to be setup a HTTP server on one computer in the LAN and let all your ENC28J60 connect to it and send data to php script.

For example:
192.168.0.1/myScript.php?key=value

This is the GET request (I might have confused syntax), but you see the data is in the link.

You can also send it by POST request. Then it's a bit more complicated.


On the server side, you write a PHP script and process data there. For example:
Code:
$received = $_GET['key'];
// now do whater you want with $received,

you can insert data to MySQL database or write to file, all in PHP code.



HINT: Search for "Arduino ENC28J60 HTTP CLIENT" code. For this purpose I think you need a HTTP CLIENT on MCU, and HTTP server on single PC in lan.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top