Jan Kasprzak | 30 Jan 10:03 2013
Picon

[geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

	Hello,

I use Fedora, and I am not sure whether the following issue should
be reported here or to Fedora bugzilla:

The file /usr/share/gEDA/sym/transistor/mosfet-with-diode-1.sym
from the geda-symbols-1.8.1-1.fc18.noarch package is broken
- the pinnumbers are in fact letters D, G, and S instead of numbers.
The symbol works in gschem, but after running gsch2pcb and opening the result
in pcb, the transistor footprint has no connections in the netlist.
Replacing the pinnumber letters with numbers fixes the problem.

Quick "grep -R pinnumber=[^0-9] /usr/share/gEDA/sym" reveals more files
with non-numeric pinnumbers. So either the symbols should be fixed,
or the gsch2pcb should be fixed to allow non-numeric pinnumbers.

Patch for mosfet-with-diode-1.sym attached (also pinseqs modified to
reflect the common pin numbering of most SOT-23 MOSFETs).

	Thanks,

-Yenya

--- /usr/share/gEDA/sym/transistor/mosfet-with-diode-1.sym	2012-11-13 16:08:29.000000000 +0100
+++ mosfet-with-diode-1.sym	2013-01-29 18:01:27.884176556 +0100
 <at>  <at>  -1,10 +1,10  <at>  <at> 
-v 20031231 1
+v 20121123 2
 P 600 1000 600 800 1 0 0
 {
(Continue reading)

Stefan Salewski | 30 Jan 15:15 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

On Wed, 2013-01-30 at 10:03 +0100, Jan Kasprzak wrote:
> 	Hello,
> 
> I use Fedora, and I am not sure whether the following issue should
> be reported here or to Fedora bugzilla:
> 
> The file /usr/share/gEDA/sym/transistor/mosfet-with-diode-1.sym
> from the geda-symbols-1.8.1-1.fc18.noarch package is broken
> - the pinnumbers are in fact letters D, G, and S instead of numbers.

There is nothing really broken -- for gEDA symbols we have some with
letters for pin names/numbers. These are sort of generic symbols, in
most case for transistors -- the user should replace the letters with
correct numbers for his transistor. It would be possible to let the
letters unchanged, if we use an exactly matched footprint for PCB layout
-- that footprint would have letters too instead of numbers. But then we
would need a really large number of footprints, because of possible
permutations of the letters.

This is something what confused me too when I used gEDA/PCB for the
first time, but there exist no easy solution. You should find
discussions of this problem in in the wike and in this mailing list, or
maybe on in older initial gEDA mailing list. DJ and others have mode
suggestions to solve such kind of problems, some suggestions use a
database to solve it.

Best regards,

Stefan Salewski

(Continue reading)

Kai-Martin Knaak | 31 Jan 02:46 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

Stefan Salewski <mail@...> schrieb am 30. January 2013:

> There is nothing really broken

+1

> the user should replace the letters with
> correct numbers for his transistor. It would be possible to let the
> letters unchanged, if we use an exactly matched footprint for PCB
> layout -- that footprint would have letters too instead of numbers.

I prefer the latter. Manufacturers tend to enumerate pins in data sheets
in different ways. In my experience, letters that refer to actual
function are less prone to misread than digits. In addition, letters
work the same across different packages. TO220, TO247, TO92, TO18,
TO252, D2PAK, SO23, SOT23, etc.

> But then we would need a really large number of footprints, because of
> possible permutations of the letters.

Only some permutations are actually used. Of course, with letters you
have to provide geometrically identical footprints for MOSFETs and
bipolar transistors. On the other hand, there is only one symbol to
cater them all. Seems like this is a case of "pick your poison".

---<)kaimartin(>---
--

-- 
Kai-Martin Knaak
gedau | 31 Jan 04:26 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym


On Wed, 30 Jan 2013, Stefan Salewski wrote:

> This is something what confused me too when I used gEDA/PCB for the
> first time, but there exist no easy solution. You should find
> discussions of this problem in in the wike and in this mailing list, or
> maybe on in older initial gEDA mailing list. DJ and others have mode
> suggestions to solve such kind of problems, some suggestions use a
> database to solve it.

The solution I found easy is my devmap script: I can use the generic 
symbols with letters, then I attach a devmap attribute telling which
actual device and footprint shall be used (e.g. bc817_sot23) and the rest 
is done while converting from gschem to pcb. Actual device maps are plain 
text files that describe attributes to be added/overwritten with a pinmap 
functionality that can replace pin numbers by value (so that pin C becomes 
pin 3). Device maps are easy to write, easy to maintain and VCS friendly. 
Schematics with the above "bc817_sot23" next to the symbol are readable, 
still not overtaxed with extra text.

Levente | 31 Jan 10:19 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

On Thu, Jan 31, 2013 at 4:26 AM, <gedau <at> igor2.repo.hu> wrote:

The solution I found easy is my devmap script: I can use the generic symbols with letters, then I attach a devmap attribute telling which
actual device and footprint shall be used (e.g. bc817_sot23) and the rest is done while converting from gschem to pcb. Actual device maps are plain text files that describe attributes to be added/overwritten with a pinmap functionality that can replace pin numbers by value (so that pin C becomes pin 3). Device maps are easy to write, easy to maintain and VCS friendly. Schematics with the above "bc817_sot23" next to the symbol are readable, still not overtaxed with extra text.

 
+1

I do the same.

Levente
Jan Kasprzak | 31 Jan 11:01 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

gedau@... wrote:
: 
: 
: On Wed, 30 Jan 2013, Stefan Salewski wrote:
: 
: >This is something what confused me too when I used gEDA/PCB for the
: >first time, but there exist no easy solution. You should find
: >discussions of this problem in in the wike and in this mailing list, or
: >maybe on in older initial gEDA mailing list. DJ and others have mode
: >suggestions to solve such kind of problems, some suggestions use a
: >database to solve it.
: 
: 
: The solution I found easy is my devmap script: I can use the generic
: symbols with letters, then I attach a devmap attribute telling which
: actual device and footprint shall be used (e.g. bc817_sot23) and the
: rest is done while converting from gschem to pcb. Actual device maps
: are plain text files that describe attributes to be
: added/overwritten with a pinmap functionality that can replace pin
: numbers by value (so that pin C becomes pin 3). Device maps are easy
: to write, easy to maintain and VCS friendly. Schematics with the
: above "bc817_sot23" next to the symbol are readable, still not
: overtaxed with extra text.

	Interesting. It seems that devmap is not (yet?) packaged for
Fedora. I will have a look at it.

	The other problem is that the whole process (gschem -> gsch2pcb -> pcb)
_silently_ discards the nets with non-numeric pinnumbers. So you start with
a schematics, run gsch2pcb and pcb, and the resulting layout has missing
connections, without _any_ notification that something is wrong.

-Yenya

--

-- 
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| New GPG 4096R/A45477D5 - see http://www.fi.muni.cz/~kas/pgp-rollover.txt |
| http://www.fi.muni.cz/~kas/    Journal: http://www.fi.muni.cz/~kas/blog/ |
Please don't top post and in particular don't attach entire digests to your
mail or we'll all soon be using bittorrent to read the list.     --Alan Cox

gedau | 31 Jan 11:42 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym


On Thu, 31 Jan 2013, Jan Kasprzak wrote:

> gedau@... wrote:
> :
> :
> : On Wed, 30 Jan 2013, Stefan Salewski wrote:
> :
> : >This is something what confused me too when I used gEDA/PCB for the
> : >first time, but there exist no easy solution. You should find
> : >discussions of this problem in in the wike and in this mailing list, or
> : >maybe on in older initial gEDA mailing list. DJ and others have mode
> : >suggestions to solve such kind of problems, some suggestions use a
> : >database to solve it.
> :
> :
> : The solution I found easy is my devmap script: I can use the generic
> : symbols with letters, then I attach a devmap attribute telling which
> : actual device and footprint shall be used (e.g. bc817_sot23) and the
> : rest is done while converting from gschem to pcb. Actual device maps
> : are plain text files that describe attributes to be
> : added/overwritten with a pinmap functionality that can replace pin
> : numbers by value (so that pin C becomes pin 3). Device maps are easy
> : to write, easy to maintain and VCS friendly. Schematics with the
> : above "bc817_sot23" next to the symbol are readable, still not
> : overtaxed with extra text.
>
> 	Interesting. It seems that devmap is not (yet?) packaged for
> Fedora. I will have a look at it.
>

I've packaging scripts for deb, but not for rpm yet. The infrastructure at 
repo.hu is capable of building rpms once the spec file and stuff are in 
place in the repository. If you have a Fedora and find the tool 
useful, a contribution of rpm packaging files is welcome!

Regards,

Tibor

Kai-Martin Knaak | 31 Jan 11:41 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

Jan Kasprzak <kas-0hYGf3jDe+XrBKCeMvbIDA@public.gmane.org> wrote:

> The other problem is that the whole process (gschem -> gsch2pcb ->
>pcb)
>_silently_ discards the nets with non-numeric pinnumbers. So you start
>with
>a schematics, run gsch2pcb and pcb, and the resulting layout has
>missing
>connections, without _any_ notification that something is wrong.
>
Type [o] in pcb and the log window will warn about connections in the netlist for which it can't find pins in the layout.
If you do import schematic from the pcb GUI, there may be a pop-up dialog.
---<)kaimartin (>---
--
Kai-Martin Knaak
email: kmk-G3rIa76UAx2M+VuuqaXKaA@public.gmane.org
öffentlicher PGP-Schlüssel: 0x6C0B9F53

--
Kai-Martin Knaak
email: kmk <at> familieknaak.de
öffentlicher PGP-Schlüssel: 0x6C0B9F53
Peter Clifton | 2 Feb 12:57 2013
Picon
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym


On Thu, 2013-01-31 at 11:01 +0100, Jan Kasprzaka
> 	The other problem is that the whole process (gschem -> gsch2pcb -> pcb)
> _silently_ discards the nets with non-numeric pinnumbers. So you start with
> a schematics, run gsch2pcb and pcb, and the resulting layout has missing
> connections, without _any_ notification that something is wrong.

Can you post a simple test-case for this?  I'm fairly sure this should
NOT be the case. BGA pin-numbers are often along the lines "B23" or
"A10" etc.., and I _think_ "

There is a strangeness with lower-case suffixes on refdes being ignored
(by design - probably misguidedly). I don't recall having ever noticed
it for netnames.

> -Yenya
> 

--

-- 
Peter Clifton <peter.clifton@...>

Clifton Electronics

Jan Kasprzak | 4 Feb 14:19 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

Peter Clifton wrote:
: 
: On Thu, 2013-01-31 at 11:01 +0100, Jan Kasprzaka
: > 	The other problem is that the whole process (gschem -> gsch2pcb -> pcb)
: > _silently_ discards the nets with non-numeric pinnumbers. So you start with
: > a schematics, run gsch2pcb and pcb, and the resulting layout has missing
: > connections, without _any_ notification that something is wrong.
: 
: Can you post a simple test-case for this?  I'm fairly sure this should
: NOT be the case. BGA pin-numbers are often along the lines "B23" or
: "A10" etc.., and I _think_ "
: 
: There is a strangeness with lower-case suffixes on refdes being ignored
: (by design - probably misguidedly). I don't recall having ever noticed
: it for netnames.

	Attached are two files: pins.sch and pins.prj. After running
"gsch2pcb pins.prj", opening the pins.pcb file in pcb, loading the netlist
and [o]ptimizing rats' nests there is only one rat line between R1 and R2.

	I was, however, wrong about pcb silently discarding the other rat lines
- if I explicitly open the message window, there are warnings. However,
the message window is not opened by default, and there is no other notification
that something has gone wrong, which I think is not good from the usability
point of view.

	BTW, when I try to do a DRC check, pcb crashes. A similar crash
together with details like backtrace and so on is described here:
https://bugzilla.redhat.com/show_bug.cgi?id=906816

-Yenya

-- 
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| New GPG 4096R/A45477D5 - see http://www.fi.muni.cz/~kas/pgp-rollover.txt |
| http://www.fi.muni.cz/~kas/    Journal: http://www.fi.muni.cz/~kas/blog/ |
Please don't top post and in particular don't attach entire digests to your
mail or we'll all soon be using bittorrent to read the list.     --Alan Cox
v 20121123 2
C 40000 40000 0 0 0 title-B.sym
C 45100 48300 1 0 0 mosfet-with-diode-1.sym
{
T 46000 48800 5 10 0 0 0 0 1
device=NPN_TRANSISTOR
T 46000 48800 5 10 1 1 0 0 1
refdes=Q1
T 45100 48300 5 10 0 0 0 0 1
footprint=SOT23
}
C 46700 50100 1 270 0 resistor-2.sym
{
T 47050 49700 5 10 0 0 270 0 1
device=RESISTOR
T 47000 49900 5 10 1 1 270 0 1
refdes=R1
T 46700 50100 5 10 0 0 0 0 1
footprint=1206
}
C 46700 48800 1 270 0 resistor-2.sym
{
T 47050 48400 5 10 0 0 270 0 1
device=RESISTOR
T 47000 48600 5 10 1 1 270 0 1
refdes=R2
T 46700 48800 5 10 0 0 0 0 1
footprint=1206
}
N 45700 49300 45700 50600 4
N 45700 50600 46800 50600 4
N 46800 50600 46800 50100 4
N 46800 48800 46800 49200 4
N 46800 47900 46800 47700 4
N 46800 47700 45700 47700 4
N 45700 47700 45700 48300 4
C 44200 48700 1 0 0 nc-left-1.sym
{
T 44200 49100 5 10 0 0 0 0 1
value=NoConnection
T 44200 49500 5 10 0 0 0 0 1
device=DRC_Directive
}
N 45100 48800 44700 48800 4
schematics pins.sch
elements-dir .
output-name pins
Vladimir Zhbanov | 5 Feb 09:08 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

2013/2/4 Jan Kasprzak <kas@...>:
...
>         Attached are two files: pins.sch and pins.prj. After running
> "gsch2pcb pins.prj", opening the pins.pcb file in pcb, loading the netlist
> and [o]ptimizing rats' nests there is only one rat line between R1 and R2.
...

Hi,
I've tried to use gsch2pcb with this project file and got the
following output:
==================================================================
$ /usr/local/bin/gsch2pcb -v pins.prj
Reading project file: pins.prj
"   schematics "pins.sch
"   elements-dir ".
"   output-name "pins
Processing PCBLIBPATH="/usr/local/share/pcb/pcblib-newlib:/usr/local/share/pcb/newlib"
Adding /usr/local/share/pcb/pcblib-newlib to the newlib search path
Adding /usr/local/share/pcb/newlib to the newlib search path
Running command:
 cmd pins.schist -g pcbpins -o pins
--------
]oading schematic [/tmp/pins/pins.sch
: No such file or directoryns/pins.schsch

--------
Failed to run gnetlist
==================================================================

I have gEDA/gaf built from sources and tried to run gsch2pcb built
from the current git master HEAD as well as from the version 1.8.1
and always got the same error. Then I tried to run this adding an
empty line after each line in the project file and got the
following:

==================================================================
$ gsch2pcb -v -v pins.prj
Reading project file: pins.prj
"   schematics "pins.sch
    schematics ""
invalid `schematics' option: Text was empty (or contained only whitespace)
"   elements-dir ".
        Adding directory to file element directory list: .
    elements-dir ""
        Adding directory to file element directory list:
"   output-name "pins
    output-name ""
Processing PCBLIBPATH="/usr/local/share/pcb/pcblib-newlib:/usr/local/share/pcb/newlib"
Adding /usr/local/share/pcb/pcblib-newlib to the newlib search path
Adding /usr/local/share/pcb/newlib to the newlib search path
Running command:
        gnetlist -g pcbpins -o .cmd pins.sch
--------
]oading schematic [/tmp/pins/pins.sch
: No such file or directoryns/pins.schsch

--------
Failed to run gnetlist
==================================================================

Note that "Running command" was changed.

If I add an empty line before the first line I additionally get
some garbage like this:
==================================================================
Reading project file: pins.prj
    P2~�Гl� ls�P�������YP� ""
==================================================================

OTOH, the command "gsch2pcb pins.sch" works without errors.

What is wrong here? Is gsch2pcb working now? It seems to mangle
strings. Could anybody shed some light on this?

Vladimir Zhbanov | 5 Feb 09:55 2013
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

OK, I've probably found an issue. The problem with the project
file is that it uses DOS style newline symbols. At least, vim
shows its format as utf-8:dos whereas the new file with the same
contents created from scratch is shown as utf-8:unix. And the new
file is processed by gsch2pcb without errors.

Now I see that pcb really doesn't understand pin names ending with
letters and shows only one rat connecting resistors after the
netlist loading.

Peter Clifton | 10 Feb 22:32 2013
Picon
Picon

Re: [geda-user] [patch] Pinnumbers in mosfet-with-diode-1.sym

On Mon, 2013-02-04 at 14:19 +0100, Jan Kasprzak wrote:
> Peter Clifton wrote:

> 	BTW, when I try to do a DRC check, pcb crashes. A similar crash
> together with details like backtrace and so on is described here:
> https://bugzilla.redhat.com/show_bug.cgi?id=906816

Could you try that again with git HEAD PCB please? This might well be
one I have already fixed, but I'm not certain.

Regards,

--

-- 
Peter Clifton <peter.clifton@...>

Clifton Electronics


Gmane