iban
New Member
Posts: 4
|
Post by iban on Nov 22, 2020 16:37:10 GMT
Buenas Tardes,
escrbibo en español porque es mucho mas sencillo.
La Tarjeta Shieldbuddy, la idea como tarjeta es excepcional, es lo que estaba buscando para integrar Ethercat, Pixy y gateway modbus tcp can, pero no funciona en el entorno de Arduino, es mentira que las librerías funcionan. Los drives no son compatibles con Arduino, hay que modificarlas todas las librerías. Muchos de los ejemplos dan error al compilar. Hasta una instrucción como if da error o mensajes de warning. Es mentira que es compatible con el pinout de una UNO o Mega. Tiene un pinout parecido. La documentación esta mal o no explica bien como utilizarla. Llevo semanas a ostias, perdon por la expresión, con la tarjeta para poder comunicarme a través de la Ethernet Shield 2 y no hay forma. He conseguido funcionar en SPI con un MCP23s17 y después de pegarme mucho. La tarjeta siempre se queda bloqueada.
Es una pena la verdad y me da mucha rabia. ya lo volveré a intentar en unos meses. gracias, un saludo
Ivan
|
|
|
Post by Admin on Nov 23, 2020 9:57:51 GMT
Hi,
Sorry to hear about your problems. This sketch works with Ethernet2 v1.0.3. It sends ADV values to a web browser on IP address 192.168.1.252.
/* Web Server
A simple web server that shows the value of the analog input pins. using an Arduino Wiznet Ethernet shield.
Circuit: * Ethernet shield attached to pins 10, 11, 12, 13 * Analog inputs attached to pins A0 through A5 (optional)
created 18 Dec 2009 by David A. Mellis modified 9 Apr 2012 by Tom Igoe
*/
#include <SPI.h> #include <Ethernet2.h>
// Enter a MAC address and IP address for your controller below. // The IP address will be dependent on your local network: byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress ip(192, 168, 1, 252);
// Initialize the Ethernet server library // with the IP address and port you want to use // (port 80 is default for HTTP): EthernetServer server(80);
void setup() { // Open serial communications and wait for port to open: SerialASC.begin(9600);
// Start the Ethernet connection and the server: Ethernet.begin(mac, ip); server.begin(); SerialASC.print("Server is at "); SerialASC.println(Ethernet.localIP()); }
void loop() { // listen for incoming clients EthernetClient client = server.available(); if (client) { SerialASC.println("new client"); // an http request ends with a blank line boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); SerialASC.write(c); // if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so you can send a reply if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connection: close"); // the connection will be closed after completion of the response client.println("Refresh: 5"); // refresh the page automatically every 5 sec client.println(); client.println("<!DOCTYPE HTML>"); client.println("<html>"); // output the value of each analog input pin for (int analogChannel = 0; analogChannel < 6; analogChannel++) { int sensorReading = analogRead(analogChannel); client.print("analog input "); client.print(analogChannel); client.print(" is "); client.print(sensorReading); client.println("<br />"); } client.println("</html>"); break; } if (c == '\n') { // you're starting a new line currentLineIsBlank = true; } else if (c != '\r') { // you've gotten a character on the current line currentLineIsBlank = false; } } } // give the web browser time to receive the data delay(1); // close the connection: client.stop(); SerialASC.println("client disconnected"); } }
/*** 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 Admin on Nov 26, 2020 8:46:56 GMT
You can see the webserver on the ShieldBuddy running at this IP address: 86.146.123.150We cannot guarantee this will always be switched on!
|
|
iban
New Member
Posts: 4
|
Post by iban on Nov 29, 2020 16:22:36 GMT
Good evening Admin,
Sorry but doesn't work.
I´m going to try in English.
Along this week I have been testing.
My first test with Arduino Ethernet Shield 2 and your sketch. Don't work. My second test. I buy on RS a SeedStudio ethernet shield W5500 which SPI pins are on 13, 12 and 11. Don't work. Arduino Ethernet Shield 2 has SPI pins only on 6 pin SPI conector. They aren't wired on 13,12,11 pins.
I test on MCP23s17 IO expander and works.
On TC275 are 3 SPI port. How HIGTECH compiler decide SPI assignment when a default Arduino program is compile? What are SPI default assignment?
What does the arduino call the TC275 when compiling? better asked, What is the name that identifies TC275 in arduino? For example for ATMega 328p is ARDUINO_ARCH_AVR
Sorry for my English and for continue Angry. I think that your board its not any Arduino compatible board, It is more powerful and opens a new era on Arduino boards, and I'm sorry I can´t use it as expected.
I will try just a pair of test and if it doesn't work then I´ll leave it for a couple of months.
thanks, regards
Ivan
|
|
|
Post by Admin on Nov 29, 2020 16:59:42 GMT
Hi,
It is odd that this shield does not use the normal 6-way SPI connector like the Arduino Ethernet2 shield! We will get a Seeed shield from RS and try it. This might work: to make the ShieldBuddy use MISO = p12, MOSI = p11 SCK = p13, you can try editing the W5100.h file in the Ethernet2 library as follows:
#ifndef W5100_H_INCLUDED #define W5100_H_INCLUDED
#include <SPI.h>
//#define SPI_CS 10 #define SPI_CS BOARD_SPI_SS0_S1 /* Makes ShieldBuddy SPI Channel 1: MISO = p12, MOSI = p11 SCK = p13 */
typedef uint8_t SOCKET;
#if defined(ARDUINO_ARCH_AVR) #define SPI_ETHERNET_SETTINGS SPISettings(4000000, MSBFIRST, SPI_MODE0) #else #define SPI_ETHERNET_SETTINGS SPI_CS,SPISettings(4000000, MSBFIRST, SPI_MODE0) #endif
//#define W5100_ETHERNET_SHIELD // Arduino Ethenret Shield and Compatibles ... //#define W5200_ETHERNET_SHIELD // WIZ820io, W5200 Ethernet Shield #define W5500_ETHERNET_SHIELD // WIZ550io, ioShield series of WIZnet
|
|
iban
New Member
Posts: 4
|
Post by iban on Dec 6, 2020 8:51:26 GMT
Good Morning Admin,
Sorry for my delay. I am too happy. Arduino Ethernet Shield 2 works!. The TC275 ShieldBuddy must be power externally by jack input. Its no necessary to modify the library.
Only one question, when I am using an SPI device in an shield that works with Arduino, Always ShieldBuddy uses 6-way SPI connector?
I am going to continue testing my other shields
Very thanks for your help
Regards!
|
|
|
Post by Admin on Dec 7, 2020 8:41:44 GMT
The ShieldBuddy has many different SPI channels. These are described in the user manual section 2.11 at : www.hitex.co.uk/fileadmin/uk-files/downloads/ShieldBuddy/ShieldBuddyPinoutRevC_UM.pdfTo use them, you need to use the predefined macros BOARD_SPI_XXX: BOARD_SPI_SS0: Pin10 is default CS on SPI Ch0, MISO = P201.1, MOSI = P201.4 SCK = P201.3 BOARD_SPI_SS0_S1: Really pin 10 but this means use it with SPI Ch 1, MISO = p12, MOSI = p11 SCK = p13 BOARD_SOFT_SPI_SS0: Bit bashed SPI only p10 chip select, MISO = p50, MOSI = p51 SCK = p52 BOARD_SOFT_SPI_SS2: Bit bashed SPI only p53 chip select. Board rev. 4269.03.06210_B1 or later.MISO = p50, MOSI = p51 SCK = p52 BOARD_SPI_SS1: Used for SD Cards on SPI Ch0, MISO = P201.1, MOSI = P201.4 SCK = P201.3 By default the 6-way connector is used for SPI but as you can see, other pins can be used, like on the Arduino MEGA and DUE. For some shields (like the SEED Ethernet2) you have to edit the driver source files to substitute the original CPI chipselect pin number for one of these macros. The Arduino Ethernet2 shield does not need to have the external jack used for power. It runs OK using the USB power!
|
|
sinai1
Junior Member

Posts: 67
|
Post by sinai1 on Jan 10, 2021 5:05:19 GMT
you need to read a little more I have this beast working with 2 can channel 2 lin channels one lcd for hmi and 4 external adcs of 8 channels 16bits each and work wonders. obviously you need to invest time to learn the platform.
also they have good support
|
|