modify firmware code line for HOT END TEMP


Hello all,

I had broken my adc port for the END TEMP due to a broken thermistor or something like that , I am not sure. I replaced the thermistor and the DEF error disappeared. My heat bed temp works fine but my END TEMP is on 245 degrees at room temperature.
So I double , triple checked everything and there were no shorts thermistors were brand new and had good values. I came to the conclusion that the ADC port might been burned out or something.
So, good news I have made an attempt in repairing the adc port or replacing the adc port myself.

I have looked at the melzi 2.0 schematics and found that pin 30 on the mcu is for END TEMP and I switched it with pin 37 SS-SD something for my SD CARD READER I think it is a slave select pin if I'm not mistaken for the SPI port on the atmel mcu.
Now I have broken or cut off the original END TEMP pin on the mcu and luckily there was a via standing in the way little bit further from the mcu about 5 -10mm so I clean it up. Pin number 37 that is supposed to act like a SS for the SD is also adc and I just desolder it and pull it up a bit on the mcu.
I did my best solder a jumper wire between pin 37 and the via on route from pin 30. Now with little or no luck I should be able to fix my END TEMP . 

I started up my printer and got immediately a DEF error on both END TEMP and BED TEMP which is normal because , if I previously disconnected one of those thermistors from the board I would get the same error so is only natural since the END TEMP pin number 30 is not connected to the rest of the board anymore. I then also got to see what the SD CARD says and as I expected I push the '' MOUNT SD CARD '' button but with no change at all. So this function do not work anymore meaning that I will have to print through the USB.

The last remaining thing for me now is to modify the firmware and here is where I need help. I need to change somehow in the firmware the END TEMP pin from 30 to 37. I don't know how it is assigned in the firmware and which number it should or would have. Pin number 30 and 37 are the real MCU pins.
Anyway... anybody an idea how I should get started ? Please keep it as simple as possible without the need of programming devices, since I have a usb port and the firmware is working on it I'm looking for a way to modify the firmware with a software or some kind.

Please advice

greets

Comments

  • You need to set the analog pin number for temperature pins, not the digital pin number! Search "melzi pinout" to see the mapping. At least for mega2560 pinout you get nice images with mappings. Alternatively search for what melzi should be compatible to.

    Also note that thermistors are not connected to adc directly but between gnd/5v with a 4.7k resistor.

    SS pin is special as it needs to be output if you use SPI, e.g. for sd card, so misusing it might be a problem.
  • Hello,

    I did that I got other errors and no way out of this one it seems something is wrong with the SDI or the sanguinololu board support I don't know. I have set my serial port to all kind of different baud rate , as well as on the computer and also on the printer with no luck.. I know that SS stands for slave select so yes it is for SPI. What I did was , I disconnected the mcu pin for SS and reconnected it with a jumper wire to the SAME traces on a via for the original ADC pin. Off course the original broken adc pin on the mcu is been cut off. So now the new SS pin follows the same paths as the old, thus also all the other key components like resistors in between or whatever. 

    This is the error I got 

    Using library SPI at version 1.0 in folder: C:\Users\Lexx\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI 

    Sketch uses 115,444 bytes (88%) of program storage space. Maximum is 130,048 bytes.
    Global variables use 4,118 bytes (25%) of dynamic memory, leaving 12,266 bytes for local variables. Maximum is 16,384 bytes.
    C:\Users\Lexx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/bin/avrdude -CC:\Users\Lexx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/etc/avrdude.conf -v -patmega1284p -carduino -PCOM10 -b115200 -D -Uflash:w:C:\Users\Lexx\AppData\Local\Temp\builda15f206fc5e1f8f0e892ae521df71524.tmp/Repetier.ino.hex:i 

    avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch

             System wide configuration file is "C:\Users\Lexx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/etc/avrdude.conf"

             Using Port                    : COM10
             Using Programmer              : arduino
             Overriding Baud Rate          : 115200
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1e
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x06
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x7e
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x06
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x9e
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x18
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x06
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x7e
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xe6
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x80

    avrdude done.  Thank you.

    An error occurred while uploading the sketch
  • The error has nothing to do with firmware. It is just the uploader failing to do so. How that works depends on the bootloader on your Melzi. You could try wiring protocol as well. For Arduino Mega this works with 115200 baud.
Sign In or Register to comment.