# How to work with this PCA82C250 or SN65HVD230

**URL:** <https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909>\
**Category:** General Guidance\
**Created:** [March 7, 2022, 10:25pm UTC](https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909 "2022-03-07T22:25:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![douglasheld](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@douglasheld](https://forum.arduino.cc/u/douglasheld)\
**Post date:** [March 7, 2022, 10:25pm UTC](https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909/1 "2022-03-07T22:25:55Z")

</div>

I've bought this CAN Bus transceiver. It appears to have its own onboard microcontroller and I think I made a bad assumption that I could just start dumping data off the TX port.

 ![61pxWb-WO-L.AC_SL1500](https://europe1.discourse-cdn.com/arduino/original/4X/b/1/f/b1fb1bcdf01e15242e2fa4062f83313537bba4db.jpeg)

- [https://www.amazon.co.uk/gp/product/B00KM6XMXO](https://www.amazon.co.uk/gp/product/B00KM6XMXO)
- [https://www.waveshare.com/wiki/SN65HVD230\_CAN\_Board](https://www.waveshare.com/wiki/SN65HVD230_CAN_Board)

Once the part arrived, I realized as simple as it sounds, I did not know how to read Serial data out of this TX pin and into the RX0 pin of the Arduino Nano, and then pipe those bytes elsewhere for analysis, for example to the serial monitor. Because, there is only one serial connection; and my computer needs to be one of them. Nevertheless - I did plug it into my car and try. But, obviously no data came out at the baud rate I randomly tried.

The manufacturer maintains a website but it doesn't have any information for me and they did not respond to my request for help.

I thinking I'm going to have to buy a different board with a similar or identical chip onboard, one that has an Arduino-compatible library available. Before I do that, I thought I would check whether anybody here has sample code that may work with this. Perhaps someone can understand salient parts of the available code.

For good measure, here's what I tried:

```cpp
void setup() {
 pinMode( 0, INPUT );
 Serial.begin( 1000000 ); // 1Mbps
}
void loop() {
 int rx = digitalRead( 0 );
 Serial.print( "RX: " );
 Serial.println( (char) rx );
}

```

---

<div class="post-metadata">

**Author:** ![douglasheld](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@douglasheld](https://forum.arduino.cc/u/douglasheld)\
**Post date:** [March 7, 2022, 10:41pm UTC](https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909/2 "2022-03-07T22:41:03Z")

</div>

Later on, I did rewrite my sketch to be a little more like an oscilloscope, removing the CAN transceiver and just plugging CAN\_HI and CAN\_LO into two available analog ports.

For the morbidly curious....

```cpp
void setup() {
 pinMode( A1, INPUT );
 pinMode( A2, INPUT );
 Serial.begin( 1000000 ); // 1Mbaud, CAN Bus is most likely 500kHz
}
void loop() {
 int a1Value = analogRead( A1 );
 int a2Value = analogRead( A2 );
 Serial.print( "A1: " );
 Serial.println( a1Value );
 Serial.print( "A2: " );
 Serial.println( a2Value );
}

```

And here is what it looked like. So I guess, I can at least say I know the CAN data is there and that my hardware can pick it up. (I made an OBD2 cable, connector, prototype board etc.)

 ![Screenshot 2022-03-07 at 22.28.26](https://europe1.discourse-cdn.com/arduino/original/4X/0/4/e/04ea5b5e6b2c9e2fb327ca88be0b67e25909f4d2.png)  
 ![Screenshot 2022-03-07 at 22.28.40](https://europe1.discourse-cdn.com/arduino/original/4X/0/2/e/02ed5d9ea1f42e8f773091bcb5a955f06e0adaa5.png)

(off-topic: I seem to have encountered a minor bug with the Serial plotter. Is there any good alternative open source plotter that can be used?)

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [March 7, 2022, 10:50pm UTC](https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909/4 "2022-03-07T22:50:13Z")

</div>

Where to start?  
If You cut out Your private speculations there would be less of not helpful text.  
As You have noticed, You need 2 serial channels. The Pc Serial can use 115200 as speed, not 1 000 000.  
Reading the CAN circuit ought to be possible using software serial, if Nano supports that. I only have practical experience of UNOs.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [March 7, 2022, 10:53pm UTC](https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909/5 "2022-03-07T22:53:41Z")

</div>

> [@douglasheld](#):
>
> I seem to have encountered a minor bug with the Serial plotter

No. Read the vertical scale and note the jumping values.  
Please don't use screenshots. Copy the data as text and post it using code tags.

> [@douglasheld](#):
>
> ```arduino
> void loop() {
> float a1Voltage = analogRead( A1 );
> float a2Voltage = analogRead( A2 );
> 
> ```

What is that? Analog read returns an integer, likely 0 - 1023.

---

<div class="post-metadata">

**Author:** ![douglasheld](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@douglasheld](https://forum.arduino.cc/u/douglasheld)\
**Post date:** [March 8, 2022, 12:58pm UTC](https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909/6 "2022-03-08T12:58:05Z")

</div>

> [@Railroader](#):
>
> Analog read returns an integer

Thank you, I fixed it.

> [@Railroader](#):
>
> You need 2 serial channels.... ought to be possible using software serial

Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 4, 2022, 12:58pm UTC](https://forum.arduino.cc/t/how-to-work-with-this-pca82c250-or-sn65hvd230/966909/7 "2022-09-04T12:58:45Z")

</div>

Closed on September 4, 2022, 12:58pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
