Show Posts
Pages: [1] 2 3 ... 393
1  Using Arduino / Programming Questions / Re: TFT connected = no IP from DHCP. Not connected = Get IP. on: Today at 08:20:33 am
Remove the SD card from the TFT device. If you are still having trouble with the ethernet shield, it may be the TFT screen MISO line is not being released and going to a high impedance state. Did you notice my response stated "normally" and "should". Some SPI devices do not share the SPI bus well.

Try this ethernet SPI test sketch with the TFT connected and all SD cards removed from both devices. If the serial monitor shows 192.168.2.2, the SPI line is ok. If it shows anything else, the SPI bus is failing for some reason. Check the shield is inserted firmly into the Arduino.
Code:
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2,2);

void setup() {
  Serial.begin(9600);

  // disable SD SPI
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  // disable TFT SPI
  pinMode(6, OUTPUT);
  digitalWrite(6, HIGH);
 
 // Start ethernet
  Serial.print(F("Starting ethernet..."));
  Ethernet.begin(mac, ip);
  digitalWrite(10,HIGH);
  Serial.println(Ethernet.localIP());

}

void loop() {
}
And it could be you are running out of SRAM like PaulS suggested. The ethernet and SD libraries use a considerable amount of SRAM.
2  Using Arduino / Programming Questions / Re: TFT connected = no IP from DHCP. Not connected = Get IP. on: Today at 07:29:25 am
I got it to work after I disconnected the TFT MISO?
No idea why.....
I would appreciate it if someone could tell me whats up here xD
Normally that is caused by one of the device SPI slave selects (TFT or SD) being LOW. The MISO line should be in a hi-Z state if all slave selects are HIGH.

You should also post a link to the TFT screen you are using.
3  Using Arduino / Project Guidance / Re: NFC and Ethernet/SD shield stacked on Mega on: July 30, 2014, 02:49:33 pm
How would I connect pin 10 on the nfc shield to pin 9 on the arduino if there is a shield already connected to it?
The D9 pin is connected to the Arduino through the ethernet shield. Place a small jumper wire from D10 to D9 on the NFC shield and it will connect ok. D9 is not used by the ethernet shield.

Do I need to use this library/ follow these instructions? - https://github.com/jmgjmg/PN532
Follow those instructions. They are the same as what johnwasser and I recommended, except it appears to use D3 instead of D9, but the theory is the same.
4  Using Arduino / Project Guidance / Re: NFC and Ethernet/SD shield stacked on Mega on: July 30, 2014, 12:06:00 pm
The. W5100 doesn't have an issue. Don't know for certain about the w5200, but would guess no issue with it either.

Edit: the Ethernet library has a small bug. Ethernet.begin() leaves the w5100 slave select LOW (active). You must set it to HIGH after the begin call.
5  Using Arduino / Project Guidance / Re: NFC and Ethernet/SD shield stacked on Mega on: July 30, 2014, 10:36:49 am
No. The ethrnet library is not as easy to change the slave select.
6  Using Arduino / Project Guidance / Re: NFC and Ethernet/SD shield stacked on Mega on: July 30, 2014, 09:51:53 am
That is easier to fix than you think. You must do what johnwasser suggested. Bend D10 on the RF532 shield so it does not insert into the ethernet shield, and jumper it to D9 with a short piece of wire. Then change the setup on the nfc instance.
Code:
#define SCK 52
#define MOSI 51
#define SS 9
#define MISO 50
 
PN532 nfc(SCK, MISO, MOSI, SS);
The NFC532 shield must be on top of the ethernet shield for this to work.
7  Using Arduino / Project Guidance / Re: NFC and Ethernet/SD shield stacked on Mega on: July 30, 2014, 09:34:47 am
Neither shield has anything connected to D11-D13. Both use the ICSP connector for the SPI data lines.
http://arduino.cc/en/uploads/Main/arduino-ethernet-shield-06-schematic.pdf
https://s3.amazonaws.com/linksprite/Shields/NFC_shield/NFC_Shield-SCH.pdf

