1
\$\begingroup\$

I want to sniff data from a CAN Bus where are nodes using these parts:

1 - 18F24K20 - Microcontroller
2 - VP233 - CAN Transceiver
3 - 78L33A - Voltage Regulator

enter image description here

These nodes are sensors that detect yarn feeding into textile machines. https://www.dinema.it/uploads/2016-8-3/1-39-DIN-Electronics-SPYDER.pdf

I took some measurements at CANH and CANL but only got this, which doesn't seems right to me, since it is only about a few bits and a Data Frame has a lot more information than that.

enter image description here

enter image description here

I also uploaded a video on youtube of a recording of my screen. The signal was measured using a Hantek6022BE

https://youtu.be/Ft703AL1hr8

Analyzing this image I see roughly 6.5 bits during the period of 20 us resulting in a frequency of 325 kHz.

I'm using a USBCAN-I that has an auto-scan to detect baud rate, but it can't detect any frequency on this bus

enter image description here

What does this signal I measure with the scope means?

I was expecting something like this on the scope:

enter image description here

\$\endgroup\$
8
  • \$\begingroup\$ I would explain more about your setup, to what the CAN bus is attached for what. I wonder if that 6 & 1/2 bits are arbitration/address-resolution of some "bussed" system. \$\endgroup\$
    – jay
    Commented Aug 13, 2021 at 20:19
  • \$\begingroup\$ It is a sensor that detects yarn feeding into the textile machines dinema.it/uploads/2016-8-3/1-39-DIN-Electronics-SPYDER.pdf \$\endgroup\$ Commented Aug 13, 2021 at 20:39
  • \$\begingroup\$ aha... I have a great memory about looms, yarn, textile, fabric, though my progress was mostly on textile dyeing. I still miss that. Now you see how I had to jump in your loom machine conversation. "feeding" may imply thread detector? Due to the static and dust, thread detection may use a sort of tension detection, is it? I would not want full suit of CAN bus protocols or any, for a simple (looking at the first picture) operations. So, it likely is just a serial data (async) on CAN phy of some number of bits. Wonder what that device is doing(?). Come back with some more info, please. \$\endgroup\$
    – jay
    Commented Aug 13, 2021 at 20:57
  • \$\begingroup\$ it is based on the measurement of the electrical variations that signify when a yarn is moving or static. The Bus has 25 of these sensors. The device "learns" the behavior of the yarn and then detects when it breaks \$\endgroup\$ Commented Aug 13, 2021 at 21:09
  • \$\begingroup\$ That sounds like a good approach for yarn detection. I see what it is. I will move mine to answer, while editing your question as well. \$\endgroup\$
    – jay
    Commented Aug 13, 2021 at 21:23

1 Answer 1

2
\$\begingroup\$

USBCAN-1 may not help you at this point. Since USBCAN-1 operation & applications rely on "CAN protocols in CAN bus packet format". Yarn detection does not need that "overheads" at all. That is how you see unexpected "strange behavior". Again, you have CAN PHY but it is not a CAN BUS.

The difference you would notice, between CAN and RS485/RS422, is that the "differential signal" does not cross each other. That is ok and a CAN bus receiver will handle the "offset" and outputs digital signal. You may use the resistor divider at the output of the CAN bus receiver, if needed.

So, like what you did for your sniffing SPI, You would place CAN bus receiver and try to capture, speed, alignment, number of bits, etc, but may be asynchronous serial data this time.


Edit,
A random thought. PIC18F2XK20 has a LIN (EUSART), a sort of UART. Read how the LIN protocols works. So, there is a good chance that short variable size frame is from the LIN transmitter. Meantime, since the yarn detector has no purpose to follow LIN protocols, it is possible that the frame is "bit encoded".

\$\endgroup\$
5
  • \$\begingroup\$ I'm planning to use a MCP2551 as a CAN Transceiver to convert the signal do single-ended. I read about the LIN protocol, Wikipedia says it is "Single master, up to 16 slaves", but the machine has 25 sensors in the same bus. Any tips on how to decode an asynchronous serial data? \$\endgroup\$ Commented Aug 15, 2021 at 21:36
  • \$\begingroup\$ Looks like it has 10 bits. If the first and last one are start bit and stop bit respectively, there are 8 bits left or 1 byte. It makes sense, doesn't it? \$\endgroup\$ Commented Aug 15, 2021 at 22:33
  • \$\begingroup\$ I noticed that, "25 sensors" @DiegoRamos . So, it may not use the whole suit of LIN protocols, but use the characteristics of EUSART to share the bus. One possibility, to be oversimple, is encoding the data in bit-field. It is just a possibility. If it was 10 bits, as DiegoRamos says, it could be start bit + 8 data bits + some sort of flag. I would capture multiple of the waveform on a scope first to get some sense. We can create a chat room, if you'd like, for a extended discussion. \$\endgroup\$
    – jay
    Commented Aug 15, 2021 at 22:55
  • \$\begingroup\$ Yes, how do we do it? \$\endgroup\$ Commented Aug 16, 2021 at 0:35
  • \$\begingroup\$ I have created a chat room \$\endgroup\$
    – jay
    Commented Aug 16, 2021 at 0:47

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.