Welcome! Log In Create A New Profile

Advanced

Simple Command line through pins (Ramps 1.4)

Posted by CDorn 
Simple Command line through pins (Ramps 1.4)
October 06, 2021 03:42AM
Hello there,

I have a question, I cant seem to find an answer to. Is it possible to send a simple command through the ramps 1.4 board pins? For example, turn the fan on/off with the m105 command (iirc).
What I want to do is use a micro controller that externally is conected to the Ramps1.4 board and that sends simple G-Code lines. Nothing fancy. Just one or two lines. Is that possible?
VDX
Re: Simple Command line through pins (Ramps 1.4)
October 06, 2021 06:08AM
... G-Code is sent per serial connection - so you have to establish a second serial port.

For "simple pin-handshake" you have to setup specific routines, which will read/set the pins and react accordingly on both - Marlin and the external µC ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Simple Command line through pins (Ramps 1.4)
October 06, 2021 06:46AM
Thanks for the answer. With simle I meant the command line i want to be read, not the problem at hand smiling smiley.

Could you point me in a right direction please? Has someone done such a thing already, that you know of?

There has been the "Wifi ESP3D" tutorial. In that only the external micro controller had to be programmed. Not marlin (I think). So it must be possible. But that tutorial is a complete overkill for what I need, unfortunatly.
Re: Simple Command line through pins (Ramps 1.4)
October 06, 2021 08:49AM
What I think you asking is can you trigger a g-code from a IO pins?

The answer is yes

Take a look at CUSTOM_USER_BUTTONS in Configuration_adv.h

A simple button can trigger a gcode, or another micro can toggle the io line and trigger it
Re: Simple Command line through pins (Ramps 1.4)
October 08, 2021 04:53AM
I think thats it.
I'll look into that (today/tomorrow) and give feedback.

Thank you very much and have a nice day!
Re: Simple Command line through pins (Ramps 1.4)
October 26, 2021 08:08AM
Hello Again,

So far so good. The CUSTOM_USER_BUTTONS work when I use it manually with jumper cables.

But if I connect them to a Microcontroller they dont work anymore.

My configuration is as follows:
In Marlin I changed two of the Pins on the Ramps board to be NO (normally open).
One pin is for activating the Fan (m106 s255) the other to turn it off (m107).
Then I connected a microcontroller to those pins (digital). So far so good,

Here is the problem though. When I pull the MC-pin (for activating the fans) HIGH, the fans activate, until the pin is pulled LOW. When that happens, the fan jumps between a on or off state.

I really dont know how to fix this..

What would be the best method to activate the CUSTON_USER_BUTTON?
Re: Simple Command line through pins (Ramps 1.4)
October 26, 2021 10:02AM
Did you connect the GNDs of the two controllers together?
They both need to have a common shared GND to work properly.
Re: Simple Command line through pins (Ramps 1.4)
October 27, 2021 07:04AM
I didnt, I will try that out.
Thanks for the quick reply smiling smiley
Re: Simple Command line through pins (Ramps 1.4)
October 28, 2021 04:25AM
So just to be sure.
Should I connect the GND of the microcontroller to a GND pin on the Ramps1.4 board, or rather connect it to the calbe that also grounds the Ramps1.4 board?
Or does that make no diffrence?
Sorry, only registered users may post in this forum.

Click here to login