Welcome! Log In Create A New Profile

Advanced

how can I use pins D0 and D1

Posted by leadinglights 
how can I use pins D0 and D1
August 17, 2020 11:42AM
I would like to use the AUX-1 connector on a RAMPS1.4 to power a device for which I will need two logic level outputs and one logic input. D57 on this connector works as expected with M42 P57 S255 setting the output high and M42 P57 S0 clearing this pin - D58 also works as expected but D0 and D1 both seem to be stuck on outputs at 5V.

Firmware is Repetier 0.92.9. Any thoughts on how to use these pins? If either can be set as an input that would also be good

Mike
VDX
Re: how can I use pins D0 and D1
August 17, 2020 01:28PM
... are this pins marked as "used"? -- then they're not accessible with M42.

You can "free" them in the firmware, if not used otherwise ... or apply other unused ones ...


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: how can I use pins D0 and D1
August 17, 2020 02:35PM
I am not sure what you mean by "used", but there is no other physical connection tracing back to the MCU - details below. Can you give any hints on how to free them in the firmware?

While I could find other pins, I would like to avoid having wires going to different connectors - AUX4 is already used for the manual controls/LCD and AUX3 is fully occupied with an SD reader, AUX2 feeds two piezo probe controllers and part of the SERVO block is used for a vacustat.

On the RAMPS board, D0 on AUX1 traces back to pin 0 of the communication block which traces to pin 2, PE1(RXD0PCIN8) of the MCU on the Arduino ATMEGA2560 board. In the same way, D1 traces to PE0(TXD0) on the MCU. Neither is connected to any other component or device.

Thanks,

Mike
VDX
Re: how can I use pins D0 and D1
August 17, 2020 04:25PM
... normally the D0/D1 are used for USB communication.

"used" pins are the named pins in the config (normally stepper, temp and extruder pins), so the firmware protects them from user actions like M42 ...


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: how can I use pins D0 and D1
August 17, 2020 09:23PM
D0/D1 is RX0/TX0. these is connected to your serial to usb chip can only be used if SERIAL_PORT and SERIAL_PORT_2 is not set to 0. (ie you disable USB communications)
Re: how can I use pins D0 and D1
August 18, 2020 09:22AM
Thank you both. I had been looking at a schematic of the Arduino Mega2560 which was missing the far right-hand side.



The missing bit shows that PE0 and PE1 (D0 and D1) are connected to M8TXD and M8RXD on the USB MCU.

EDIT: I have managed to move some ports about and have avoided having devices connected to multiple plugs so all is well.

Mike

Edited 1 time(s). Last edit at 08/18/2020 12:58PM by leadinglights.
Sorry, only registered users may post in this forum.

Click here to login