edit: And that would certainly not be the case for the Mega. D11-D13 are just normal I/O pins. It is D50-D52 that are the SPI data pins on the Mega. That is why most new shields use the ICSP connector for SPI data lines.
8  Topics / Home Automation and Networked Objects / Re: Generic Ethernet shield vs Official Ethernet shield on: July 30, 2014, 09:13:15 am
Thanks SurferTim, but I am using a Mega and the SS pin is on 53 when using a Mega.
No. The w5100 slave select is on D10, no matter which Arduino the shield is connected to. The HARDWARE slave select (determines SPI master or slave) is D53, but that has nothing directly to do with disabling the w5100 SPI.

I use the Mega 2560 with the ethernet shield.
9  Using Arduino / Project Guidance / Re: NFC and Ethernet/SD shield stacked on Mega on: July 30, 2014, 09:06:21 am
Do you have the ICSP connector fed through one device or the other? Both use the ICSP connector for the SPI data lines. This header will do the job if you remove the ICSP header from one of the devices and replace it with this unit.
https://www.circuitsathome.com/products-page/components/stackable-2x3-header
Insure you do not cut off the pins on the top of the shield like the shield you currently have. They must insert into the second shield.

10  Topics / Home Automation and Networked Objects / Re: Arduino ethernet shield is not connecting to Internet on: July 30, 2014, 07:08:37 am
If you have a SD card in the shield's slot, remove it. That will cause the dhcp request to fail. You can use then together, but the two devices must be started in a specific order to work.

Otherwise compile and run this code. It tests the SPI connection between the Arduino and the shield. If the serial monitor shows 192.168.2.2, then the SPI bus is ok. If it shows anything else, like 0.0.0.0, then you have a problem there. Insure the shield pins are inserted fully into the Arduino.
Code:
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2,2);

void setup() {
  Serial.begin(9600);

  // disable SD SPI
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  // Start ethernet
  Serial.print(F("Starting ethernet..."));
  Ethernet.begin(mac, ip);
  digitalWrite(10,HIGH);
  Serial.println(Ethernet.localIP());
}

void loop() {
}
11  Topics / Home Automation and Networked Objects / Re: Generic Ethernet shield vs Official Ethernet shield on: July 30, 2014, 07:01:45 am
The following code does not disable the ethernet chip.
Code:
void setup()
{
    // disable Ethernet chip
    pinMode(53, OUTPUT);
    digitalWrite(53, HIGH);

This code disables the w5100 SPI
Code:
void setup()
{
    // disable Ethernet chip
    pinMode(10, OUTPUT);
    digitalWrite(10, HIGH);
12  Using Arduino / Storage / Re: How to initialize SD card using ethernet shield on Mega on: July 30, 2014, 06:48:20 am
If the ethernet shield has a ICSP connector, you don't need to do anything different on the Mega as the Uno, except you must disable the w5100 SPI before starting the SD.
Code:
void setup() {
  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);
  // rest of your setup
13  Using Arduino / Networking, Protocols, and Devices / Re: Largest microSD card on ethernet shield ? on: July 29, 2014, 09:18:32 am
It appears to be 64GB, according to fat16lib.
http://forum.arduino.cc/index.php?topic=182349.msg1350991#msg1350991
14  Using Arduino / Networking, Protocols, and Devices / Re: Multiple ethernet sockets - Web + UDP/TCP on: July 29, 2014, 08:07:50 am
Why must you have access to both servers at the same time? You can't wait for one client to finish before servicing the second?

edit: This post explains how I implement two servers on the ethernet shield.
http://forum.arduino.cc//index.php?topic=151224.msg1135615#msg1135615
15  Using Arduino / Programming Questions / Re: Writing to SD card errors. on: July 29, 2014, 07:24:18 am
If you are using a Mega, you must disable the w5100 SPI by setting the slave select (D10) as OUTPUT and HIGH, or the w5100 may prevent the SD from starting correctly by trashing up the SPI bus.
Code:
  Serial.print("Initializing SD card...");
  // make sure that the w5100 chip select pin is set to OUTPUT and HIGH
  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);

  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
  }
  Serial.println("card initialized.");

You should run SD.begin(4) only once, and that should be in the setup() function.
Pages: [1] 2 3 ... 393