Main Site Documentation

Connecting ENC28J60 to Cerb40


#1

I have a Cerb40, I have an ENC28J60, and I have the ethernet firmware loaded. What I don’t have is any information that tells me how exactly to connect the ENC28J60 and the Cerb40. I know it uses SPI, but I don’t know what pins to connect where.

I have MISO, MOSI, SCK which I assume just connect to the relevant SPI1 pins. After that, I have INT, CS, RESET, CLKOUT, and WOL that I don’t know where to connect. Does anyone know?


#2

Well, I was going to check the schematic but it looks like they aren’t available anywhere yet :frowning:


#3

Looks like we missed them. We will update early next week.


#4

Thanks


#5

Here’s how the signals line up, depending on whether one uses socket 5 or socket 6:

SOCKET 5                 SOCKET 6
--------                 --------
VCC    ->  1 -> 3v3      VCC    ->  1 -> 3v3
VCC    ->  2 -> 5v       VCC    ->  2 -> 5v
INT#   ->  3 -> PC14     INT#   ->  3 -> PA14
RESET# ->  4 -> PB9      RESET# ->  4 -> PB10
WOL    ->  5 -> PB8      WOL    ->  5 -> PB11
CS     ->  6 -> PC15     CS     ->  6 -> PA13
MOSI   ->  7 -> PB5      MOSI   ->  7 -> PB5
MISO   ->  8 -> PB4      MISO   ->  8 -> PB4
SCK    ->  9 -> PB3      SCK    ->  9 -> PB3
GND    -> 10 -> GND      GND    -> 10 -> GND

Is the module supposed to be connected to 5 or 6? They’re the only two SPI sockets on Cerberus…


#6

Reading through the code on http://ghiopensource.codeplex.com I can’t find the configuration. I believe this is the relevant line:

HAL_CONFIG_BLOCK::ApplyConfig( ENC28J60_LWIP_DEVICE_CONFIG::GetDriverName(), &g_ENC28J60_LWIP_Config, sizeof(g_ENC28J60_LWIP_Config) );

I don’t know where the information for ApplyConfig comes from (or where that’s defined).


#7

Oh, look what I found in enc28j60_LWIP_config_FEZ_Hydra.cpp (yes, Hydra, even though this one is for Cerberus):


 #define ENC28J60_INT                   ((2 * 16) + 14) //GPIO_PIN_NONE
 #define ENC28J60_CS                    ((2 * 16) + 15) //GPIO_PIN_NONE

That’s PC14 for INT and PC15 for CS, then, I think. That means socket 5 is the “ethernet” socket.


#8

And, (prepare for a letdown of massive proportions, here), neither PC14 nor PC15 are exposed on Cerb40. Therefore, Cerb40 cannot be used with the ENC28J60 module without either hardware mods, or software changes (bust out your RVDS, boys).

I’m quite disappointed with this particular development. PA14 and PA13 are exposed on Cerb40, but they’re the SWD (JTAG) pins.


#9

But he, and most users, will not be using JTAG. Plus in future, selecting pins will by dynamic in the firmware.


#10

JTAG or not, the pins are already set to the socket 5 pins, which aren’t on Cerb40, so the point is moot, as they say. Is there an ETA, or maybe a special firmware build of the config.hex for us Cerb40 users?


#11

I can’t see how we would finish this board without exposing JTAG pins! Will double check Monday.


#12

No, you misunderstand me. I don’t think you should expose PC14 and PC15 instead of the SWD pins, I think it would be much simpler to alter the firmware to use the socket 6 pins instead of the socket 5 pins.


#13

I assumed that the end goal is for the Cerberus and CerbuinoBee to work with the Enc28. So I used the same connections as socket 1 of CerbuinoBee since that is the only spi socket on the board. I wired up the cerb40 to a generic enc28j60, and the hardware works fine from what I can tell. And, the same code and config works on the CerbuinoBee. Although, I am using my own solution and not the Ethernet enabled firmware.

-Valkyrie-MT


#14

If you’re using the ethernet enabled firmware and the Cerb40, you need the “altered” firmware for it to work.


#15

I’m planning to use a Cerb40 in one of my Products. I like prototyping with Ceruino first. But I’m not sure if I will have issues when switching to Cerb40 then. Especially I need Ethernet. So I there some description (hardware, software, or both?) how to enable Ethernet on the Cerb40?


#16

The answer is in #4 (the socket 6 column). If you copy and paste that here, I’ll mark yours as the answer. You also need to use the Ethernet version of the firmware (but not the most recent version, that’s apparently broken).


#17

I thought there are further changes necessary because of this in #7:

[quote]Cerb40 cannot be used with the ENC28J60 module without either hardware mods, or software changes (bust out your RVDS, boys).

[/quote]

Can you confirm, that I just need to wire up like decribed in #4 and then use Ethernet firmware?


#18

Cerb40 will work just fine with EMC28J60


#19

The “software changes” were made by GHI; in fact, they were necessary to make the ENC28J60 work on the Cerbuino. Now, you can just connect it up as in #4 (socket 6 column), and use the ethernet firmware (except not the August 23 or whatever version).


#20

The ENC28J60 can also be made to work with the Cerb40 by using the mIP TCP/IP stack. Which works with the latest Aug 24 QFE2 firmware (without Ethernet). So you don’t need “altered” firmware with mIP. In fact, you can probably use the firmware that the Cerb40 ships with and not reflash at all, although I would recommend a reflash to the latest firmware.

Learn more at http://mip.codeplex.com

P.S. If you buy one today, what firmware does the Cerb40 ship with anyway?