analog ports on the mini different from the NG?

hi all,

i am trying to access a temperature sensor with my arduino mini. i got the code to work on my arduino NG but i need to run it with my mini. i am getting no response whatsoever from the analog ports of the mini ( i have now tried them all ).
i have a picture of the sensor with the NG here: http://dasautomat.com/wp-content/uploads/blog/tempSensor_med.jpg
on the NG i am using analog ports 4 and 5. the problem is that someone else wrote the code for me and I don´t know where the ports are defined in the code.

anyone got an idea? thanks in advance

and here is the code:

#include <Wire.h>
#define MSB 0
#define LSB 1

void setup(void) {
Wire.begin();
Serial.begin(9600);
Wire.beginTransmission(72);
delayMicroseconds(10);
Wire.send(0xEE);
delayMicroseconds(10);
Wire.endTransmission();
// initialize inputs/outputs
// start serial port
}

void loop(void) {
byte tempByte[2];
int which;
int temp;

delayMicroseconds(50);
Wire.beginTransmission(72);
delayMicroseconds(50);
Wire.send(0xAA);
delayMicroseconds(50);
//Wire.beginTransmission(72);
delayMicroseconds(50);
Wire.requestFrom(72,2);
delayMicroseconds(50);
which = MSB;
while(Wire.available())
{
tempByte[which] = Wire.receive();
delayMicroseconds(50);
which++;
// Serial.print(c);
}
// temp = 8<tempByte[MSB] | tempByte[LSB];
delayMicroseconds(50);
Wire.endTransmission();
Serial.print(tempByte[MSB], DEC);
Serial.print(".");
Serial.println((tempByte[LSB]>>7)*5, DEC);
delay(250);
// program here
// code_block;
}

The problem just seems to be that you're mixing apples with oranges, so to speak... Without looking really closely, it seems that the code and the chip you're using are I2C and a Dallas DS1620.. completely a digital solution, rather than an analog one.

Maybe someone with more experience with the wire.h library will jump in here and point you in the right direction. You should tell us what kind of chip you have there though, that would be most helpful :slight_smile:

D

hi daniel,

yes that observation is correct. i use a ds-1621 0529 b4 116AF. can you give me any pointers on what to change?

as i said, with the code posted above, it worked with my arduino NG using the analog pins 4 and 5.

You need to use analog ports 4 and 5 on the mini. The code is actually making use of a different function of those pins, not using them as analog inputs. Unfortunately, there's no physical pin for those on the Mini. You'll need to solder wires to the right holes. See the diagram at: http://www.arduino.cc/en/Main/ArduinoBoardMini

thanks a lot! will try this right now and let you know if it works.

cheers

andreas

nope, did not work.

anybody an idea what else it might be? i know it´s hard to give a diagnosis this way, but any help is highly appreciated.

best

andreas