MKS BASE - procedure to diagnose / swap bad mosfet September 11, 2017 04:15PM |
Registered: 6 years ago Posts: 4 |
Diagnosing the mosfet September 11, 2017 04:17PM |
Registered: 6 years ago Posts: 4 |
Finding pins for mosfet(s) (and other things) September 11, 2017 04:18PM |
Registered: 6 years ago Posts: 4 |
//#define DUAL_EXTRUDER
gcc -E -dD -C -I ~/3d/arduino/arduino-1.8.4/hardware/tools/avr/avr/include/ -I ~/3d/arduino/arduino-1.8.4/hardware/arduino/avr/cores/arduino/ -I ~/3d/arduino/arduino-1.8.4/hardware/arduino/avr/variants/mega/ -D'__AVR_ATmega2560__=1' -D'AVR_ATmega2560_FAMILY=1' Marlin_main.cppThere is a lot going on here, but basically the -E tells the compiler to only analyze precompiler commands, and then output the results. The -dD tells it to leave in the "#define" precompiler commands (after it has reduced them to their simplest form). That way you get something like:
#define HEATER_0_PIN 10instead of
#define HEATER_0_PIN RAMPS_D10_PINIt will also evaluate and remove unneeded #if/#elif statements, so that you're only seeing the ones that evaluate to true. Makes it much simpler.
#if HEATER_0_PIN<10 #pragma message "HEATER_0_PIN <10" #endifSo you can start of with <10. If the pragma message shows up when you compile, then the condition is true. Next check <5, and keep splitting the difference until you get it narrowed down to a single pin. It's a little more tedious than the gcc method, but you can get it done. It's also much harder to find out if something else is using that pin...
modifying the pins in the firmware September 11, 2017 04:21PM |
Registered: 6 years ago Posts: 4 |
#if HOTENDS == 1 #define FAN1_PIN MOSFET_D_PIN
#define HEATER_0_PIN 7 //RAMPS_D10_PIN #define FAN1_PIN -1 //MOSFET_D_PIN(lines 165 and 185, respectively) I left the original values in as comments, just so I'd remember what I changed.