Hello. I am trying to connect an ENC28J60 Ethernet module to a Wireless Stick Lite board. On the pin sheet it states that LoRa and Flash pins should be avoided.
Using the EthernetENC.h library, you can initialize the CS pin to another value. In my case I have wired it to pin 36.
The SPI interface is supposed to support up to 4 slaves just by using a different CS pin for each element. I read that you canremap the V_SPI pins, but the examples use other boards…
This is mi current assembly:
Wireless Stick Lite (pin) => ENC28J60
V_SPI_CLK (18)=> SCK
V_SPI_D (23) => MOSI
V_SPI_Q (19) => MISO
V-SPI_CS0 (36) => CS
#include <SPI.h>
#include <EthernetENC.h>
EthernetClient client;
void setup()
{
Ethernet.init(36);
Serial.begin(115200);
while(!Serial)
{
;
}
Serial.print("Ethernet hardware status code: “);
Serial.println(Ethernet.hardwareStatus());
Serial.println(“Initialize Ethernet with DHCP (10sec):”);
if(Ethernet.begin(mac, 10000, 2000) == 0)
{
if(Ethernet.hardwareStatus() == EthernetNoHardware)
{
Serial.println(“Ethernet shield was not found.”);
}
if(Ethernet.linkStatus() == LinkOFF)
{
Serial.println(“Ethernet cable is not connected.”);
}
}
else
{
Serial.print(” DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
Console:
11:15:12.185 -> ets Jun 8 2016 00:22:57
11:15:12.185 ->
11:15:12.185 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
11:15:12.185 -> configsip: 188777542, SPIWP:0xee
11:15:12.185 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
11:15:12.185 -> mode:DIO, clock div:1
11:15:12.185 -> load:0x3fff0018,len:4
11:15:12.185 -> load:0x3fff001c,len:1044
11:15:12.185 -> load:0x40078000,len:10124
11:15:12.185 -> load:0x40080400,len:5856
11:15:12.218 -> entry 0x400806a8
11:15:12.284 -> ⸮T⸮U⸮⸮⸮2-hal-cpu.c:189] setCpuFrequencyMhz(): PLL: 320 / 4 = 80 Mhz, APB: 80000000 Hz
11:15:12.351 -> Ethernet hardware status code: 10
11:15:12.351 -> Initialize Ethernet with DHCP (10sec):
11:15:12.417 -> Failed to configure Ethernet using DHCP
11:15:22.449 -> Ethernet cable is not connected
Thank you in advance!