|
|
Description
The ENC28J60 is Microchip's first incursion into the ethernet controller arena,
this new device includes all MAC & PHY IEEE 802.3 10BaseT functions, 8KB of
dual access RAM packet buffer and a SPI serial interface, all in a convenient
28-pin package (SPDIP, SOIC, SSOP and QFN packages available).
It takes just few components to get the ENC28J60 up and running and connected to
a host microprocessor or microcontroller with support for the industry standard
SPI interface.
This project includes the schematics and related information for a simple
hardware implementation based on the ENC28J60 (ENC) and a Microchip 28-pin
PIC18LF2620 8-bit microcontroller running Microchip's free TCP/IP stack.
|
[Click Image to Enlarge]
|
This project is a variant of the PIC10T Project,
that shows a minimal hardware implementation for the Microchip TCP/IP Stack.
Design considerations
While a different MCU can be used for this project, a recommended option due
its additional program and RAM memory space is the the PIC18LF2620 (notice that
we are using an LF part that has an extended power supply range).
To reduce the number of required components both devices will use a
3.3V Vdd supply, and the PIC18LF2620 will source the clock from the ENC
CLKOUT output.
Given that both devices use the same power supply level conversion is not
required and by sourcing the clock from the ENC we will avoid the clock
synchronization problem with ENC silicon revisions prior to B5.
Remember that now the recommended value for RBIAS (R9 in the schematics) is
2.32K 1% for Rev B5 and 2.7K 1% for Rev B1/B4. It's important that you use the
correct value for RBIAS since it controls the signal shape of the differential
outputs, a wrong value can produce deformation of the signal and non-compliance
with IEEE 802.3.
In this design we do not include an external serial EEPROM, we will compile the
MPFS HTTP documents image into the code to be stored in program memory.
The whole circuit was built in a prototype breadboard shown in the picture
above. To facilitate connecting the RJ45 I put the connector, the 49.99 resistors,
the limiting resistors for the LEDs included in the RJ45 jack, the ferrite bead
and two ceramic capacitors in a small board that plugs into the breadboard.
The schematic shows also the RS-232 serial interface but it's not included in
the circuit shown in the picture. If you are considering doing some software
development it's recommended to include the serial interface as another way
to provide additional debugging information.
|
Getting the circuit up and running
Compiling the firmware is not a huge or complicated task, it requires few
software tools available for download from Microchip's
website at no cost, and obviously the TCP/IP stack source code distribution and a
PIC programmer. For this project I used Microchip's
MPLAB ICD2 as a programmer.
With the latest modified version of the
Microchip TCP/IP Stack v3.75, the process is quite simple.
This new version adds the MINIPIC10T macro definition that
combined with the device selection for the Microcontroller generates the appropriate
code for this particular project.
The software distribution includes the MPLAB IDE project file
MINIPIC10T.mcp, load this project into MPLAB IDE,
select the correct processor (by default the project has selected the PIC18F2620)
and verify that the settings on the config.h and
minipic10t.h files apply to your project or modify them
accordingly (both files are located in the include
subdirectory of the main src directory).
Since we will be using the program memory to store the HTTP server documents you
must verify that on the config.h file the line with
the MPFS_USE_EEPROM macro is commented and the line
with the MPFS_USE_PGRM is uncommented.
Also previously to build the code, you must generate a C language image of the
HTTP documents using the MPFS.EXE utility with the
/c option.
Once you have the C file, move it to the src
directory, double check that is included in the project Source file list and
edit it to replace the line that has the #include "..\Include\Compiler.h"
by #include "include/config.h".
For additional details check the README.TXT file
included in the software distribution.
For a detailed explanation about how to build Microchip's TCP/IP stack
for this or similar projects Click Here.
|
Datasheets for relevant parts used in this project
Useful Links
TCP/IP Stack Source code and useful software tools
Some Boards/Products developed with the ENC28J60 controller
Additional Resources
|
|
|