SN65HVD230 CAN Transceiver Library for Proteus Simulation: two Arduino UNO V4.0 boards on one CAN bus

SN65HVD230 CAN Transceiver Library for Proteus Simulation

2 Views
40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new SN65HVD230 CAN Transceiver Library for Proteus Simulation. The SN65HVD230 - often printed "VP230" on the chip - is the small 3.3 V CAN bus transceiver you find on blue breakout boards next to ESP32 and STM32 projects. A microcontroller's CAN controller only knows bits: a TX pin and an RX pin. The transceiver turns those bits into the two-wire differential signal of a CAN bus, CANH and CANL, and turns the bus back into bits. With this library you can run a full Proteus simulation of the SN65HVD230: the driver, the receiver, the read-back of every bit, the termination, and a decoder that shows you every frame travelling on the bus.

SN65HVD230 CAN Transceiver Library for Proteus simulation demo: an Arduino sends CAN frames through the SN65HVD230 and a second Arduino with an MCP2515 flashes its LED for each one
Figure: The SN65HVD230 simulation running: a frame every second, acknowledged by the MCP2515.
Updates

SN65HVD230 CAN Transceiver Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Helping Tools

The transceiver shares its bus with our MCP2515 module, so the two can talk to each other on one sheet. The demo sends real CAN frames, built bit by bit by an Arduino UNO, through the SN65HVD230 to an MCP2515 on a second UNO - and the receiver acknowledges every one of them.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the CAN bus board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the SN65HVD230 CAN Transceiver Library for Proteus Simulation:

SN65HVD230 CAN Transceiver Library for Proteus Simulation: two Arduino UNO V4.0 boards on one CAN bus
Figure: The SN65HVD230 CAN Transceiver Library for Proteus Simulation.

What Is the SN65HVD230 CAN Transceiver?

The SN65HVD230 is a CAN bus transceiver that runs from 3.3 V. It sits between a CAN controller - the TWAI peripheral of an ESP32, the CAN peripheral of an STM32, or a stand-alone controller like the MCP2515 - and the bus cable. The common breakout board carries the SO-8 chip, a 120 ohm terminating resistor, two capacitors and a six-pin header: 3V3, GND, CTX, CRX, CANH and CANL, plus a screw terminal for the bus wires. Because it is a 3.3 V part, it fits the newer 3.3 V microcontrollers directly, yet it shares a bus with the classic 5 V transceivers without trouble.

The SN65HVD230 at a glance
SN65HVD230 CAN transceiver
Supply3.3 V (3.0 - 3.6 V)
Controller sideCTX (data in) and CRX (data out)
Bus sideCANH and CANL, a differential pair
Speedup to 1 Mbit/s in high-speed mode
Board120 ohm termination, Rs tied to GND
UsesESP32 and STM32 CAN nodes, cars, machines, robots

Dominant and Recessive

A CAN bus has two states. When a node drives a 0 bit, the transceiver pulls CANH up and CANL down: the bus is dominant. When every node sends a 1, nobody drives the bus and the termination resistors pull CANH and CANL together: the bus is recessive. On the SN65HVD230 this is simple: CTX low makes the bus dominant, CTX high leaves it recessive. The names say what happens when two nodes disagree - a dominant 0 always wins over a recessive 1. That one rule gives CAN its arbitration: two nodes may start a frame at the same moment, and the one with the lower identifier carries on while the other notices it lost and stops.

Reading Back Every Bit

The receiver half of the chip works all the time: CRX is low while the bus is dominant and high while it is recessive - no matter who is driving it. So a CAN controller hears its own bits about 70 ns after it sends them, and it compares each one. If it sent a recessive bit and reads back a dominant one, another node is talking: in the identifier that means lost arbitration, anywhere else it is a bit error. The same read-back lets the sender see the acknowledgement: it sends the ACK slot recessive, and any node that received the frame correctly turns that slot dominant.

Termination and the 3.3 V Supply

A CAN bus is a line with exactly two ends, and each end gets a 120 ohm resistor across CANH and CANL. The resistors stop reflections and, just as important, pull the bus back to recessive after every dominant bit. The breakout has its resistor fitted; on boards in the middle of a long bus you remove it. In the library this is the TERMINATION property. The supply matters too: the SN65HVD230 needs 3.3 V on its 3V3 pin. Below 3.0 V the model lets go of the bus and holds CRX high, as a chip without enough supply would.

What a CAN Frame Looks Like

