Welcome! Log In Create A New Profile

Advanced

Anet A8+ resurrection - Ramps1.6 on Mega2560

Posted by ctroyer26 
Anet A8+ resurrection - Ramps1.6 on Mega2560
April 26, 2026 09:50AM
All,
I am repairing/upgrading my antique Anet A8Plus. I burned out the extruder motor driver on the original Anet board by pulling jammed TPU filament out of the hot end. That generated enough voltage and current to fry the poor motor controller. As the original Anet board uses surface mount components, I opted to upgrade to the Ramps 1.6, with individual A4988 motor controllers. I realized too late that the original Anet A8+ uses 24V for the extruder and bed heaters, and set up a new 12V power supply for the mega2560 and Ramps.
At this point, everything is wired, adjusted and working, and it is time to get the heaters working. My plan is to use the Ramps1.6 AUX1 and AUX2 outputs to control external mosfets that will switch the 24V power for those two heating circuits. I have not been able to find clear instruction as to how to name the outputs in the pins_RAMPS.h. According to one schematic, they are labelled A3,D57 and A4,D58 (for AUX1) and A11,D55, A12,D56 (for AUX2). I'm assuming that the A and D differentiate between using these as analog or digital outputs.
Unless someone can tell me different, I guess I'll just make those changes in the pins file, recompile, upload and see what the oscilloscope shows when I send a command to heat the bed or the extruder.
Cheers and thanks, C.
Re: Anet A8+ resurrection - Ramps1.6 on Mega2560
April 26, 2026 10:11PM
Note: Most people use a mosfet on the current mosfet

ie you plug a mosfet into the bed connector, the mosfet gets 12v and switchess the 24v so you don't need to make any firmware changes

But to answer your question.

These defines are used for RAMPS

#ifndef MOSFET_A_PIN
  #define MOSFET_A_PIN                        10
#endif
#ifndef MOSFET_B_PIN
  #define MOSFET_B_PIN                         9
#endif
#ifndef MOSFET_C_PIN
  #define MOSFET_C_PIN                         8
#endif

They get rearranged depending on what motherboard you select
For BOARD_RAMPS_14_EFB it says you need a mosfet for the extruder, fan and bed
default being

    #define HEATER_0_PIN               MOSFET_A_PIN
    #define HEATER_BED_PIN          MOSFET_C_PIN
    #define FAN0_PIN                        MOSFET_B_PIN

All of these are in "#ifndef" blocks so you can over ride them in Configuration.h by simply adding

#define HEATER_0_PIN {logical pin number you want to use}
#define HEATER_BED_PIN {logical pin number you want to use}

The Marlin/src/pins/ramps/pins_RAMPS.h file contains documentation on all connectors

//
// AUX1    5V  GND D1  D0
//          2   4   6   8
//          1   3   5   7
//         5V  GND A3  A4
//
#define AUX1_05                               57  // (A3)
#define AUX1_06                                1  // TX0
#define AUX1_07                               58  // (A4)
#define AUX1_08                                0  // RX0

//
// AUX2    GND A9 D40 D42 A11
//          2   4   6   8  10
//          1   3   5   7   9
//         VCC A5 A10 D44 A12
//
#define AUX2_03                               59  // (A5)
#define AUX2_04                               63  // (A9)
#define AUX2_05                               64  // (A10)
#define AUX2_06                               40
#define AUX2_07                               44
#define AUX2_08                               42
#define AUX2_09                               66  // (A12)
#define AUX2_10                               65  // (A11)

Pins 55 and 56 are not on aux2 and are used as follows.

#define X_DIR_PIN                             55  // (A1)
#define Y_ENABLE_PIN                     56  // (A2)

Changing pins

You noticed how some pins are A and others D, D is digital and all pins can do this, A is analog in, only pins with a A prefix can do analog in
In code you just use the number, you want the digital function you use the digital pin number.

Eg if you add this to you configuration.h

#define HEATER_0_PIN 57
#define HEATER_BED_PIN 58

the hotend with use pin 57 to control its heater
and the heated bed will use pin 58

alternatively you could set

#define MOSFET_A_PIN 57
#define MOSFET_C_PIN 58

The result is the same


Note these pins are not physical pins numbers as on the chip. they are Mapped logical pin numbers as defined by arduino

**Arduino Mega 2560 PIN mapping table**

| Pin Number | Pin Name                 | Mapped Pin Name                |
| ---------- | ------------------------ | ------------------------------ |
| 1          | PG5 ( OC0B )             | Digital pin 4 (PWM)            |
| 2          | PE0 ( RXD0/PCINT8 )      | Digital pin 0 (RX0)            |
| 3          | PE1 ( TXD0 )             | Digital pin 1 (TX0)            |
| 4          | PE2 ( XCK0/AIN0 )        |                                |
| 5          | PE3 ( OC3A/AIN1 )        | Digital pin 5 (PWM)            |
| 6          | PE4 ( OC3B/INT4 )        | Digital pin 2 (PWM)            |
| 7          | PE5 ( OC3C/INT5 )        | Digital pin 3 (PWM)            |
| 8          | PE6 ( T3/INT6 )          |                                |
| 9          | PE7 ( CLKO/ICP3/INT7 )   |                                |
| 10         | VCC                      | VCC                            |
| 11         | GND                      | GND                            |
| 12         | PH0 ( RXD2 )             | Digital pin 17 (RX2)           |
| 13         | PH1 ( TXD2 )             | Digital pin 16 (TX2)           |
| 14         | PH2 ( XCK2 )             |                                |
| 15         | PH3 ( OC4A )             | Digital pin 6 (PWM)            |
| 16         | PH4 ( OC4B )             | Digital pin 7 (PWM)            |
| 17         | PH5 ( OC4C )             | Digital pin 8 (PWM)            |
| 18         | PH6 ( OC2B )             | Digital pin 9 (PWM)            |
| 19         | PB0 ( SS/PCINT0 )        | Digital pin 53 (SS)            |
| 20         | PB1 ( SCK/PCINT1 )       | Digital pin 52 (SCK)           |
| 21         | PB2 ( MOSI/PCINT2 )      | Digital pin 51 (MOSI)          |
| 22         | PB3 ( MISO/PCINT3 )      | Digital pin 50 (MISO)          |
| 23         | PB4 ( OC2A/PCINT4 )      | Digital pin 10 (PWM)           |
| 24         | PB5 ( OC1A/PCINT5 )      | Digital pin 11 (PWM)           |
| 25         | PB6 ( OC1B/PCINT6 )      | Digital pin 12 (PWM)           |
| 26         | PB7 ( OC0A/OC1C/PCINT7 ) | Digital pin 13 (PWM)           |
| 27         | PH7 ( T4 )               |                                |
| 28         | PG3 ( TOSC2 )            |                                |
| 29         | PG4 ( TOSC1 )            |                                |
| 30         | RESET                    | RESET                          |
| 31         | VCC                      | VCC                            |
| 32         | GND                      | GND                            |
| 33         | XTAL2                    | XTAL2                          |
| 34         | XTAL1                    | XTAL1                          |
| 35         | PL0 ( ICP4 )             | Digital pin 49                 |
| 36         | PL1 ( ICP5 )             | Digital pin 48                 |
| 37         | PL2 ( T5 )               | Digital pin 47                 |
| 38         | PL3 ( OC5A )             | Digital pin 46 (PWM)           |
| 39         | PL4 ( OC5B )             | Digital pin 45 (PWM)           |
| 40         | PL5 ( OC5C )             | Digital pin 44 (PWM)           |
| 41         | PL6                      | Digital pin 43                 |
| 42         | PL7                      | Digital pin 42                 |
| 43         | PD0 ( SCL/INT0 )         | Digital pin 21 (SCL)           |
| 44         | PD1 ( SDA/INT1 )         | Digital pin 20 (SDA)           |
| 45         | PD2 ( RXDI/INT2 )        | Digital pin 19 (RX1)           |
| 46         | PD3 ( TXD1/INT3 )        | Digital pin 18 (TX1)           |
| 47         | PD4 ( ICP1 )             |                                |
| 48         | PD5 ( XCK1 )             |                                |
| 49         | PD6 ( T1 )               |                                |
| 50         | PD7 ( T0 )               | Digital pin 38                 |
| 51         | PG0 ( WR )               | Digital pin 41                 |
| 52         | PG1 ( RD )               | Digital pin 40                 |
| 53         | PC0 ( A8 )               | Digital pin 37                 |
| 54         | PC1 ( A9 )               | Digital pin 36                 |
| 55         | PC2 ( A10 )              | Digital pin 35                 |
| 56         | PC3 ( A11 )              | Digital pin 34                 |
| 57         | PC4 ( A12 )              | Digital pin 33                 |
| 58         | PC5 ( A13 )              | Digital pin 32                 |
| 59         | PC6 ( A14 )              | Digital pin 31                 |
| 60         | PC7 ( A15 )              | Digital pin 30                 |
| 61         | VCC                      | VCC                            |
| 62         | GND                      | GND                            |
| 63         | PJ0 ( RXD3/PCINT9 )      | Digital pin 15 (RX3)           |
| 64         | PJ1 ( TXD3/PCINT10 )     | Digital pin 14 (TX3)           |
| 65         | PJ2 ( XCK3/PCINT11 )     |                                |
| 66         | PJ3 ( PCINT12 )          |                                |
| 67         | PJ4 ( PCINT13 )          |                                |
| 68         | PJ5 ( PCINT14 )          |                                |
| 69         | PJ6 ( PCINT 15 )         |                                |
| 70         | PG2 ( ALE )              | Digital pin 39                 |
| 71         | PA7 ( AD7 )              | Digital pin 29                 |
| 72         | PA6 ( AD6 )              | Digital pin 28                 |
| 73         | PA5 ( AD5 )              | Digital pin 27                 |
| 74         | PA4 ( AD4 )              | Digital pin 26                 |
| 75         | PA3 ( AD3 )              | Digital pin 25                 |
| 76         | PA2 ( AD2 )              | Digital pin 24                 |
| 77         | PA1 ( AD1 )              | Digital pin 23                 |
| 78         | PA0 ( AD0 )              | Digital pin 22                 |
| 79         | PJ7                      |                                |
| 80         | VCC                      | VCC                            |
| 81         | GND                      | GND                            |
| 82         | PK7 ( ADC15/PCINT23 )    | Analog pin 15 / Digital pin 69 |
| 83         | PK6 ( ADC14/PCINT22 )    | Analog pin 14 / Digital pin 68 |
| 84         | PK5 ( ADC13/PCINT21 )    | Analog pin 13 / Digital pin 67 |
| 85         | PK4 ( ADC12/PCINT20 )    | Analog pin 12 / Digital pin 66 |
| 86         | PK3 ( ADC11/PCINT19 )    | Analog pin 11 / Digital pin 65 |
| 87         | PK2 ( ADC10/PCINT18 )    | Analog pin 10 / Digital pin 64 |
| 88         | PK1 ( ADC9/PCINT17 )     | Analog pin 9  / Digital pin 63 |
| 89         | PK0 ( ADC8/PCINT16 )     | Analog pin 8  / Digital pin 62 |
| 90         | PF7 ( ADC7/TDI )         | Analog pin 7  / Digital pin 61 |
| 91         | PF6 ( ADC6/TDO )         | Analog pin 6  / Digital pin 60 |
| 92         | PF5 ( ADC5/TMS )         | Analog pin 5  / Digital pin 59 |
| 93         | PF4 ( ADC4/TCK )         | Analog pin 4  / Digital pin 58 |
| 94         | PF3 ( ADC3 )             | Analog pin 3  / Digital pin 57 |
| 95         | PF2 ( ADC2 )             | Analog pin 2  / Digital pin 56 |
| 96         | PF1 ( ADC1 )             | Analog pin 1  / Digital pin 55 |
| 97         | PF0 ( ADC0 )             | Analog pin 0  / Digital pin 54 |
| 98         | AREF                     | Analog Reference               |
| 99         | GND                      | GND                            |
| 100        | AVCC                     | VCC                            |

Edited 10 time(s). Last edit at 04/27/2026 02:18AM by Dust.
Re: Anet A8+ resurrection - Ramps1.6 on Mega2560
April 28, 2026 09:14AM
Thanks much.
That's exactly the clarification I needed. I have already purchased the new mosfets for 5V input to control the 24V circuits, so I'll stick with that approach for now.
I'll post results as I get them.
Thanks, C.
Sorry, only registered users may post in this forum.

Click here to login