When you're not familiar with the eagle library format, you're tempted to stick to what you get for standard
and what you can fit afterwards. But the eagle library format is quite simple. This contradicts certain online
tutorials.
An Eagle library consists of three factors:
in that order. Let's draw an analogy here. Let's assume electricity is like chemistry. The symbols in a
library are the atoms. The devices are the molecules, made up by combining symbols. The packages are the
crystal structures, lattices, in which the molecules are stored.
The Eagle library editor makes distinction between these three. Symbols are stored in the library as .sym
entities. Packages are stored as .pkg entities. And devices are .dev entities. In the next section I will
guide you through a first new part for our own library.
For the record, I downloaded zilog.lbr from the CADSOFT.de download site.
When you run with a Linux system, chances are you installed the eagle software in /opt/eagle. Which means that
you cannot write new libraries and library parts. So it is a good idea to make a 'libs' directory inside your
eagle projects directory. In this directory you create a 'custom.lbr' library. In it, you keep the parts you
use most, or the parts you borrowed from other people's libraries. Suppose a finnish student wrote a nice lbr
file but for you, only two components are useful. So why keep the full lbr? Eagle offers a method to do just
that: keep what you need in a place where you can change it and discard the rest.
The power of Eagle is in the command line window. When making pcb boards, it is very convenient to be able to
type
show clk
so Eagle highlights the copper traces with that netname. Also,
ripup gnd
is very convenient. This command line property shows that Eagle has more inherited from Unix or DOS than from
Windows. The command line enables you to get things done in a fast, friendly and reliable way.
To get a custom library, do as follows:
- start eagle
- from the eagle commander issue 'File', 'New', 'Library'
- the name of the new library will be 'custom'; eagle adds the lbr extension automatically
- switch to the new window, the library editor
- in the command line bar enter: copy z80dart@zilog
- save and exit the library editor
You now have created your own personal library that keeps one copy of one part. A part that can be edited and
saved. But you need to 'use' the library first, as explained below. Still, if there are parts you need a lot,
but which are required in a slightly changed form, this is the way to go. To enable a library to be used, do
as follows
- open ANY schematic
- click on 'Library', 'Use'
- select your /home/user directory
- select the eagle library directory
- select the custom.lbr file
Done. Your custom library is now ready to be used.
The Sparkfun tutorial guides you through the process of creating a private part from scratch. That is not my
intention. There are so many building blocks to use, that it is a waste to reinvent the wheel. So I will
'borrow' a part from an existing library and change and extend it. When you can do this kind of thing,
creating new parts is a lot easier. Start the eagle commander. Then:
- File, New, Library
-
in the library window:
- File
- save as
- your home dir
- your eagle libs dir
- the name
(in my case /home/jan/eagle/libs/nssbc.lbr
-
in the command line window enter:
- copy z80dart@zilog
- rename z80dart z8530scc
you are now editing the z8530scc.dev part. On the left is the part, topright is the package. Bottom right is
the list with packages.
- Tap the mouse in the 'Variant' field (now contains a single double quote)
- Press Right Mouse Button
- Enter a new name, like 'dip'
- click on the 'IC' button (second menubar, 5th from the left)
- choose dip40. is this the package? if so, we're done
- click on the 'and' symbol (sixth from the left). choose z80dart.
- in the command line window:
rename z80dart z8530scc
You are now editing the z8530scc.sym symbol. The databus is ok. So we leave it like this. But RESET, M1, IORQ
are not in the SCC. So we're gonna give them another name:
- choose the 'name' button and select the pin M1; new name = INTACK
- select pin IORQ. new name = WR
- select pin RESET. new name = QQ
- now select 'move' and move QQ to somewhere outside the package
- new left side pin sequence is:
- DATABUS
- space
- CE
- RD
- WR
- B/A
- C/D
- space
- INTACK
- INT
- IEI
- IEO
- space
- CLK
- now pick the VCC pin, mirror it and put it between CLK and GND
-
Now we're going to redo the serial channels. The new names (and sequence) are:
- TXDA
- RXDA
- TRXCA
- RTXCA
- SYNCA
- W/REQA
- DTR/REQA
- RTSA
- CTSA
- DCDA
and the same for the B channel
-
The DART uses 'RIA' and 'RIB'. They become 'SYNCA' and 'SYNCB'. Regroup and rename the pins. The QQ will become
'RTXCB'
That's it! Now switch back to 'device' (fourth from the left, 4 'and' tokens in a box). Choose the SCC. You
now see the new pins in the package. But most of the pin numbers are wrong. So we'll fix this.
- select dip40
- press 'connect'; a window pops up with three columns
- pin name
- pin number
- established connections
- B/A is on 34 so that's fine
- But C/D is on 32, not on 33. So put the cursor on that line and press 'disconnect'
-
Repeat this for CE, CTSB, DCDB, DTR/REQB, IEI, IEO, RD, RTSB, RTXCA, RTXCB, RXDA, RXDB, TRXCA, TRXCB, TXDB,
WR
- Now reconnect pins:
- Select pin name 'C/D'
- select pad name '32'
- press 'connect'
The pin name/number combination is transfered from the leftmost columns to the rightmost column.
-
Repeat this for the other pins:
- CE = 33
- CTSB = 22
- DCDB = 21
- DTR/REQB = 24
- IEI = 7
- IEO = 6
- RD = 36
- RTSB = 23
- RTXCA = 12
- RTXCB = 28
- RXDA = 13
- RXDB = 27
- TRXCA = 14
- TRXCB = 26
- TXDB = 25
- WR = 35
Click OK
Done. Now go back to the symbol editor.
- Enable layer 93
- Press the wrench
- Select 'direction' and 'i/o'
- SYNCA, SYNCB, TRXCA, TRXCB are I/O's
- The rest is ok
- Turn off layer 93
The SCC is now done. But we might as well create a version for the PLCC44 package:
- In the command window enter:
- copy s44@plcc-socket
- rename s44 plcc44
- go to the device editor; choose Z8530SCC
- Click on 'new' (bottom right)
- choose 'PLCC44', 'OK'
- change the 'Variant' to 'PLCC'
- make sure PLCC is highlighted
- now click on 'connect'
-
The by now familiar window is opened and you can select names and numbers to connect them. Just go ahead.
When done, click OK and you're done.
- 'File', 'Save File', 'Close'
You have a library now with two private parts :0) Now go use them:
- open a schematic editor
- choose 'Library', 'Use', 'username', 'eagle', 'libs', 'nssbc'
- click on
- 'add part'
- choose library nssbc
- select 8530
- select dip40 version
and you are placing a Z8530 SCC in your circuit.
Congratulations. You're a pro now!
In the mean time I have added several other parts to the nssbc library. And improved others. The major
improvement made, was splitting off the Power/Ground pins from each package and adding a PWRGND symbol in
each device. This results in a lower pin count for each component. The parts added were:
- Z80 PIO (DIP, PLCC, QFP)
- Z80 CPU (DIP, PLCC, QFP)
- Z80 KIO (PLCC, QFP)
- 4 Megabit Flash ROM (PLCC)
Page created on 16 April 2011 and
Page equipped with SEO technology