Show Posts
Pages: 1 [2]
16  Products / Arduino Due / Re: Connecting an Ethernet PHY to Arduino Due on: January 25, 2013, 06:07:23 pm
Palliser,

Thanks for all your awesome work you are doing on the Arduino Due - Your idea on the wedge is nothing short of awesome!  I will be super impressed to see it in action.  I'm quite frustrated with the slowness of all of the WIZnet (W5100, W5200) options for Arduino Ethernet capability and I'm down to help test a faster and more reliable solution for the Due.

I just ordered a couple of the TaijiDUE boards and I'll open up both of my Arduino Due's to sacrifice for this project in the meantime since it should take a couple weeks to get them in the USA from where they ship in China.

I also noticed there were several PHY options listed in the following document:
http://www.atmel.com/Images/doc11153.pdf

Are you choosing the Davicom PHY due to it being part of the SAM3X-EK evaluation board from Atmel?

If so, I'll be ordering some of the Davicom PHY as well as a couple of the others just in case we need them on hand for testing.
17  Products / Arduino Due / Re: OneWire in Due on: January 23, 2013, 09:17:40 pm
Paul,

I'm having problems reading from multiple DS18B20's with your 2.2 preview library.

Fresh copy of arduino-1.5.1r2-windows, and downloaded just your 2.2 preview library, and I run the DS18x20_Temperature sketch with three of the DS18B20's attached to Due pin 54 (Analog line 0) and I get the following:

Quote
No more addresses.

No more addresses.

No more addresses.


If I pull two of the sensors out it starts returning results although sometimes it returns results like the following:

Quote
ROM = 28 F6 C3 49 3 0 0 25
  Chip = DS18B20
  Data = 0 FF FF FF FF FF FF FF FF FF  CRC=C9
  Temperature = 4095.94 Celsius, 7404.69 Fahrenheit

or

Quote
ROM = 28 F6 C3 49 3 0 0 25
  Chip = DS18B20
  Data = 1 50 5 4B 46 7F FF C 10 1C  CRC=1C
  Temperature = 85.00 Celsius, 185.00 Fahrenheit
18  Products / Arduino Due / Re: DUE ethernet performance on W5200 with SPI and SPI+DMA on: January 20, 2013, 11:25:42 pm
mantoui,

I finally got a couple WIZ820io with the W5200 chip.  I'm trying to replicate your results on the Due but I'm running into difficulties.

I have it hooked up per the picture I made, hopefully this helps someone else or if I have it hooked up wrong please let me know:



My main problem is that using your modified Ethernet.h and updated w5100.cpp and w5100.h files I'm having a problem with the device locking up if I press the F5 button on my Firefox browser too many times.  It seems that if I press the F5 key about once every half a second the Due will crash/lock up and afterwards will not respond to ping or http.  Only a reset of the Due through pressing reset button or re-uploading the sketch will allow it to be pinged once again:



Let me know if you have any ideas, I would love to get this thing running reliably.  I would hate to be impatient hundreds of miles from home and crash my due/W5200 remotely just because I was hitting refresh on my smartphone too often. Haha!

I'm running the WebServer sketch under:
hardware\arduino\sam\libraries\Ethernet\examples\WebServer

I have been able to verify that the R3 version of the Arduino Ethernet shield running the W5100 chip does not suffer from this problem.  In fact I can hold down the F5 key and it will not drop ping and will continue to respond to http.
19  Products / Arduino Due / Re: Due and ethernet processing speed on: January 11, 2013, 10:30:51 pm
firstone,

All of the Ethernet shields from Arduino, including the latest R3 shield use the WIZnet 5100.  This chip is quite old and due to the way it was constructed the SPI speed is very slow resulting in what I would describe as just utterly terrible performance.

One of my first sketches was to output a JPEG over http stored on a SD card plugged into the Arduino Ethernet R3.  A 62 KB JPEG took over 3 seconds for the Arduino UNO with the shield to send the data to the browser which I timed using a Firefox add-on called Firebug.  The performance was very slow, it almost reminded me of dialup days or when I first used an ISDN line.

It's going to take quite some time for another Due compatible board to come out that breaks out the SAM3X8E pins and allows you to hook up an external PHY and additional time for someone to develop the code to run a TCP/IP stack.

mantoui,

I have several WIZnet 5200 and even some WIZnet 5300 chips in the mail as well as the integrated WIZ820io which contains a MagJack and the W5200 chip.  Once I receive them, I would be happy to run your benchmarks posted and confirm your findings.  If what your benchmarks show is true, we may finally be able to get acceptable Ethernet performance out of an Arduino platform running these newer chips from WIZnet.
20  Products / Arduino Due / Re: OneWire in Due on: January 11, 2013, 03:39:10 pm
I've been running the OneWire code that I posted in the ZIP file in a previous post for over 12 hours with no errors pulling data from three DS18B20's.

I have not been able to incorporate mantoui's updated read_bit function but I will do that later tonight when I'm home.

Code:
ROM = 28 A0 CE 49 3 0 0 55
  Chip = DS18B20
  Data = 1 A3 1 4B 46 7F FF D 10 CE  CRC=CE
  Temperature = 26.19 Celsius, 79.14 Fahrenheit
ROM = 28 F6 C3 49 3 0 0 25
  Chip = DS18B20
  Data = 1 A2 1 4B 46 7F FF E 10 D8  CRC=D8
  Temperature = 26.12 Celsius, 79.03 Fahrenheit
ROM = 28 6B C7 49 3 0 0 C1
  Chip = DS18B20
  Data = 1 A3 1 4B 46 7F FF D 10 CE  CRC=CE
  Temperature = 26.19 Celsius, 79.14 Fahrenheit
No more addresses.

I noticed in the Examples folder there is also a sketch for a DS2408 which is an 8 channel addressable switch.  I have a number of those lying around so I may be able to test the sketch later against one and let you know the results.
21  Products / Arduino Due / Re: OneWire in Due on: January 10, 2013, 09:53:23 pm
Great job gentlemen!

I combined mantoui's updated OneWire::write_bit function along with the changes made by alvesjc and I'm now able to run the DS18x20_Temperature right out of the box.

This effort should go a long way in getting other people moved over to the Due because so many projects have requirements to read temperatures and interact with other one wire devices.

Thanks for all your help in getting this working.

I've put all the stuff in a zip file for others to test without having to edit the files.
22  Products / Arduino Due / Re: OneWire in Due on: January 09, 2013, 12:35:16 am
alvesjc,

I'm running my Due with arduino-1.5.1r2 on Windows.

I modified the OneWire.h file like you said it seems to work now.  I'm getting the following in the serial window:

Code:
0.00
24.94
24.94
24.94
24.94
26.87
26.87
30.19
30.19
31.44
31.44
32.06
32.06

Those numbers are when I was just touching the DS18B20 with my finger so they look about right to me.

I did notice I wasn't able to get valid temps from the example that I'm using below.  It's from the examples folder in the library you uploaded, any idea why?

Code:
#include <OneWire.h>

// OneWire DS18S20, DS18B20, DS1822 Temperature Example
//
// http://www.pjrc.com/teensy/td_libs_OneWire.html
//
// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library

OneWire  ds(54);  // on pin 54 which is A0 for the Arduino Due

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

void loop(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
 
  if ( !ds.search(addr)) {
    Serial.println("No more addresses.");
    Serial.println();
    ds.reset_search();
    delay(250);
    return;
  }
 
  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
      return;
  }
  Serial.println();
 
  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x10:
      Serial.println("  Chip = DS18S20");  // or old DS1820
      type_s = 1;
      break;
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
      break;
    case 0x22:
      Serial.println("  Chip = DS1822");
      type_s = 0;
      break;
    default:
      Serial.println("Device is not a DS18x20 family device.");
      return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);         // start conversion, with parasite power on at the end
 
  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.
 
  present = ds.reset();
  ds.select(addr);   
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("  Data = ");
  Serial.print(present,HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  }
  Serial.print(" CRC=");
  Serial.print(OneWire::crc8(data, 8), HEX);
  Serial.println();

  // convert the data to actual temperature

  unsigned int raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // count remain gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    if (cfg == 0x00) raw = raw << 3;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw << 2; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw << 1; // 11 bit res, 375 ms
    // default is 12 bit resolution, 750 ms conversion time
  }
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit");
}

In the serial output window I get the following:

Quote
ROM = 28 6B C7 49 3 0 0 C1
  Chip = DS18B20
  Data = 1 FF FF FF FF FF FF FF FF FF  CRC=C9
  Temperature = 4095.94 Celsius, 7404.69 Fahrenheit
No more addresses.

Touching the sensor doesn't do anything and the numbers for Celsius and Fahrenheit don't change - They look a little bit hot to me...  smiley-roll-sweat

Let me know, I can do more testing for you and hopefully we can get a working library that everyone can run.  Thanks for your help.
23  Products / Arduino Due / Re: OneWire in Due on: January 08, 2013, 12:05:17 am
alvesjc,

I tried the library but wasn't able to get it working with my DS18B20 and my Due.  In the serial monitor after dropping your library in the Arduino\Libraries folder I ran you sketch and get the following:

4095.94
4095.94
4095.94
4095.94

If I hold the temp sensor with my finger the numbers don't change a bit, which they obviously should.

I have it wired like the following on my Due but with the data line going to Due line A0 to the middle of the DS18B20 and a 4.7k resistor going from the middle pin to the 5v line.

Sorry bud, I really want this library to work because it's one of the only hold backs keeping me from using the Due instead of the Uno/Leonardo which I have verified good working code on.
24  Products / Arduino Due / Problem with OneWire library on: December 20, 2012, 07:44:51 pm
Hello,

I recently picked up a Due and I'm finding that the OneWire library is giving me some compile errors.

Just trying to run the example "DS18x20_Temperature" in theOneWire\examples\DS18x20_Temperature folder give me a bunch of errors.  Since this is a very commonly used library I was wondering, has anyone been able to get this working on their Arduino Due?

Here is the error that is coming up when compiling:
Code:
In file included from DS18x20_Temperature.pde:1:
C:\Users\KCORE\Documents\Arduino\libraries\OneWire/OneWire.h:77: error: #error "Please define I/O register types here"
C:\Users\KCORE\Documents\Arduino\libraries\OneWire/OneWire.h:84: error: 'IO_REG_TYPE' does not name a type
C:\Users\KCORE\Documents\Arduino\libraries\OneWire/OneWire.h:85: error: ISO C++ forbids declaration of 'IO_REG_TYPE' with no type
C:\Users\KCORE\Documents\Arduino\libraries\OneWire/OneWire.h:85: error: expected ';' before '*' token

The OneWire library I'm using is from this link:
http://www.pjrc.com/teensy/td_libs_OneWire.html

Thanks for any replies or help you can provide.
Pages: 1 [2]