I want to communicate with a microcontroller over a CAN bus which needs (ideally) 120 ohm terminal resistors at the end of each bus. I want to integrate this resistor into the circuit and activate it only if it is needed (depending on which software is being flashed on the controller). Is it possible to switch a resistor using software?

Basically what I have in mind is something like this: What's the automatic equivalent of a variable resistor?. With only two states (120 ohm and 0 ohm open circuit) switched by a digital signal from the microcontroller.

  • 4
    \$\begingroup\$ You probably don't want 120 and 0 Ohm, but 120 Ohm and an open circuit. \$\endgroup\$
    – Rev
    Commented May 11, 2015 at 6:46
  • 1
    \$\begingroup\$ easiest solution would be a mosfet in series with your resistor. Integrate an pullup/down in your design to define the standard state. And yes, as @Rev1.0 stated, 0 Ohm is a bad idea ;) \$\endgroup\$
    – jwsc
    Commented May 11, 2015 at 13:18
  • \$\begingroup\$ Where did the answer that was posted go? At a first glimpse it looked ok. \$\endgroup\$
    – Rev
    Commented May 11, 2015 at 13:26

1 Answer 1


There are a couple ways of doing the termination with CAN (from AD application note AN1123):

enter image description here

Here is one scheme that uses switched termination to a common mode level, using two smallish p-channel MOSFETs. Raising the gates to +5V turns off the termination.

enter image description here

As an alternative, there are some pretty low-resistance analog switches available (a couple ohms or less) which might simplify things but you'd have to analyze how well they'd do with ESD etc., and many won't handle even 5V. For example the TS5A3167.

enter image description here

  • \$\begingroup\$ More commonly, you'd put the resistor between CAN high and low, in which case you only need one MOSFET and one resistor. \$\endgroup\$
    – Lundin
    Commented May 19, 2015 at 6:22
  • \$\begingroup\$ Looking at the Microchip example you shared, there is a 1K Resistor R16 connected to VCC that is not shown in your screenshot. There is a symbol I've never seen on that branch. Do you have any idea what that is for? \$\endgroup\$
    – Luminaire
    Commented Oct 12, 2020 at 18:38
  • \$\begingroup\$ @Luminaire I'd guess it's a jumper \$\endgroup\$ Commented Sep 26, 2023 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.