TCAN334 Spice Model & Testing

For the design of an STM32-based MPPT controller, I needed the High-Speed TCAN334 CAN (Controller Area Network) IC. I developed a SPICE model for the TCAN334 IC that captures its logic and bus-level behavior. This behavioral model does not simulate fault protection, ESD effects, bus short circuits, common-mode limits, or wake-up timing.

Spice Model

The SPICE model for the TCAN334 IC is below.


* ============================================================
* TCAN334  3.3V CAN transceiver - behavioral SPICE3f5 subcircuit
* Package: SOIC-8 (pin order matches the MPPT 2420 HC schematic)
*   1 TXD   2 GND   3 VCC   4 RXD   5 SHDN   6 CANL   7 CANH   8 STB
* by ee-diary.net
* Behavior
*  - TXD low  -> bus dominant  (CANH ~3.5V, CANL ~1.5V)
*  - TXD high -> bus recessive (CANH = CANL = ~2.5V via ~30k)
*  - RXD low when Vdiff > ~0.8V, high when Vdiff < ~0.6V
*  - SHDN or STB high, or VCC < 2.8V -> driver off, bias off
*  - TXD has internal pull-up, SHDN/STB internal pull-downs
*  - TXD->bus delay ~40ns, bus->RXD delay ~30ns (tune Cd/Cr)
*
* NOTE: behavioral model, not a transistor-level copy. It is
* meant for logic/bus-level simulation, not for EMC, ESD,
* wake-up pattern or fault-protection analysis.
* ============================================================
.SUBCKT TCAN334 TXD GND VCC RXD SHDN CANL CANH STB

* ---- input pull resistors and pin capacitance ----
Rtxd VCC TXD 100k
Rshdn SHDN GND 100k
Rstb  STB  GND 100k
Ctxd TXD GND 5p
Cshdn SHDN GND 5p
Cstb STB GND 5p

* ---- supply current (about 1mA idle, +3mA dominant) ----
Rvcc VCC GND 3.3k
Sdom VCC N_ICC domd GND SWC
Ricc N_ICC GND 1k

* ---- enable: VCC good and not in shutdown ----
Ben en GND V=u(V(VCC,GND)-2.8)*u(1.4-V(SHDN,GND))
Ren en GND 1Meg

* ---- dominant command: TXD low and enabled and not standby ----
Bdom dom GND V=u(1.4-V(TXD,GND))*V(en,GND)*u(1.4-V(STB,GND))
Rd domd_in GND 1Meg
Rd1 dom domd 1k
Cd domd GND 60p
Rdd domd GND 10Meg

* ---- driver levels (scale with VCC) ----
Bhi vhi GND V=V(VCC,GND)*1.09
Blo vlo GND V=V(VCC,GND)*0.424
Sh vhi N_H domd GND SWC
Rh N_H CANH 10
Sl vlo N_L domd GND SWC
Rl N_L CANL 10

* ---- recessive bias (about 2.5V, off in shutdown/standby) ----
Bvb vb GND V=2.5*V(en,GND)*u(1.4-V(STB,GND))
Rbh vb CANH 30k
Rbl vb CANL 30k
Rdiffin CANH CANL 100k
Cbh CANH GND 10p
Cbl CANL GND 10p

* ---- receiver with hysteresis ----
Bdif dif GND V=(V(CANH,GND)-V(CANL,GND))*V(en,GND)
Rr dif difd 500
Cr difd GND 60p
Rdf difd GND 10Meg
* RXD pulled low when Vdiff > ~0.8V (releases below ~0.6V)
Srl RXD GND difd GND SWRL
* RXD pulled high when Vdiff < ~0.6V (releases above ~0.8V)
Srh VCC RXD GND difd SWRH
* weak keeper so RXD is never floating during hysteresis
Rkeep RXD VCC 1Meg
Crxd RXD GND 5p

