Alarm-Siren / arduino-kicad-library

KiCad Symbol & Footprint Library for Arduino Modules (Shields, Sockets and Tiles)
Creative Commons Attribution Share Alike 4.0 International
351 stars 105 forks source link

Added symbol for Nano RP2040 Connect. #95

Open djpearman opened 1 year ago

djpearman commented 1 year ago

Hi,

I added a symbol for the Arduino Nano RP2040 Connect based on the Arduino_Nano_v2.x of the official Kicad MCU_module library. So it uses pin numbers and is compatible with the Arduino_Nano footprint of the Kicad library.

It passes the check of the check_symbol of the Kicad library utils.

Perhaps this is one small step towards #91 .

I use Kicad 7.0.7, which seems to have modified several properties of the other symbols in the library, hence why the commit is kinda large. The added content starts at line 6828.

Feedback welcome!

Best regards, djpearman

djpearman commented 1 year ago

Hi Alarm-Siren,

Thanks for your feedback! Here my thoughts and responses:

  1. Pin 27, VUSB: This pin can be 'activated' by adding a solder bridge between two pads on the underside, so I figured it would useful to cover that use case by granting the ability to connect to it. While it is unconnected by default, setting the pin as such would forego that option. I have not used it myself, so I have no issue setting it as unconnected. Perhaps setting 'passive' would be most accurate?
  2. Pin 3, ~RESET: I assume you are referring to this pin being connected to a pull up resistor as well as a pushbutton to ground and thus representing a sort of open collector output, though it is also an input to the RP2040. True, it is a bit of an oddity :) I will change the pin to OC.
  3. A6, A7: Do you have a source for this? Neither the datasheet nor the pinout document declare them as input only. The latter gives their alternate function as GPIO, albeit on the NINA WS102. Is there a limitation in software that does not allow them to function as outputs? So far, I have not used these pins, so I have ignored them.
  4. REC: I had originally labelled it ~QSPI_CSn/REC, but for some reason dropped the REC part. I'll rename it to REC in line with the datasheet.
  5. Pin 18, REF: This pin is labelled REF in the datasheet and I go with datasheet content when there are inconsistencies (which was drilled into me at my last place of employment). Despite it being not connected, the pinouts still list it and call it AREF, so I have no qualms renaming it to that. As for visibility, upon reflection I agree that unhiding it is better.
  6. Pin 19, A0: I just checked and there is no DAC on this pin. This seems to be a remnant from when I was using the Nano 33 BLE, so I will remove the DAC0 part.
  7. Force of habit mainly, since the datasheet is linked for most components. The only real reason I have for linking the datasheet is to clarify the document used in the case of inconsistencies in the information provided (as for 5. for example). For modules like this, I tend to agree that it is better to link the product page, so I will change it.
  8. No, I had not put much thought into which footprint to set as default other than it being in the official Kicad library making it more 'mainstream'. I agree that it would be better to set a footprint from this library as default, so I will do that.
  9. Ok.
  10. This is probably the point requiring most discussion and so I'll break it into separate aspects to ease discussion. 10a. Symbol to Footprint linking: While I appreciate the newbie friendliness of your current approach and it is by no means forbidden, this does result in a lot of symbols. In my opinion, this makes it harder to use as well as maintain the library and does not scale well. For example, adding both tile and socket footprints without mounting holes (as is the case for the one I added) would bloat the library to four symbols per board. In addition, the in many cases already long names would become even harder to read. The two step process of selecting symbol then footprint slims the symbol library by decoupling the two choices and should not asking too much of someone attempting to design electronics. However, I only feel moderately strongly on this point :) 10b. Pin designators: As far as I can tell, you have set pin numbers to be the same as their names. What is your rationale behind this? A consequence is footprints being specific to one or few symbols despite being potentially compatible to multiple, e.g. for the Arduino Nano series. While requiring a decent amount of effort, switching to pin numbers would slim down the number of essentially duplicate footprints and allow ones from the official library to be used as well if desired. In addition, adding footprints with small variations, such as without mounting holes, makes them available to all. On this aspect, I urge you quite strongly to consider switching. 10c. Backwards compatibility: I am fully aware that these changes entail significant breakages to existing projects and will likely cause considerable dissatisfaction among users of your library. As such, I very much appreciate the gravity of these points and there will be no hard feelings whatsoever if you decide to stick with the current approach. On the other hand, I do think it would be beneficial to this library. No pain, no gain I guess :)

An additional more detailed observation:

  1. Location of tile/SMD pads: In the Arduino Nano tile footprints that I checked, the pads are placed about 1mm farther out than in the one I have submitted. What is your reason for this placement? In my case, the pads also cover the circular THT part of the module pad and should in my estimation result in better soldering, but am open for other opinions on the matter. I have used this footprint in a design manufactured by a PCB contractor and it worked well.

I look forward to hearing your thoughts!

Best regards, djpearman

Alarm-Siren commented 1 year ago
  1. I think for consistency it should definitely be Unconnected. I did a comprehensive review of power pins and what they should be set to back in #65 and I'm keeping to the methodology I employed there. Basically, every pin should be setup in the symbol as it is 'out of the box' for the module. Advanced users who want to modify their module to enable additional functionality, will also be sufficiently advanced to modify the symbol or footprint if need be. In any case, setting a pin to Unconnected doesn't actually stop you from connecting a net to it, it just means the DRC will moan, which I would argue is exactly the behaviour we want here. By default, it will moan at you for doing something you probably didn't mean to do - but if you really know what you're doing and have connected the VUSB bridge pads you can safely ignore the DRC warning.

  2. You're quite right. On some of the other Nano modules A6 and A7 really are input only, I guess I just assumed it would be on this one too since it follows the same footprint layout. I've raised a seperate issue #96 so that it doesn't get forgotten. I should probably review all the Nanos in case I've made the same mistake on others.

