Welcome! Log In Create A New Profile

Advanced

M42 Pins

Posted by ElmoC 
M42 Pins
September 04, 2016 03:56PM
I was looking at using the M42 command to be able to control some external devices and was wanting to verify the pin numbers. The entry for M42 in the Wiki (http://reprap.org/wiki/G-code#M42:_Switch_I.2FO_pin) lists pins, but the names don't match the pin names on the Duet 0.8.5 board. In addition, it lists pins 52, 66, and 67, but the expansion connector only has 50 pins. I'm guessing the pin numbers in that entry are correct, it is just the names that don't match.
VDX
Re: M42 Pins
September 04, 2016 06:26PM
... AFAIK pin numbers above 50 are linked to the Analog pins ...


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: M42 Pins
September 04, 2016 06:29PM
Quote
VDX
... AFAIK pin numbers above 50 are linked to the Analog pins ...

But where are they on the board?
VDX
Re: M42 Pins
September 04, 2016 06:59PM
... the Pins A0 to A11 are "digitally" numbered as 54 to 65

A0 = 54
A1 = 55
...
A10 = 64
A11 = 65


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: M42 Pins
September 04, 2016 07:23PM
Quote
VDX
... the Pins A0 to A11 are "digitally" numbered as 54 to 65

A0 = 54
A1 = 55
...
A10 = 64
A11 = 65

That still doesn't answer where on the board they are located so I can connect to them. Say I wanted to control '66 AD13'. Where on the board would I connect to?
PRZ
Re: M42 Pins
September 04, 2016 07:55PM
Pinout of the expansion connector is defined here : [reprap.org]

Note that pin names refer to the Arduino Due pin naming, which may sometimes help.

[edit] here Arduino Due pins schematic. The ref are the gray one : [www.robgray.com]
Duet do have pins which don't exists on Arduino Due, hence the 'X' pins.
Note there are a few differences between Duet 0.6 and Duet 0.8.5. Duet WiFi is another story.

Edited 3 time(s). Last edit at 09/04/2016 08:02PM by PRZ.


Pierre

- Safety [reprap.org]
- Embedded help system for Duet and RepRap Firmware [forums.reprap.org]
- Enclosed delta printers Lily [rouzeau.net] and Lily Big [rouzeau.net]
- OpenScad delta printer simulator [github.com]
- 3D printing on my site [www.rouzeau.net]
Re: M42 Pins
September 04, 2016 08:14PM
Quote
PRZ
Pinout of the expansion connector is defined here : [reprap.org]

Note that pin names refer to the Arduino Due pin naming, which may sometimes help.

[edit] here Arduino Due pins schematic. The ref are the gray one : [www.robgray.com]
Duet do have pins which don't exists on Arduino Due, hence the 'X' pins.
Note there are a few differences between Duet 0.6 and Duet 0.8.5. Duet WiFi is another story.

Okay. I think I have it figured out. While the Wiki says, "On Duet hardware, the supported pin numbers and their names on the expansion connector are:
16 TXD1, 17 RXD1, 18 TXD0, 19 RXD0, 20 TWD1, 21 TWCK1, 23 RTS1, 36 PC4_PWML1, 52 AD14, 66 AD13, 67 PB16.", the labels used are not the ones on the Duet Hardware. For example, 67 PB16. On the expansion port, it is pin 32 AD0.

I'm going to see if I might be able to update the Wiki with correct pin numbers and labels for the expansion port.

Edited 1 time(s). Last edit at 09/04/2016 09:15PM by ElmoC.
PRZ
Re: M42 Pins
September 04, 2016 09:14PM
On schematic, PB16 D67 is pin 32, not 34.
What I think (I am not involved in the firmware, but I already tracked pins with difficulties to get them) is that internally in the firmware, the pins have the same numbers as the arduino digital pins, probably because they started to write firmware with Arduino Library. And this was probably also difficult for programmer, as this is Dan Newman who created the pinout page (he ported the RRF firmware on RADDS).

I've tried to make the Pinout page easier to find because it was really a relief when I discover this page, but it seems that this was not so successful.

Edited 1 time(s). Last edit at 09/04/2016 09:17PM by PRZ.


Pierre

- Safety [reprap.org]
- Embedded help system for Duet and RepRap Firmware [forums.reprap.org]
- Enclosed delta printers Lily [rouzeau.net] and Lily Big [rouzeau.net]
- OpenScad delta printer simulator [github.com]
- 3D printing on my site [www.rouzeau.net]
Re: M42 Pins
September 04, 2016 09:15PM
Quote
PRZ
On schematic, PB16 D67 is pin 32, not 34.
What I think (I am not involved in the firmware, but I already tracked pins with difficulties to get them) is that internally in the firmware, the pins have the same numbers as the arduino digital pins, probably because they started to write firmware with Arduino Library. And this was probably also difficult for programmer, as this is Dan Newman which started the pinout page (he ported the RRF firmware on RADDS).

I've tried to make the Pinout page easier to find because it was really a relief when I discover this page, but it seems that this was not so successful.

34 was a typo.
VDX
Re: M42 Pins
September 05, 2016 04:48AM
Quote
ElmoC
Quote
VDX
... the Pins A0 to A11 are "digitally" numbered as 54 to 65

A0 = 54
A1 = 55
...
A10 = 64
A11 = 65

That still doesn't answer where on the board they are located so I can connect to them. Say I wanted to control '66 AD13'. Where on the board would I connect to?

... I don't have the Duet, so was referring to the Due or RADDS-pins, same as in the second link of PRZ's first post - "AD13" is not 66, but 65 and labelled "A11" on the Due ... pin 66 is DAC0 ...

But

Edited 1 time(s). Last edit at 09/05/2016 04:48AM by VDX.


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: M42 Pins
September 05, 2016 04:17PM
What we need is a diagram that maps expansion connector pin numbers to firmware pin numbers. Sadly I can't create that right now as I have several impending deadlines to meet. Any volunteers?



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: M42 Pins
September 05, 2016 04:40PM
I was just about to get started on doing that. Would you be available to review the results?
Re: M42 Pins
September 05, 2016 05:46PM
Okay. I just did a quick spreadsheet that list the expansion port pin to port name and processor pin. So this is what I think is going on...

16 TXD1

TXD1 is on expansion port pin 11, which is PA13, and is on pin 6 of the processor. It seems the 16 is the pin label on a Due board, which really doesn't apply when talking about Duet hardware. So, I'm thinking to change the Wiki to...

10 PA14, 11 TXD1, 12 RXD1, 13 TXD0, 14 RXD0, 18 PC4, 32 PB16, 33 AD1335 TWD1, 36 TWCK1, 41 AD14,

(RTS1 = PA14)

EDIT: The pin numbers listed in the Wiki are the ones the firmware accepts. So the list needs to map those pins to the expansion pin.

Edited 1 time(s). Last edit at 09/05/2016 05:55PM by ElmoC.
Re: M42 Pins
September 05, 2016 06:16PM
Value => Expansion port pin

16 => 11
17 => 12
18 => 13
19 => 14
20 => 35
21 => 36
23 => 10
36 => 18
52 => 41
66 => 33? Not responding
67 => 32

So this is how the numbers in the Wiki maps to the Duet 0.8.5 board. 66 should map to expansion port 33 but I did not see a change on the pin when I tried setting it. It stayed low.
PRZ
Re: M42 Pins
September 05, 2016 09:07PM
I set in bold here the pins accessibles by M42 : [otocoup.com]

From the table, on Duet 0.8.5, the digital pin 66 is not accessible on expansion connector. The AD13 as indicated in the G-code page correspond in fact to the digital pin 65.

On Duet 0.6, digital pin 66 is PB15 (connector pin 31)


Pierre

- Safety [reprap.org]
- Embedded help system for Duet and RepRap Firmware [forums.reprap.org]
- Enclosed delta printers Lily [rouzeau.net] and Lily Big [rouzeau.net]
- OpenScad delta printer simulator [github.com]
- 3D printing on my site [www.rouzeau.net]
Re: M42 Pins
September 05, 2016 10:43PM
So it looks like there is a bug in the firmware. 66 needs to get remapped to 65.
Sorry, only registered users may post in this forum.

Click here to login