Pages: 1 2 [3] 4 5 6   Go Down
Author Topic: max6675+ethernet+sd card  (Read 6095 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No luck this time
With the max wires connected I get

Starting SD..fail
Starting w5100..

And it just hangs like that

José
Logged

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

There must be a wiring problem or IC fail. Check:
Pin 7 (SO) to digital pin 50
Pin 6 (CS) to digital pin 49
Pin 5 (SCK) to digital pin 52
Pin 4 Vcc = 5v
Pin 1 GND is connected to ground on the Arduino.

Try the test sketch with the above connected, except leave SO (Pin 7 to digital pin 50) disconnected for a test. Do the SD and w5100 start ok then? SO should be a tri-state output on the max6675, but that may not be working correctly.

edit: If that works ok, then connect pin 7 to digital pin 50 and connect pin 6 (CS) to +5v. Try the test again.
« Last Edit: November 06, 2012, 02:08:03 am by SurferTim » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without pin 6 I get

Starting SD..ok
Starting w5100..192.168.1.96
Setup complete

With pin 6 to 5v I get

Starting SD..ok
Starting w5100..

And it hangs there.

Jose
Logged

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

Quote
Without pin 6 I get

Starting SD..ok
Starting w5100..192.168.1.96
Setup complete
You did mean without pin 7 connected to the Arduino, correct? If that is correct, then the max6675 is malfunctioning. The SO pin on that IC is not tri-state, and trashing up the SPI bus. On that, I don't have a solution except try replacing it.

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry I meant pin 7 the one on the pin 50 of mega.

José
Logged

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

I contacted Maxim tech support about the max6675 SO pin, and if it is in fact a tri-state output. I should hear from them soon.

edit: Maxim is on the west coast, so it may be a while. If you want to experiment a little while you wait, remove the ethernet shield and run this code with the max6675 connected.
Code:
#include <SPI.h>

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

  pinMode(53,OUTPUT);
  SPI.begin();
 
  // disable max6675 SPI and start the first A/D conversion
  pinMode(49,OUTPUT);
  digitalWrite(49,HIGH);
  
  Serial.println("Setup complete");
}

void loop() {
  delay(1000);

  // thisTemp gets temp in 1/4 degrees C
  int thisTemp = readMax();
  
  Serial.print(thisTemp/4,DEC);
  Serial.print(".");
  Serial.println((thisTemp%4) * 25,DEC);
}

int  readMax() {
  int maxLow;
  int maxData;
  
  //  enable max SPI
  digitalWrite(49,LOW);

  // do the 16 bit read  
  maxData = SPI.transfer(0x00);
  maxLow = SPI.transfer(0x00);
  
  // disable max SPI and start next conversion
  digitalWrite(49,HIGH);

  // convert to an integer from the two bytes
  maxData = maxData << 8;
  maxData = maxData | (maxLow & 0xff);

  // shift temp reading into position
  maxData = maxData >> 3;
  
  // return 1/4 degrees Celsius
  return maxData;
}
Does it display the correct temperature on the serial monitor?

I forgot to set pin 53 to OUTPUT in the setup() function. I corrected that.
« Last Edit: November 06, 2012, 09:19:50 am by SurferTim » Logged

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

This is from Maxim tech support:
Quote
Tim,
Yes, the MAX6675 SO pin should be high-impedance when CS\ is high, as well as during the D0 bit output (see Figure 1a).

Send us a scope shot of a read to another chip, showing our CS\, SCLK, & SDO.

MAX6675 is not recommended for new designs; use MAX31855KASA+.
http://www.maximintegrated.com/datasheet/index.mvp/id/3149/t/or

Mixed Signal Apps
I will presume the output section of your device has failed. It may output the correct data when connected by itself, but not go to high impedance when the CS line is HIGH.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello
Surfer Tim I will do that test later tonight. I am at work now and I cannot remove the Ethernet shield.
Meanwhile I was doing some searching regarding the version of the Ethernet shield and I found this site

http://shieldlist.org/arduino/ethernet-v5

This is my board.
Here it says that this version of the Ethernet shield uses analog 0 and 1.
Currently I am using this port as analogs inputs.
Could this be the problem ?

José
Logged

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

My opinion? Disconnect everything from your Mega. Try just the max6675 on the standard SPI bus. Then try it with just the ethernet shield. Then add one thing at a time until it fails, then back up one step.  smiley
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello
I would prefer not to do that because I have lots of stuff connected and between testing I keep my old version running and getting data for all the other sensors.
So can we keep testing with all plugged ?

Thanks

José
Logged

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

Sure! Upload the code in reply #18. What does the serial monitor show?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Could this be the problem ?
Clearly a problem. Not necessarily THE problem.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I shell correct this as soon as I get home.
And do the testing Surfer Tim suggested.
thanks for all the help guys.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello
I am back to the testing
With the code from post #18 and the wire of the max connect to pin 50 I get
Starting SD..fail
Starting w5100..
If I disconect the wire of pin 50 it runs
I get

Starting SD..ok
Starting w5100..192.168.1.96
Setup complete
0.-25
0.-25
0.-25
0.-25
0.-25


José



Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The same happens with the code from post #14.

José
Logged

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