Microduino ENC28J60 Ethernet Module (HCMIDU0005)

Microduino products. *** DISCONTINUED ***
Post Reply
admin
Site Admin
Posts: 866
Joined: Sun Aug 05, 2012 4:02 pm

Microduino ENC28J60 Ethernet Module (HCMIDU0005)

Post by admin » Sat Jun 01, 2013 5:50 pm

Image
Image

Description:

The Microduino-ENC28J60 ethernet module uses MicroChip 's high performance single-chip SPI bus network interface chip which is an IEEE 802.3-compliant Ethernet controller integrated MAC and 10BASE-T PHY. It supports full and half-duplex mode.

This module easily stacks on top of a Microduino-Core or Core+ board giving it IEEE 802.3 networking capability.


Characteristics:

U-shaped 27pin Microduino standard interface, with Microduino-RJ45 conntector.

The ENC28J60 network chip has strong support within the Arduino community with Libraries and example sketches already in existence.


Specification:

ENC28J60 Ethernet chip, SSOP28 package
IEEE 802.3-compliant Ethernet controller integrated MAC and 10 BASE-T PHY
Support full-duplex and half-duplex mode
SPI interface, SPI clock can be up to 20MHZ, maximum speed up to 10Mb / s SPI interface
Single-supply operation: 3.3V
Murata ceramic crystal 25Mhz
Dimensions: Length Width 25.4mm X 27.94mm.

Microduino-ENC28J60 Interface:
VCC-> 3V3
GND-> GND
CS-> D8
SI-> D11
SO-> D12
SCK-> D13
INT-> D2 (optional, need to connect R3 (0-2K))
RST-> RST


Schematic:
HCMIDU0005_Microduino_ENC28j60_Schematic.png

Example Sketch:

Code: Select all

/* FILE:    Microduino_ENC28J60_Ethernet_Example
   DATE:    03/06/13
   VERSION: 0.1

This is an example of how to use the Hobby Components Microduino ENC28J60 Ethernet
module (HCMIDU0005).

To use this sketch you will need to download and install the EthernetCard library
available at the following location:

https://github.com/jcw/ethercard

Alternatively, a known working snapshot can be downloaded from the microduino section 
of our support forum:

http://forum.hobbycomponents.com/

This example program will serve a basic webpage at the ip address specified below. 
As an example of content, the webpage contains the current status of the analogue input 
pins.

REVISIONS:

V0.1 Initial version


You may copy, alter and reuse this code in any way you like, but please leave 
reference to HobbyComponents.com in your comments if you redistribute this code. 
This software may not be used directly for the purpose of selling products that 
directly compete with Hobby Components Ltd's own range of products. 

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER 
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES, 
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY 
REASON WHATSOEVER.

*/


/* Include the EtherCard library */
#include <EtherCard.h>

/* The IP address of the module. Make sure this matches the IP
   address range of your network and that it is not in use by any other 
   device on it */   
static uint8_t IPaddress[] = { 192,168,1,55 };

/* The gateway IP address of your router */
static uint8_t GatewayIP[] = { 192,168,1,1 };

/* MAC address of the ethernet shield. If you are using this on your 
own network then the MAC address below will be fine, but remember if 
you use more than one shield on your network they will need to be assigned
unique MAC addresses */
static uint8_t MACAddress[6] = {0x54, 0x55, 0x58, 0x10, 0x00, 0x24};

/* Create a buffer for send and receive data */
byte Ethernet::buffer[500];
BufferFiller bfill;


void setup()
{
  /* Initialise the ethernet interface */
  if (ether.begin(sizeof Ethernet::buffer, MACAddress) == 0) 
  {
    /* If it failed to initialise then do nothing */
    while(1);
  }
  /* Else set up a fixed IP address */
  ether.staticSetup(IPaddress, GatewayIP); 
}


/* Main program */
void loop()
{
  /* Get length of recived packet */
  word PacketLength = ether.packetReceive();
  
  /* Has a valid packet been received? If so, then send the web page */
  if (ether.packetLoop(PacketLength))  
    ether.httpServerReply(ExampleContenet()); 
}

/* An example web page which returns the state of the analogue inputs */
static word ExampleContenet() 
{
  bfill = ether.tcpOffset();
  bfill.emit_p(PSTR(
    "HTTP/1.0 200 OK\r\n"
    "Content-Type: text/html\r\n"
    /*"Pragma: no-cache\r\n"*/
    "\r\n"
    "<meta http-equiv='refresh' content='1'/>"   
    "<big><span style=\"font-weight: bold;\">www.hobbycomponents.com"
    "<br>Microduino Ethernet Example:</span></big><br>"
    "*******************<br>"
    "Analogue Pin A0.....$D<BR>"
    "Analogue Pin A1.....$D<BR>"
    "Analogue Pin A2.....$D<BR>"
    "Analogue Pin A3.....$D<BR>"
    "Analogue Pin A4.....$D<BR>"
    "Analogue Pin A5.....$D<BR>"
    "Analogue Pin A6.....$D<BR>"
    "*******************<br>"),
    /* Read the analogue inputs */
    analogRead(0),analogRead(1),analogRead(2),analogRead(3),analogRead(4),analogRead(5),analogRead(6));
  /* Return the current buffer position */
  return bfill.position();
}

Compatible Arduino Library:

https://github.com/jcw/ethercard
ethercard-master.zip
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Microduino”