Pages: 1 ... 3 4 [5] 6   Go Down
Author Topic: Mega with wiznet shield (wire hack)+thingspeak+sd problem  (Read 3800 times)
0 Members and 1 Guest are viewing this topic.
New Jersey
Offline Offline
Faraday Member
**
Karma: 65
Posts: 3638
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From the release notes:
Quote
Support has been added for printing strings stored in flash (program
  memory) rather than RAM. Wrap double-quoted strings in F() to indicate
  that they should be stored in flash, e.g. Serial.print(F("hello world"))

But as you're using a Mega, it may be a moot point.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wildbill, thanks I will try that.

Tim,

firts attempt is failed. Second, third, fourth is ok.

after power down and up again, it is failing for every attempt

edit: after rewriting with the F macros the sd open failed too
« Last Edit: November 24, 2012, 10:23:18 am by vespapierre » Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 138
Posts: 5846
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This page has an example sketch for the Dallas temp sensor.
http://www.arduino.cc/playground/Learning/OneWire
It does not include any header files except OneWire.h. Maybe that will help you get it set up. Compile and upload the example sketch and insure it works ok. If it does, then we'll rename that "loop" function to something else and add it to your sketch.

edit: Don't use the F() macro yet. Keep it as simple as possible. Add the fancy stuff later.
If it fails to start the SD, then something is not right. If you comment out the new include and declaration, does it work again? If so, you might want to try contacting Paul Stoffregen or checking his website.
http://www.pjrc.com/teensy/td_libs_OneWire.html
Maybe he has something that would help.

Also, post a link to the ethernet shield/sd card setup that you are using. Some old shields used funny digital pins for other stuff.
« Last Edit: November 24, 2012, 10:39:10 am by SurferTim » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, i will try this example.

I am using this shield for sd and ethernet what is the same as w5100
http://avr.tavir.hu/modules.php?name=Asers_Shop&s_op=viewproductdetails&lid=141&cid=27
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tim this example is working and showing the addresses on serial monitor...

I am a bit confused about this:
... If it does, then we'll rename that "loop" function to something else and add it to your sketch.
..

What do you mean?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 138
Posts: 5846
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just as a test, can you move the sensor to pin D5? It looks like D3 and D4 have something on them. There are traces on the top of the shield running to those pins from some device on the shield. ??

Take a look:
http://avr.tavir.hu/modules/Asers_Shop/images/productimages/avrduino-wiznet-sd.jpg
Insure there are no traces going to pin D5 on the other side of that shield.

edit: Just a word of advice. Get all the hardware working together in their most simple form. Do not continue until then.
« Last Edit: November 24, 2012, 11:56:17 am by SurferTim » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

?? I should solder the wiznet D3 pin out  ( bend d5 too ) and wire that to the boards d5 pin? 

There is a trace, because onewire RJ11 socket is connected to d3.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh and on d4 a led can be defined in the code, so there is a led.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 138
Posts: 5846
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If that is the OneWire from the connector only, then use pin 3. Insure nothing else is connected there. I am not familiar with that ethernet shield hardware. You will need to determine why this code makes it fail.
Code:
#include <OneWire.h>

// DS Temperature chip i/o
OneWire ds(3);  // on pin 3

edit: I see pin 3 going around to an SOIC chip, not the RJ11. Follow it around. I guess that is a 3.3v input to that smd IC device due to the 2.2k resistor set forming a voltage divider.
« Last Edit: November 24, 2012, 03:38:55 pm by SurferTim » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tim,
this is the picture of my shield...

edit: changed the picture...


* 2012-11-24 21.47.39.jpg (1351.63 KB, 2560x1920 - viewed 13 times.)
« Last Edit: November 24, 2012, 03:50:01 pm by vespapierre » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

as the manufacturer said to me, d3 is the onewire, where is also a ds18 on the board and RJ11. I'm getting angry for this shield... smiley-cry
maybe i should try to implement somehow the code what you sent about to mine...?
i mean this one:
http://www.pjrc.com/teensy/td_libs_OneWire.html
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 138
Posts: 5846
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I see now. The Dallas is directly mounted to the board, correct? But I am not sure where else D3 goes. It looks like that trace continues after the 2.2k resistor through that "T" and around to the 8 pin IC at the top of the board. I don't know what that does.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes you are right...here is another view


* 2012-11-24 22.07.42.jpg (1605.02 KB, 2560x1920 - viewed 11 times.)
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 138
Posts: 5846
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can't add this to your new code (reply #46), then you can't use the other code either. It uses OneWire.
Code:
#include <OneWire.h>

// DS Temperature chip i/o
OneWire ds(3);  // on pin 3
If adding this makes the SD fail, there is a conflict somewhere. You must determine what that is.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just to be sure...pin definition and enable/disable 'devices'...
So I'm using the realtime clock, onewire( digital pin3), sd card( digital pin8), and wiznet (digital pin 10). Shield has no ICSP connection.

Please confirm, I should enable/disable the devices.

inputs and outputs :  sdcard( 8 ), wiznet(10) and onewire (3) should be defined as an output, is it right? ( on onewire currently there are 3 ds18b20 )
enable/disable:  put the pin to LOW state will enable the 'device', put the pin to HIGH state will disable that. Is it right?

for example here before I should enable wiznet, and disable SD and onewire:

Code:

//in the setup()

pinmode(8,OUTPUT);
pinmode(10,OUTPUT);
pinmode(3,OUTPUT);


//in loop() for example


digitalwrite(10,LOW);
digitalwrite(8,HIGH);
digitalwrite(3,HIGH);

if(!getPage(server,pageAdd)) Serial.print("Fail ");
    else Serial.print("Pass ");


Are these correct?
« Last Edit: November 26, 2012, 04:30:33 am by vespapierre » Logged

Pages: 1 ... 3 4 [5] 6   Go Up
Jump to: