Hi folks!
We’re laying out the Electron and there’s a design question we’d love to have your input on.
The Electron has lots of pins- 18 on each side, 36 in total! We need to name those pins, and think it’s unlikely that we’ll have enough analog pins for all of the A-named pins to actually be analog inputs if we follow the current naming scheme.
The alternative is that we drop the A# = Analog, D# = Digital naming pattern and create a new one. For this new pattern we’ve been thinking about L# = Left side and R# = Right side. It no longer conveys what the pins do, but also avoids misleading people with incorrect information, like where the A-pins aren’t actually analogRead capable.
Oh, and there’s another complication- the GSM module we’re using is quite wide. If you look at the photos of the Electron from the campaign, you’ll see that there’s no space for silkscreen labels for many of the pins. D1-D10 and A1-A10 will ALL be unlabelled, so their names need to be obvious from their neighbors.
To address both these problems we’ll probably be shipping the Electrons with a reference card, so you’ll have an easy way to look up what capabilities each pin has, but we still need to pick the names.
Is there a reason they still can’t be named for what they (normally) do? AnalogRead pins are A#, DACs are DACs, and all others are D#. I don’t think people will have a problem with some D# on the left side of the board.
Reminded me of the line from the original “Odd Couple” movie… “You leave me little notes on my pillow. … “We’re all out of cornflakes. F.U.” Took me three hours to figure out F.U. was Felix Ungar!”
The somewhat counter-intuitive nature of this is outweighed by the fact that the existing pins are 100% backwards compatible with the previous parts.
This way, sketches can run nominally unchanged on all 3 of particle’s devices for the 24 pins closest to the usb connector (e.g. in the same connector footprint.)
I also suggest adding silkscreen in the underside of the PCB if that is at all possible.
We can make pin name compatibility work between the Photon and Electron with a flag/mode in user software, already talking about doing that.
The big downside to doing the A0-A7, then jumping down to A13-A8 is that it’ll actually look like this on the board. That’s a mighty difficult pattern to infer from.
I don’t like the idea of the software compatibility flag that renames pins, in addition to it being one more thing to silently get wrong, you’ll need to also ensure that the other functions also remap, and I think that will very quickly turn into a Gordian knot.
I understand the tricky situation you are in; I fear that there is no perfect solution, just the least bad compromise.
Just a thought for the A but not analog pins (which should also be possible on limited space).
How about shaped solder pads/lands (or silkscreen) - square for digital and circles for analog (maybe diamond for PWM)?
And I agree with @harrisonhjones and @sazp96, there is no need to have all pins of one side exclusive A or D.
Also since all pins can do digital, the D is a somewhat redundant info, but its place might still be used (e.g. for P as PWM) - but the original D0…D7 should still be defined for backward compatibility.
For backward compatibility I’m also thinking: "How will the underlaying (Arduino style) numbering be handled?"
Since some of the Core/Photon samples rely on the fact that Dx = x and Ax = Dx+10, this logic would break with D10…D13.
AD for sure! LR is not useful, you will need to look what is L1 in documentation. However if you see A1 you directly know it is an analog input channel.
for any solution you come up with please duplicate it on the back of the board. In this way if you wonder you could pop it out from the breadboard and read the backside instead of finding a reference card that is inevitably going to get lost.
This is especially important in the beginning of learning so once you decide to solder a unit into a product you have hopefully graduated from this.