A standard CAN data frame begins with one dominant start bit, followed by the 11-bit identifier, the RTR bit (0 for data), the IDE bit (0 for a standard identifier), a reserved bit, the 4-bit data length and up to eight data bytes. Then comes a 15-bit CRC calculated over everything before it, a recessive delimiter, the ACK slot, another delimiter and seven recessive end-of-frame bits. Between the start and the CRC, the sender adds a stuff bit of the opposite value after every five equal bits, so the bus never stays in one state too long and every receiver keeps its clock in step. Receivers remove the stuff bits again before they read the fields.

One Bus With the MCP2515

Our MCP2515 CAN Bus Module Library for Proteus already models a complete CAN node: the controller with its SPI registers and a TJA1050 transceiver on the board. The SN65HVD230 uses the same bus levels on CANH and CANL, so you can mix them on one sheet - just connect CANH to CANH and CANL to CANL. Whatever one node drives, every other node sees; a dominant bit from any of them makes the whole bus dominant. That is how the demo works: an Arduino sends through the SN65HVD230, the MCP2515 on the other board receives, and its acknowledgement comes back through the same wires.

Features of the SN65HVD230 CAN Transceiver Library for Proteus Simulation

  • A real-looking module: the 24 x 18 mm breakout at its real size, the SO-8 chip, the 120 ohm resistor, the capacitors, the six-pin header and the screw terminal.
  • The real logic: CTX low drives the bus dominant, CTX high leaves it recessive; CRX follows the bus, this node's own bits included, after a 70 ns loop delay.
  • One bus with our MCP2515: the same CANH / CANL levels, so transceivers and modules on one pair of wires talk to each other.
  • A frame decoder: the pop-up finds the frames on the bus, removes the stuff bits, checks the CRC-15 and the ACK, and measures the bit rate.
  • A pop-up: the signal path CTX - bus - CRX, the last frames decoded, the frames and acknowledgements counted, the errors seen, the termination, the supply - graphs, an event log and a check page.
  • A complete package: about 2.3 MB with the library, our MCP2515 module, our Arduino UNO V4.0 and the two-board demo, without the source code of the model.

The SN65HVD230 in Proteus

The device is SN65HVD230TEP in TEPSN65HVD230.LIB, under Modules > CAN Bus, with the prefix U and the model TEPSN65HVD230.DLL. Search SN65HVD230 or CAN in Pick Devices. Six pins on the left: 3V3, GND, CTX, CRX, CANH and CANL. One property: TERMINATION - YES puts the board's 120 ohm resistor across the bus (a node at an end of the bus), NO removes it.

SN65HVD230 CAN transceiver breakout from the SN65HVD230 Library for Proteus Simulation
Figure: The SN65HVD230 CAN transceiver.

Download SN65HVD230 CAN Transceiver Library for Proteus Simulation

Click the button below to download SN65HVD230-CAN-Transceiver-Library-for-Proteus-v1.0.zip (about 2.3 MB, without the source code of the models):

SN65HVD230 CAN Transceiver Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPSN65HVD230.LIB, TEPMCP2515.LIB, TEPLED5MM.LIB, TEPRESISTOR.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPSN65HVD230.DLL, TEPMCP2515.DLL, TEPLED5MM.DLL, TEPRESISTOR.DLL and TEPARDUINO.DLL.
  • Arduino Code: the sender sketch (software CAN, no library) and the receiver sketch (autowp-mcp2515).
  • Proteus Simulation: the demo project, its two HEX files and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install SN65HVD230 CAN Transceiver Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPSN65HVD230.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for SN65HVD230.

Proteus Simulation of a CAN Bus

The demo uses an A3 sheet with two of our Arduino UNO Library for Proteus V4.0 boards. On the left, ARD1 is the sender with U1, the SN65HVD230: CTX on D3, CRX on D2, 3V3 on a 3.3 V rail. On the right, ARD2 is the receiver with U2, our MCP2515 module with its 8 MHz crystal: CS on D10, SI on D11, SO on D12, SCK on D13 and INT on D2, plus an LED on D5. The two modules meet on the CANH and CANL labels. Each Arduino has its own built-in monitor, the same window as our TEP Serial Monitor Advance for Proteus. Open SN65HVD230-CAN-Bus-ArduinoUnoV4.pdsprj.

SN65HVD230 simulation in Proteus: an Arduino UNO V4.0 with the SN65HVD230 and a second UNO with the MCP2515 on one CAN bus
Figure: The whole simulation on an A3 sheet.

The Sender: CAN in Software

An Arduino UNO has no CAN controller, so the sender does the controller's job in software - slowly, at 10 kbit/s, which is plenty for a demo and still a real CAN bit rate. Each second it builds a complete frame in an array, one bit per byte. The CRC-15 runs over the start bit, the identifier, the control bits and the data with the CAN polynomial 0x4599:

  for (byte i = 0; i < rn; i++) { const byte nxt = raw[i] ^ ((crc >> 14) & 1); crc = (crc << 1) & 0x7FFF; if (nxt) crc ^= 0x4599; }

