Welcome! Log In Create A New Profile

Advanced

Pin define for RAMPS

Posted by hennenzac 
Pin define for RAMPS
January 26, 2016 10:40AM
Hello,

I have been wanting to use some of the AUX on my RAMPS board, but how do I know how the pins are configured? Whether they are an input or an output? Whether an internal pullup is enabled? If there is a good website or just knowing which file to look at in the Marlin would be appreciated.

Thanks.


Printer: Makerfarm Prusa I3 6"
Nozzle: 0.5mm Jhead
Filament: 3mm
3D CAD: Creo Elements/Direct Modeling Express
Slicer: Cura
Printer Interface: Pronterface
Re: Pin define for RAMPS
January 26, 2016 05:41PM
Pretty much, all of the GPIO (General Purpose I/O) pins can be configured as either input or output. And when configured as input, you can specify if you want a pull up resistor turned on for them.

Download the specification for your processor. All of this is detailed in great detail in the specification.
Re: Pin define for RAMPS
February 02, 2016 12:10AM
I'm assuming though, that the pins are already defined with or without pullups in the Marlin software somewhere? I was hoping someone could just point me in the general direction. I found where they define what pins are in ramps ex) #define FAN_PIN 8, but where do they define it as an input or output, pullup or not pullup? I know coding somewhat and as far as i know #define just renames a number to a name.
Re: Pin define for RAMPS
February 02, 2016 08:09AM
> I found where they define what pins are in ramps ex) #define FAN_PIN 8, but where do they define it as an input or output, pullup or not pullup?

I am out of town and can't do the search. But search for where FAN_PIN is referenced in the code base. (Ignoring all the various definitions in the Pins.h files) You will find how it gets setup and how it is used.
Re: Pin define for RAMPS
February 06, 2016 08:45AM
Hennezac,
Could I guess that you are looking at hooking up a fan for PWM?

This might be what you are looking for.

#if MB(RAMPS_13_EFcool smiley || MB(RAMPS_13_EFF) || MB(AZTEEG_X3) || MB(AZTEEG_X3_PRO)
#define FAN_PIN 4 // (Sprinter config)
#else
#define FAN_PIN 4 // IO pin. Buffer needed
#endif

It's from pins.h, line #658. I believe, I did this a longgg time ago, is where I changed the pin assign for
my fan so it could be temp controlled but connected to the FETs. The total amount of coding
was simply to change the value for the pin.
I assumed,at the time, everything was setup as outputs with 4k7 pullups. Nothing has blown up so far with
that assumption.

Hope this helps,
Andrew
Sorry, only registered users may post in this forum.

Click here to login