Hi,
I am having an issue getting a WizNet850io to run on SPI1 on the MicroMod (SPI works fine on the MM and 4.0 - I have not yet soldered on pins to the back of the 4.0 to try SPI1). It spent a while yesterday poking around with a scope to verify the pins that and numbering that match SPI1 and that doesn't seem to be the problem:
5500 on SPI
5500 on SPI1
However, the code always fails at hardwareStatus == EthernetNoHardware for SPI1.
I did follow the library updates suggested by Paul in Thread: Teensy 4.1 SPI1 on W5500 Ethernet module Communication Problem? and it certainly seems like bi-directional communications is happening with the chip. Am I missing something simple here? Is the SPI1 port capable of the settings being used?
I'm currently testing on a SF ATP carrier board but this is going on a custom board I am designing and I need to figure out if this is possible before I route it to SPI1. I have several other chips running on SPI and would prefer to separate the Ethernet. (I also have an SD card socket fitted so SPI2 is potentially out - I have not tried ethernet there).
Also, I'm fairly new to the teensy and started playing with the 4.0 a few months ago. The MicroMod form factor is great for my use case (very low volume light industrial) but the pin numbering changes have me a little confused. With the MM addition to teensyduino are the MM pin numbers correct or the 4.0. I have no hard examples in front of me but it seems like mostly the 4.0 numbers are correct but SF port names not so much? 4.0 SPI2 seems to be what SF calls SPI1/SD and SPI1 is kind of randomly spread around
My current setup is:
MOSI_1: MM pin 67 (G8) | 4.0 pin 26
MISO_1: MM pin 19 (RX1 | 4.0 pin 0
SCLK_1: MM pin 8 (G11) | 4.0 pin 27
CS_1: MM pin 17 (TX1) | 4.0 pin 1
I have updated utility\w5100.cpp, socket.cpp, Ethernet.cpp, and EthernetClient.cpp in \\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Ethernet\src to use SPI1 instead of SPI and am just using the example code below for testing.
Thanks for any help available on this!
Aaron
I am having an issue getting a WizNet850io to run on SPI1 on the MicroMod (SPI works fine on the MM and 4.0 - I have not yet soldered on pins to the back of the 4.0 to try SPI1). It spent a while yesterday poking around with a scope to verify the pins that and numbering that match SPI1 and that doesn't seem to be the problem:
5500 on SPI
5500 on SPI1
However, the code always fails at hardwareStatus == EthernetNoHardware for SPI1.
I did follow the library updates suggested by Paul in Thread: Teensy 4.1 SPI1 on W5500 Ethernet module Communication Problem? and it certainly seems like bi-directional communications is happening with the chip. Am I missing something simple here? Is the SPI1 port capable of the settings being used?
I'm currently testing on a SF ATP carrier board but this is going on a custom board I am designing and I need to figure out if this is possible before I route it to SPI1. I have several other chips running on SPI and would prefer to separate the Ethernet. (I also have an SD card socket fitted so SPI2 is potentially out - I have not tried ethernet there).
Also, I'm fairly new to the teensy and started playing with the 4.0 a few months ago. The MicroMod form factor is great for my use case (very low volume light industrial) but the pin numbering changes have me a little confused. With the MM addition to teensyduino are the MM pin numbers correct or the 4.0. I have no hard examples in front of me but it seems like mostly the 4.0 numbers are correct but SF port names not so much? 4.0 SPI2 seems to be what SF calls SPI1/SD and SPI1 is kind of randomly spread around
My current setup is:
MOSI_1: MM pin 67 (G8) | 4.0 pin 26
MISO_1: MM pin 19 (RX1 | 4.0 pin 0
SCLK_1: MM pin 8 (G11) | 4.0 pin 27
CS_1: MM pin 17 (TX1) | 4.0 pin 1
I have updated utility\w5100.cpp, socket.cpp, Ethernet.cpp, and EthernetClient.cpp in \\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Ethernet\src to use SPI1 instead of SPI and am just using the example code below for testing.
Code:
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetClient.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
uint8_t cmd_inventory[10] = { 0x02, 0x00, 0x09, 0xFF, 0xB0, 0x01, 0x00, 0x18, 0x43 };
EthernetClient client;
IPAddress server(192, 168, 0, 159);
void setup() {
// You can use Ethernet.init(pin) to configure the CS pin
Ethernet.init(1); // Most Arduino shields
// Open serial communications and wait for port to open:
Serial.begin(9600);
// start the Ethernet connection:
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
} else if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// no point in carrying on, so do nothing forevermore:
while (true) {
delay(1);
}
}
// print your local IP address:
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP());
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect(server, 10001)) {
Serial.println("connected");
Serial.println(Ethernet.localIP());
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
Thanks for any help available on this!
Aaron