Then it adds the stuff bits - after five equal bits, one of the other value:

    if (raw[i] == last) run++; else { last = raw[i]; run = 1; }
    if (run == 5) { last = !last; bits[n++] = last; run = 1; stuffBits++; }

The ACK slot is sent recessive, and the sketch remembers where it is, because that is where it will look for the receiver's answer:

  ackAt = n; bits[n++] = 1;                                 // the ACK slot: sent recessive - a receiver makes it dominant

Timer1 sets the pace: in CTC mode with an 8 prescaler and OCR1A at 199 it interrupts every 100 us, one bit time. The compare A interrupt puts the next bit on CTX; compare B, half a bit later, reads the bus back on CRX:

  TCCR1A = 0; TCCR1B = _BV(WGM12) | _BV(CS11); OCR1A = 199; OCR1B = 100; TIMSK1 = _BV(OCIE1A) | _BV(OCIE1B);

Reading back in the middle of each bit is exactly what a real controller does. In the ACK slot, a low CRX means a receiver acknowledged the frame; anywhere before it, a bit that differs from the one sent is a bit error:

  const byte rx = (PIND >> 2) & 1;
  if (idx == ackAt) ack = (rx == 0);

The Receiver: an MCP2515

The second board uses the autowp-mcp2515 library. It sets the same bit rate with the module's 8 MHz crystal and puts the controller in its normal mode - the mode in which the MCP2515 acknowledges every frame it receives without errors:

  mcp2515.setBitrate(CAN_10KBPS, MCP_8MHZ);