10a. Yes, I do see your logic on being able to support a greater variety of footprints per symbol. And adding footprints that lack the mounting holes would be a nice addition.

10b. Basically I used the "pin numbers" that Arduino themselves use; especially as for some of the footprints it isn't particularly obvious how they should be numbered if one were to use only numbers. On the Nano footprints, you can take the D0/D1 corner as 'pin 1' and number around as if it were a DIP chip, but for, say, the Arduino Uno or Mega? How on earth do you number those in a consistent manner? Any assignment of numbers would be completely arbitrary... so why not give the pins the names Arduino themselves use? I also found that it made it easier when cross-checking between footprints and symbols to make sure I've linked the right Symbol pins to the right Footprint pins. I'm open to the idea of using pin numbers, instead of pin names as now, I'm just not convinced that the change would add anything (except the ability to use the built-in footprints if desired, but as there's only three of them and I provide a complete set anyway, that doesn't seem like a huge advantage). On the issue of footprints being too specific, I always recycle footprints whenever possible, however the difference is usually not the pinouts but some other aspect. For example, the difference between the M0 Pro footprint and the Leonardo footprint is that the latter includes a courtyard area for the 2nd USB connector that isn't present on the Leonardo. The two footprints are otherwise identical, including pinouts. Similarly, I'm well aware that both KLC and IPC say that pin 1 should be the only square pad, and pin 1 should be marked in silkscreen, however because it wouldn't always be obvious what should be pin 1, I instead made an Executive Decision to set all GND pins to be square and mark Pin D0 in silkscreen as I feel they're both more universal reference points for orientation of these modules than whatever I might arbitrarily decide is pin 1.

10c. Indeed, but as previously mentioned, if one is going to make big changes v5 is the time to do them. Major version change and all that.

  1. To be fair, I could ask the same of you! But in all seriousness, I based the SMD pad locations on the edge of the module, such that the inner semi-circle of the pad should exactly line up with the semi-circle on the module above it, but with some extra on the outer-side. My hope was that this would give sufficient space for easy hand soldering of the SMD pads, which I know can be difficult with small pads especially for a novice. However, if the suggestion in 10a is implemented I see no reason why one couldn't offer both variations - indeed, the Kicad standard library itself offers 'standard' and 'HandSoldering' variants of some SMD parts already, the latter having extended pads. I'm also not against extending the pads back toward the THT holes if this would give superior results.
djpearman commented 1 year ago
  1. Done, changed VUSB to unconnected.

10b. Yes, I wholeheartedly agree that deciding on a numbering scheme for pins is not a straightforward task, especially with footprints that have no clear pin ordering in their footprints. At the end of the day, any choice is going to be somewhat arbitrary (and the Arduino Nano datasheets are unfortunately a case in point in terms of inconsistencies that may arise...). The approach of setting pin numbers to their assigned names may require less effort initially, but foregoing the benefits, where possible, of reusing identical footprints that assigning separate numbers and names to individual pins provides is likely to cause problems in future. While defining pin numbers may be a PITA for the likes of Uno or Mega boards, the comparative simplicity of MKR and Nano board makes it a lot easier and once a definition has been made, the addition of further boards using the same footprints becomes a matter of creating a symbol with appropriate footprint filters. Likewise, the addition of compatible footprints, e.g. without mounting holes, merely requires appropriate naming to become usable for all relevant modules. Of course, the outline differences you mention would have to be taken into consideration. Perhaps it would be acceptable to switch only boards with simple footprints and outlines and leave the other as they are. Admittedly, that basically limits it to the Nano boards and creates an inconsistency within the library, which isn't all that desirable.

  1. The placement of the SMD pads in my case is chosen so that they cover the whole area below the castellated pad, so that it extends beneath the through hole portion, too. The castellated pads of the module make it quite easy to hand solder, since it flow nicely into the semi-circular portion, and not much pad area is needed outside it. In your case, the pads only cover the outer part, leaving the area under the through hole portion bare. While this is will work and shouldn't cause any immediate problems (unless someone places copper traces without solder mask in those areas), I think having pads cover the whole area beneath the boards pins is a cleaner design.

Ultimately, you are library owner and it is up to you to make the decisions. I am merely wishing to share some of the experience I have gained in designing electronics and hope to learn through having my thoughts scrutinzed.

Alarm-Siren commented 1 year ago

I am merely wishing to share some of the experience I have gained in designing electronics and hope to learn through having my thoughts scrutinzed.

And your thoughts and inputs are most welcome! In all the years I have maintained this library, I've never had anyone engage with me on this level, so it is valuable to me to have insight into how it can be improved by actual users.

djpearman commented 12 months ago

Just wondering if there is any further input required from my end on this PR after your approval? I am not able to merge since I don't have write access.

Alarm-Siren commented 12 months ago

No nothing needed from you, sorry I've just been busy. Its slightly complicated because I want to put out 4.2.1 first (to fix the #96 bug), update the library to the latest kicad version, then merge this into that to create the 5.0.0 baseline that I will then work on finishing #91 within. I just haven't had the time to do all that yet, especially as the release process for a kicad package is.... non-trivial.