Printrbot / Marlin

Fork of Marlin for the Printrbot
87 stars 59 forks source link

Connecting to A2 A3 Analog Inputs #18

Open mrkaroshi opened 8 years ago

mrkaroshi commented 8 years ago

Using some of the resources on this page: http://reprap.org/wiki/Panelolu I've identified the Marlin pin assignments for pin A2 and A3.

I'm trying to use two PT100 thermocouples to supply temperature information for both extruders:http://wiki.e3d-online.com/wiki/E3D_PT100_Amplifier_Documentation

If I use those pin assignments I get: error: 'DIDR2' was not declared in this scope DIDR2 |= 1<<(TEMP_0_PIN - 8);

And...

error: 'MUX5' was not declared in this scope ADCSRB = 1<<MUX5;

However, as I know the TEMP_0_PIN defines are analog pin definitions I initially assumed pins 2 and 3 would work, but I just got a fixed temperature of '1100' with no variation. I've got the TEMP_SENSOR_0 set to '20' for the PT100 board also, so I know the config is set correctly.

How do I interface a PT100 to the remaining analog pins? Is this a fault of the firmware or am I going about this the wrong way?

TIA

mrkaroshi commented 8 years ago

I've tried to narrow down why this wont work, but despite changing these pin definitions I can't get to the root of why the input values are not discernible. I might have to dig into how the Marlin firmware activates the ADCs.

#define X_STOP_PIN         35
  #define Y_STOP_PIN          8
  #define Z_STOP_PIN         36
  #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
  #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
#endif

#define TEMP_1_PIN         2
#define TEMP_2_PIN         3