Then it waits for INT to go low, reads the frame and prints it, and flashes the LED:

  if (!digitalRead(CAN_INT) && mcp2515.readMessage(&rx) == MCP2515::ERROR_OK) {

SN65HVD230 Simulation Results

Open the project and press Run. The demo runs 7.9 simulated seconds and took about three minutes on our PC with the pop-ups open and the pictures being taken. Click the SN65HVD230 for its pop-up, or the MCP2515 for its own. Every number below comes from one simulation run, the demo exactly as it ships.

The Start

3V3 comes up at 3.30 V and the transceiver reports that it works at 1 ms; its TERMINATION property is YES, so the board's 120 ohm resistor sits across the bus. The sender's sketch prints its title and reads CRX while nothing is happening: HIGH, recessive - the proof that the transceiver is powered and the bus is quiet. On the other board the MCP2515 is reset, set to 10 kbit/s with its 8 MHz crystal and put in its normal mode, and its monitor says "MCP2515 ready".

The First Frames

The first frame goes out after the sketch's one-second delay and is complete at 1.145 s: ID 0x123, four data bytes 01 17 33 A5, 70 bits on the bus up to the ACK slot, two of them stuff bits. The SN65HVD230's pop-up decodes it from the bus - the identifier, the length, the data, the CRC-15 it recalculates and compares - and marks it "CRC ok" and "ACK". The sender saw the same ACK through CRX and prints "ACK received". The next frames follow every 1.019 s: 2.164 s, 3.183 s and so on. Their length changes between 69 and 70 bits because the number of stuff bits depends on the data.

SN65HVD230 Proteus simulation pop-up: the signal path CTX, CANH, CANL and CRX with the frames decoded
Figure: The CAN Bus page.

Later in the Run

At 7.34 s the sender has put 7 frames on the bus and all 7 were acknowledged. The transceiver's decoder saw 7 frames, all from this node, with 0 CRC errors and 0 stuffing errors, and measured the bit rate from the shortest pulses: 10.0 kbit/s. Between the frames the bus is recessive, so at that moment the pop-up shows CTX high, CANH and CANL recessive and CRX high.

SN65HVD230 Proteus simulation pop-up: seven frames on the bus, all acknowledged, 10.0 kbit/s measured
Figure: Seven frames, seven ACKs.

The Receiver

The MCP2515 on the second board takes every frame into its receive buffer RXB0 - at 1.1365 s, 2.1555 s, 3.1745 s and on - and pulls INT low. The receiver's sketch reads it over SPI and prints it with its meaning: frame 1 is count 1, 23 C and 51 %, frame 2 count 2, 24 C and 52 %. The LED on D5 flashes for 200 ms with each frame; in the running picture it is lit, a few milliseconds after frame 7. The MCP2515's own pop-up agrees: the normal mode, error active, TEC 0 and REC 0, 0 sent and 7 received, a bus load of 0.8 % and not one error frame.

SN65HVD230 Proteus simulation: the receiving Arduino with the MCP2515 module flashes its LED for each CAN frame
Figure: The receiver on the sheet.
The SN65HVD230 CAN bus simulation running in the Proteus workspace
Figure: The simulation in the workspace.
SN65HVD230 Proteus simulation: the MCP2515 module receives every frame from the SN65HVD230
Figure: The MCP2515 receives every frame.
Arduino UNO V4.0 serial monitor in the SN65HVD230 Proteus simulation: the frames the MCP2515 received
Figure: The receiver's monitor.

The Graphs, the Event Log and the Check Page

The Graphs page plots CTX low (this node driving the bus), the bus dominant, CRX low and the bus load; each frame is a short spike once a second, and the three upper traces match because the transceiver reads back what it sends. The Event log keeps the supply and the frames as they were decoded. The Check page sums up the run: 3V3 at 3.30 V with about 10 mA, the bus with 258 edges and now recessive, 7 frames at 10.0 kbit/s - the last one ID 0x123 [4] 07 18 32 A5, CRC ok, ACK - 7 of 7 frames acknowledged, 0 CRC and 0 stuff errors, and the termination on at this node. Every line is green.

SN65HVD230 Proteus simulation graphs: CTX, the bus and CRX for each CAN frame
Figure: The Graphs page.
SN65HVD230 Proteus simulation Event log: the supply and the decoded frames
Figure: The Event log.
SN65HVD230 Proteus simulation Check page after the demo run
Figure: The Check page.

The sender's monitor shows its side: every frame it built, its length with the stuff bits, and the ACK it saw on CRX.

Arduino UNO V4.0 serial monitor in the SN65HVD230 Proteus simulation: the frames sent and acknowledged
Figure: The sender's monitor.

Transceiver, Controller or Module?

Three parts are easy to confuse. The transceiver - the SN65HVD230, the TJA1050, the MCP2551 - only converts levels; it knows nothing about frames. The controller builds and checks frames, handles arbitration, the CRC and the error counters; it is built into the ESP32 and many STM32 chips, or it comes as the MCP2515 on SPI. A module like our MCP2515 board puts both on one board. So with an ESP32 or an STM32 you need just the SN65HVD230; with an Arduino UNO you need a complete module - or, as in this demo, a lot of patience in software.

Try It Yourself

  • Remove the receiver's program and watch what the sender prints when no node turns the ACK slot dominant.
  • Change the ID or the data in the sender and watch the number of stuff bits change on the monitor and in the pop-up.
  • Send a frame every 100 ms instead of every second and watch the bus load grow on both pop-ups.
  • Change the receiver's bit rate in the sketch and see how much a CAN node depends on everybody using the same one.
  • Set U1's TERMINATION to NO and compare the Check page with the rule of 120 ohm at the two ends of the bus.

Ideas to Extend the Demo

  • Send the frames from an ESP32 with TWAI and keep the MCP2515 receiver.
  • Add a second sender with a lower ID and watch arbitration decide who goes first.
  • Answer from the receiver: a frame with ID 0x200 that switches an LED on the sender's board.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real SN65HVD230

  • Supply: 3.3 V on 3V3 - not 5 V. CTX accepts 5 V logic, so it also works behind a 5 V controller.
  • A controller is needed: the transceiver alone does not make an Arduino UNO a CAN node.
  • Termination: 120 ohm at the two ends of the bus only; take the resistor off the boards in the middle.
  • Wiring: a twisted pair for CANH and CANL, and a common ground between the nodes.
  • Rs: the breakout ties it to GND for full speed; a resistor slows the edges, and Rs high puts the chip in standby.

Troubleshooting

  • CRX stays high and nothing is decoded: 3V3 is missing or below 3.0 V, or nothing drives CTX.
  • "no ACK": no other node is running, the MCP2515 is not in its normal mode, or CANH and CANL are crossed.
  • "BIT ERROR": another node drives the bus at the same time, or the bit rates differ.
  • The MCP2515 receives nothing: check its bit rate and crystal setting - 10 kbit/s with 8 MHz here.
  • The part is not simulated: TEPSN65HVD230.DLL is missing from MODELS and from the project folder.

Limitations of the Simulation

  • The driver and receiver logic, the 3.3 V supply, the loop delay, the termination and the bus shared with our MCP2515 module follow the chip's datasheet; the breakout is our own drawing.
  • Our own choices: 35 ns in each direction, and the bus as logic levels - dominant or recessive - rather than voltages.
  • Not modelled: the slope control on Rs, standby, thermal shutdown, the common-mode range, short circuits on the bus and electrical noise.
  • Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the chip's maker.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the SN65HVD230 CAN Transceiver Library for Proteus Simulation. I hope it helps you see what happens on a CAN bus - every bit, every stuff bit and every acknowledgement - before you connect the first real nodes. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation