Posts: 1
Joined: Tue Jul 31, 2018 11:06 am

Serial communication driver for CAN0 | C++

Tue Jul 31, 2018 11:12 am

I'm searching for a C++ lib that works with the SN65HVD230 CAN to Serial transceiver. I've already found one called but it only works with Teensy and not on the Raspberry pi. Is there an equivalent for the Raspberry?

Posts: 7
Joined: Thu Aug 16, 2018 8:19 pm

Re: Serial communication driver for CAN0 | C++

Fri Aug 17, 2018 4:17 pm

Hi, I got there reading about CAN, I don't know for now in deep Broadcom device and I am inetrested on standard SPI I2C and GPIO peripheral.
From your post I fear you get fooled by name of RX and TX can bus pin. They are different from USART that carry same name for different behaviour.
The mentioned IC is a simple can bus drriver (PHY), it translate cmos level to can bus electrical specs.
If you connect RX and TX pin of can bus driver to usart you can use to communicate serial stream single duplex. Remember Physical bus transport a quasi differential serial stream but not can bus telegrams.

It is possible to build a software CAN driver, if not necessary is more simple to use a cheap cortex microcontroller where you can load can bus interface to SPI or I2C then connect to PI through them.
Teensy 3.x has a KINETIS freescale (now NXP) M4, this processor has one or two CAN bus controllers aboards.

The IC you mentioniond, as I wrote, is a simple can bus driver it need to be connected to CAN controller. This act like RS232 or RS 485/422 level translator to Physical bus.
If this is not of help, please be more specific about your setup.

Return to “C/C++”