Adding new library to KiCad and SKiDL

Hi,
can someone please help!
I need to use the device ATMEGA328P_PU in sKiDL
This doesn’t exist in standard library
I found https://github.com/LuisDiazUgena/Kicad-Libs
which includes the required device.
I’ve installed the library in KiCad as per the procedure here:-
https://www.accelerated-designs.com/help/KiCad_Library.html
when I search for ATMEGA328P_PU
it doesn’t find it.
I’ve also tried modifying the path variable in SKiDL and that doesn’t work either.

Many thanks.

Mo.

I downloaded the library and placed it in a temporary directory.

Then I appended that directory to lib_search_paths[KICAD].

When I ran search('ATMEGA328P_PU'), nothing was found.

So I went to the library directory and ran grep -ri ATMEGA328 .. The only file that came up was ATMEGA328P-PU.kicad_mod. That’s a footprint file, not a schematic library.

SKiDL only works with schematic library parts. The only place footprints are used is to associate a footprint with a schematic symbol. That’s why SKiDL doesn’t find the part.

While looking at this problem, I found an error in the library search code. I fixed that and bumped SKiDL up to version 0.0.13.

1 Like

Hi,
Ok, I think I understand, but am I not correct in thinking that one
would need both, the schematic and footprint to be able to use it in
KiCad?
I’m afraid I don’t know enough about schematic symbols and footprint
to generate one myself yet.
So the alternative I thought of is just use a dil32 socket instead of
the ATMEGA328P_PU.

So to test out if I could get this to work in SKiDL, I modified the following:-

from skidl import *

gnd = Net(‘GND’) # Ground reference.
vin = Net(‘VI’) # Input voltage to the divider.
vout = Net(‘VO’) # Output voltage from the divider.

resistor = Part(‘device’, ‘R’, TEMPLATE) # Resistor template
dil32 = Part(‘conn.lib’, ‘dil32’, TEMPLATE) # Dil32 template

r1 = resistor(1)
r2 = resistor(1)
d1 = dil32(1)

r1.value, r1.footprint = ‘1K’, ‘Resistors_SMD:R_0805’ # Set resistor values
r2.value, r2.footprint = ‘500’, ‘Resistors_SMD:R_0805’ # Set resistor values

r1[1] += vin # Connect the input to the first resistor.
r2[2] += gnd # Connect the second resistor to ground.
vout += r1[2], r2[1] # Output comes from the connection of the two resistors.

d1[1] += r1[1] # connect the input pin of r1 to pin 1 of IC socket
d1[2] += r2[1] # connect the GND pin of r2 to pin 2 of IC socket
d1[3] += vout \ connect vout to pin 3 of IC socket
d1[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]
+= NC \ mark remaining pins on IC socket Not Used

ERC() # Look for rule violations.
generate_netlist() # Generate netlist file.

The error I get is that I haven’t specified the footprint for dil32,
from where can I get this information?
NOTE; I am blind and I can’t access this information using KiCad. I’ve
tried looking in the KiCad directory in the modules folder and can’t
find anything to do with dil32. I did find conn.lib but that appears
gibberish in a text editor.

Many thanks.

KND RGS

Mo.

You seem to be a bit confused about symbols vs footprints.
Here a post i made some time ago about this aspect of kicad.

In kicad footprints (at least in the official lib) have a generic name. (Example: Housings_DIP:DIP-32_W15.24mm which would fit your dip-32 symbol)
This means you need to know the name of the package your component uses.

Another problem you might face is that kicad by default has no locally installed footprints. It uses the github plugin to download footprints everytime it needs them. (This is why your modules directory is empty.)
To setup local footprint libs follow the tutorial by @bobc

Most symbols in the official lib should either have a footprint pre assigned or at least have footprint filters set in such a way as to make it easy to assign a footprint using cvpcb. (Should help you when searching for the correct footprint.)

Hi, Mo. I edited your example to remove the error by adding a footprint parameter to the dil32 part instantiation:

from skidl import *

gnd = Net('GND') # Ground reference.
vin = Net('VI') # Input voltage to the divider.
vout = Net('VO') # Output voltage from the divider.

resistor = Part('device', 'R', TEMPLATE) # Resistor template
dil32 = Part('conn.lib', 'dil32', TEMPLATE, footprint='Housings_DIP:DIP-32_W15.24mm_Socket') # Dil32 template

r1 = resistor(1)
r2 = resistor(1)
d1 = dil32(1)

r1.value, r1.footprint = '1K', 'Resistors_SMD:R_0805' # Set resistor values
r2.value, r2.footprint = '500', 'Resistors_SMD:R_0805' # Set resistor values

r1[1] += vin # Connect the input to the first resistor.
r2[2] += gnd # Connect the second resistor to ground.
vout += r1[2], r2[1] # Output comes from the connection of the two resistors.

d1[1] += r1[1] # connect the input pin of r1 to pin 1 of IC socket
d1[2] += r2[1] # connect the GND pin of r2 to pin 2 of IC socket
d1[3] += vout # connect vout to pin 3 of IC socket
d1[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32] += NC # mark remaining pins on IC socket Not Used

ERC() # Look for rule violations.
generate_netlist() # Generate netlist file.

The way I determined the string I assigned to the footprint parameter was to open the KiCad footprint editor and find a library (Housings_DIP) that contained a 32-pin DIP socket(DIP-32_W15.24mm_Socket). Then I placed the library and footprint names separated by a colon into the part instantiation. KiCad used to have a stand-alone utility called Cvpcb that would help you associate a footprint with a part, but that seems to have been integrated into EESCHEMA, now.