# Custom photodiode symbol in LTSpice 'syntax error in transmission line statement: “..”'

I want to simulate different opamps for use in the transimpedance amplification stage in a position sensing device (PSD) photodiode.

The equivalent circuit for the PSD photodiode is saved in psd.asc.

The transimpedance amplification schematic is saved in opamp.asc.

From the standard library I copied diode.asy and added the two light arrows. Furthermore I adjusted the input and output labels and changed the prefix, name letter from D to P.

I was able to select psd as a component in opamp.asc. However when I want to run some transient analysis I get the error message:

Syntax error in coupled transmission line statement: "p1 n0001 0 pd"

I configured the current source in psd.asc to emulate a triangle current response if it matters.

The corresponding LTSpice files are available as Gist.

• I don't think you can just change the prefix however you want. SPICE gives a special meaning to each prefix, and it's not really open to change. – The Photon Feb 23 '19 at 15:18
• P is apparently the prefix for a transmission line, so when you use P it thinks you're trying to define a transmission line rather than a diode. – The Photon Feb 23 '19 at 15:19
• @ThePhoton you are right. I changed P back to D and now the simulation runs. However voltages and currents are constant. The pulse modulation of the current generator inside the photodiode seems to be disabled. – bodokaiser Feb 23 '19 at 15:24
• You need to use X for a subcircuit model. There are tutorials out there on how to do it. – The Photon Feb 23 '19 at 15:28
• I had to remove every SYMATTR command in psd.asy and change SymbolType CELL to SymbolType BLOCK. Can you put this together in an answer? – bodokaiser Feb 23 '19 at 15:34