hisun
New Member
Posts: 33
|
Post by hisun on Feb 3, 2017 13:24:43 GMT
Could we feed 4 wires from the SPI connector to the extended IO connector pins 50 to 53 should enable the Ethernet shield. Please pay attention to the attachement. Ethernet wires physically.pdf (521.54 KB) Is it possible? Everything fine?
|
|
|
Post by mjb on Feb 3, 2017 13:38:55 GMT
You could manually connect the P201 SPI connector (MISO, MOSI, SCLK) to the corresponding pins on the expansion connector, not 4 wires like in your PDF. The chipselect is pin10 so this is OK. I have never tried to do this but it should work. I am not sure about what to do with pin53. The Industrial Shields manual says that this must be set to an output and LOW. No idea why.
|
|
hisun
New Member
Posts: 33
|
Post by hisun on Feb 3, 2017 16:55:22 GMT
|
|
|
Post by mjb on Feb 3, 2017 17:38:44 GMT
|
|
|
Post by Admin on Feb 3, 2017 17:45:59 GMT
When do you need this working by?
|
|
hisun
New Member
Posts: 33
|
Post by hisun on Feb 3, 2017 18:31:55 GMT
Sorry but as soon as possible ....
|
|
|
Post by mjb on Feb 4, 2017 11:23:40 GMT
Hi. There is a problem with Pin50 being used as the MISO as this half of an LVDS pair with pin48. The quickest solution is to connect the bare pads (P201) for the Arduino SPI port to the corresponding pins 50,51,52. I think this makes the ShieldBuddy look like an Arduino MEGA. There is another possible solution if you can connect P15.4 (SCL, Pin21) to Pin50. Are you using the I2C on this pin?
We are planning a ShieldBuddy board revision in the near future and we will fix this Pin50 problem. We will also move the USB connector to line up with the one on the Arduino MEGA, as this will make it a better fit in the Industrial Shields casing.
|
|
|
Post by mjb on Feb 4, 2017 12:28:06 GMT
After more tests, I can only suggest connecting P201 pads to pins 50, 51, 52.
We will have another investigation on Monday.
|
|
|
Post by mjb on Feb 6, 2017 14:02:42 GMT
I have tried this and it works.
|
|
hisun
New Member
Posts: 33
|
Post by hisun on Feb 6, 2017 18:00:00 GMT
Thats good news.
Could you give a short description what you exactly have done. Do you also continue to work at a software solution for the SPI communication.
|
|
|
Post by Admin on Feb 6, 2017 18:39:21 GMT
We simply ran wires from the P201 pads to pins 50,51, 52. This works in the Industrial Shield.
The root of the problem is that TC275 P21.2 only works as a LVDS differential pair with P21.3.
A software only solution to this would require a bitbashed SPI port which is not a nice solution but we will try it.
This will make the Shieldbuddy more like the Arduino MEGA.
|
|
|
Post by Admin on Feb 6, 2017 18:42:14 GMT
We will try to do a software SPI using core2.
|
|
hisun
New Member
Posts: 33
|
Post by hisun on Feb 8, 2017 12:24:08 GMT
We simply ran wires from the P201 pads to pins 50,51, 52. This works in the Industrial Shield. We wired form P201 pads 1,3,4 to pins 50,52,51. In the Sketch we set an IP with Ethernet.begin(mac, ip), but Ethernet.localIP() always returns 0.0.0.0. Could you please post your test Sketch, so we can test it with your working example code. Thanks
|
|
|
Post by mjb on Feb 8, 2017 12:45:35 GMT
Here it is:
#include "SPI.h" #include "Ethernet.h"
#pragma GCC optimize "-O0"
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; /*IPAddress ip(192,168,1, 177); IPAddress gateway(192,168,1, 1); IPAddress subnet(255, 255, 0, 0);*/
// telnet defaults to port 23 EthernetServer server(23); boolean alreadyConnected = false; // whether or not the client was connected previously
void setup() {
SerialASC.begin(9600); SerialASC.println("Starting Chat Server...");
/* Make sure other pins on P50-53 are inactive */ IfxPort_setPinMode(&MODULE_P33, 4, IfxPort_Mode_inputNoPullDevice); IfxPort_setPinMode(&MODULE_P02, 8, IfxPort_Mode_inputNoPullDevice); IfxPort_setPinMode(&MODULE_P11, 12, IfxPort_Mode_inputNoPullDevice); IfxPort_setPinMode(&MODULE_P33, 5, IfxPort_Mode_inputNoPullDevice);
// initialize the ethernet device Ethernet.begin(mac);
// start listening for clients server.begin();
// Open serial communications and wait for port to open: while (!SerialASC) { ; // wait for serial port to connect. Needed for Leonardo only }
SerialASC.print("Chat server address:"); SerialASC.println(Ethernet.localIP()); }
void loop() { // wait for a new client: EthernetClient client = server.available(); uint8_t i;
// when the client sends the first byte, say hello: if (client) { if (!alreadyConnected) { // clead out the input buffer: client.flush(); SerialASC.println("We have a new client"); client.println("Hello, client!"); alreadyConnected = true; }
if (client.available() > 0) { // read the bytes incoming from the client: char thisChar = client.read(); // echo the bytes back to the client: //server.write(thisChar); // echo the bytes to the server as well: SerialASC.write(thisChar); } } }
/*** Core 1 ***/
/* CPU1 Uninitialised Data */ StartOfUninitialised_CPU1_Variables /* Put your CPU1 fast access variables that have no initial values here e.g. uint32 CPU1_var; */ EndOfUninitialised_CPU1_Variables
/* CPU1 Initialised Data */ StartOfInitialised_CPU1_Variables /* Put your CPU1 fast access variables that have an initial value here e.g. uint32 CPU1_var_init = 1; */ EndOfInitialised_CPU1_Variables
void setup1() { // put your setup code for core 1 here, to run once:
}
void loop1() { // put your main code for core 1 here, to run repeatedly:
}
/*** Core 2 ***/
/* CPU2 Uninitialised Data */ StartOfUninitialised_CPU2_Variables /* Put your CPU2 fast access variables that have no initial values here e.g. uint32 CPU2_var; */ EndOfUninitialised_CPU2_Variables
/* CPU2 Initialised Data */ StartOfInitialised_CPU2_Variables /* Put your CPU2 fast access variables that have an initial value here e.g. uint32 CPU2_var_init = 1; */ EndOfInitialised_CPU2_Variables
void setup2() { // put your setup code for core 2 here, to run once:
}
void loop2() { // put your main code for core 2 here, to run repeatedly:
}
|
|
|
Post by mjb on Feb 8, 2017 12:47:25 GMT
This example returns an IP address of 192.168.3.145 on our network using DHCP.
BTW: We are working on a bit-bashed driver for the SPI port you need.
|
|