chipKIT® Development Platform

Inspired by Arduino™

Ethernet sheild For chipkit UNO32

Created Mon, 07 Apr 2014 05:02:08 +0000 by ajitnayak


ajitnayak

Mon, 07 Apr 2014 05:02:08 +0000

Dear all,

I am planning to use[url]http://arduino.cc/en/Main/ArduinoEthernetShield[/url] with chipkit uno32. The Pin map are almost same. I am thinking it must work on chipkit uno32 . Please let me know where to download associated library function for Chipkit UNo32 with some example program.Your help will be appreciable.


Jermcb

Mon, 07 Apr 2014 23:55:50 +0000

Hi ajitnayak,

If you get the shield to work and somehow have the pins connected correctly to the shield, you can use the network shield library from digilent. http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,942&Prod=CHIPKIT-NETWORK-SHIELD (At the bottom of the page there is a download link.)

Aslo note, the arduino uses a 5V system, so you need to make sure the ethernet shield you have will work at 3.3V.

It has tutorials in there. Bear in mind, that unless the correct pins are connected to your PHY and such, this library will not work. You might want to save yourself the hassle and buy one of these shields from digilent and get it working easily.


ajitnayak

Wed, 16 Apr 2014 04:43:06 +0000

i tried to upload this code

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {  0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

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

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

  Serial.print(F("Starting ethernet..."));
  if(!Ethernet.begin(mac)) Serial.println(F("failed"));
  else {
      Serial.print(F("IP: "));
      Serial.println(Ethernet.localIP());
      Serial.print(F("Subnet: "));
      Serial.println(Ethernet.subnetMask());
      Serial.print(F("Gateway: "));
      Serial.println(Ethernet.gatewayIP());
      Serial.print(F("DNS server: "));
      Serial.println(Ethernet.dnsServerIP());
}

void loop() {
}

I got error as below


GrahamM242

Wed, 16 Apr 2014 08:51:55 +0000

The Serial.print(F( stuff isn't applicable to chipkit, as it's to do with the way that some of the Atmel microcontrollers separate flash and RAM address spaces. You should just be able to remove the F() parts, so that:

Serial.print(F("IP: "));

becomes

Serial.print("IP: ");

No promises that'll result in working code, but it's a good start!


Jermcb

Wed, 16 Apr 2014 18:02:07 +0000

I agree with the post above. You don't add the F before the string in your serial.print functions.

That will get rid of your first error.

The next problem is it looks like you are using the Arduino libraries for you ethernet. Not sure this will work. Your includes should be: #include <chipKITEthernet.h>

You will also need a descriptor file for the ethernet shield you are using. So if you are using the digilent ethernet shield you will also need to include: #include <NetworkShield.h> <<-- This needs to be added to the file above "#include <chipKITEthernet.h>"

(you can probably modify NetworkShield.h to match your board. Never tried.)

Once you have solved these issues, then we can tackle more problems that do come up.

If you are suing the digilent ethernet libraries, you will need to read the pdf that comes with them on how to install them. I can't remember what needs to be done, but you need to follow their steps before tryinng to compile your ethernet sketch.