.MODEL SWC SW(Vt=0.5 Vh=0.1 Ron=1m Roff=1G)
.MODEL SWRL SW(Vt=0.7 Vh=0.1 Ron=50 Roff=1G)
.MODEL SWRH SW(Vt=-0.7 Vh=0.1 Ron=50 Roff=1G)

.ENDS TCAN334

* ============================================================
* Quick test circuit (copy into a separate netlist)
* ============================================================
* VCC  VCC 0 DC 3.3
* VTX  TXD 0 PULSE(3.3 0 1u 10n 10n 4.99u 10u)
* VSD  SHDN 0 DC 0
* VST  STB 0 DC 0
* X1   TXD 0 VCC RXD SHDN CANL CANH STB TCAN334
* R1   CANH CANL 60
* CL   RXD 0 15p
* .TRAN 10n 40u
* .PROBE
* .END
* Expected: Vdiff ~1.6V dominant, ~0V recessive, RXD follows TXD
* ============================================================

Transmit-path test bench for a CAN transceiver

 It's a transmit-path test bench for a CAN transceiver, and datasheets usually call this kind of circuit the "driver electrical characteristics" or "loop delay" test circuit.

Transmit-path test bench for a CAN transceiver

What the circuit is

  • TXD pulse generator (1 MHz, 0 to 3.3 V): stands in for the microcontroller's CAN TX pin, sending alternating 0 and 1 bits.
  • 60 Ω between CANH and CANL: the standard CAN load. A real bus has a 120 Ω termination resistor at each end, and the two in parallel look like 60 Ω to a transceiver.
  • 15 pF on RXD: a typical input capacitance of the microcontroller's RX pin.
  • STB and SHDN tied to ground: keeps the transceiver in normal operating mode.

What it's for

It checks that the transceiver does its core job: turn the logic bits on TXD into the differential CAN bus signal and turn the bus back into a logic signal on RXD. It also measures how long that takes. For your model, it confirms the model behaves like the real part in normal mode before you test the more specialized cases.

Transmit-path graph of CAN transceiver

What the graph shows

  • TXD: the input bit stream. Low (0 V) is a dominant bit and high (3.3 V) is recessive.
  • CANH and CANL: when TXD is high, both sit at about 2.5 V (recessive, no one driving). When TXD is low, CANH rises to about 3.3 V and CANL falls to about 1.7 V (dominant).
  • CANH − CANL: the differential voltage, which is what CAN receivers actually read. It is 0 V recessive and about 1.65 V dominant, comfortably above the roughly 1.5 V minimum the standard requires with a 60 Ω load.
  • RXD: what the microcontroller would see. It copies TXD, delayed by about 75–86 ns, which is the transceiver's loop delay (TXD to bus to RXD).

It follows that if the bus levels, the polarity (RXD matches TXD) and the delay look right, the model is working in normal mode.

Receiver thresholds and hysteresis

Below is test circuit for receiver thresholds and hysteresis.

test circuit for receiver thresholds and hysteresis

The resulting waveform is shown below:

Receiver thresholds and hysteresis graph

EventTime on graphVdiff at that point
RXD falls (ramp up)about 9.0 µsabout 0.8 V
RXD rises (ramp down)about 15.2 µsabout 0.6 V

The hysteresis is about 0.2 V. Both thresholds sit inside the 0.5–0.9 V range that ISO 11898-2 requires, and the rising-edge threshold is where the model says it should be. So the behavior is correct: RXD stays high below 0.6 V, goes low above 0.8 V, and doesn't chatter in between.

One thing to note

The RXD rising edge takes about 200–300 ns, while the falling edge is nearly instant. That is an artifact of this test, not a model problem. The ramp changes by only 0.1 V/µs, and the model's switch resistance changes gradually across the hysteresis window, so RXD transitions slowly when the input is this slow. With real CAN edges (nanoseconds), as in your first test, RXD switches cleanly. That test showed delays of about 75–86 ns.

See related blog posts:



Post a Comment

Previous Post Next Post