One of the most annoying parts of PCB design is definitely creating all the schematic
libraries. To make this task easier, I decided to at least partially automate
the extraction of pinouts from datasheets. As more complex MCUs can have over
a hundred pins, this can speed up the time it takes to build the symbol considerably.
1. Extract the pinout table from the datasheet
There are multiple tools which are able to do this, I personally use Tabula.
Note: For ST datasheets, select “lattice” as the extraction method
From the table in the datasheet, Tabula produces .csv, which after some cleanup
looks like this:
2. Generate KiCad .lib
For this part I wrote a small python library
which is capable of generating KiCad .lib files. There is a generic
script in the
repository, which kind of works as long as the input .csv is reasonably formatted.
If the script is not good enough (as in the STM32F7 case, where the pins need
to be split by banks), the library can be quite easily used directly:
This produces nicer results and needs much less further work in the editor.
3. Build the footprint
Now we can open the .lib in KiCad eeschema library editor and build the footprint
from the imported pins.
After some rearranging, the parts are ready to be used: