Computer to CAN communication

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good day!

 

Sorry if my post is not for here, please move it.

 

I want to make a software to communicate with an ECU. I tried sending data to the USB, but I receive garbage data in return. The hardware I use is vector VN1600 which is connected to the USB and on the other way to a CAN box. It should be possible to communicate with any serial terminal, but its not. I think the problem comes from the VN1600, since I don't know anything about it. Can someone please give me a hint in the right direction and how to find where the problem is?

This topic has a solution.
Last Edited: Wed. Mar 25, 2020 - 11:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ArakelTheDragon wrote:
Sorry if my post is not for here ... I use vector VN1600  

Well that's not an AVR, and nothing to do with Microchip - so why did you think this might be the place for it?

 

ArakelTheDragon wrote:
I think the problem comes from the VN1600

In that case, you need to contact Vector for support with their product!

 

ArakelTheDragon wrote:
Can someone please give me a hint in the right direction and how to find where the problem is?

The product documentation, and Vector site would seem the obvious place:

 

https://www.vector.com/int/en/support-downloads/support/

 

https://www.vector.com/int/en/support-downloads/support/#c54331

 

https://www.vector.com/int/en/support-downloads/knowledgebase/

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Mar 24, 2020 - 12:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its because I am planning on replacing the Vector VN with Microchip MCU PIC18F14K50, but so far neither that part, neither the software works. I need to know how to program this software and how to program the PIC18 later.

Last Edited: Tue. Mar 24, 2020 - 12:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ArakelTheDragon wrote:
because I am planning on replacing the Vector VN as well with Microchip base MCU PIC18F14K50
... and PICs are not supported here either. cheeky

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thats why I need support on the first part and the PIC part I will figure out when I can, since the PIC forum are not very familiar with CAN also.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The  vector VN1600 is a commercial product - nothing to do with Microchip, and nothing to do with Avr -  if you want support with it, you need to go through the manufacturer's support channels.

 

 

So you're looking at OBD ?

 

There are several Arduino  OBD projects & shields available - why don't you use one of those?

 

They will be open-source

 

EDIT

 

Try googling "OBD microcontroller" - that will find you plenty of projects, tutorials, etc.

 

You will soon find that very many of these are based on the ELM Electronics range of OBD interface chips:

 

https://www.elmelectronics.com/products/ics/obd/

 

That's probably going to be a better starting point than trying to hack a commercial product ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Mar 24, 2020 - 12:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its because I want to understand how to build the whole system, not to just take a ready project. I believe that even a simple serial terminal should be able to communicate with the VN or any USB to CAN interface and but I don't see it to be true. How does the software installed on the computer unlock the USB to CAN hardware? I need to send something so it can be recognized or there is a specific networking channel, I see people making such software with the VN1600 also and it works, but I can't make it or use a ready one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That doesn't make any sense!

 

How is taking a published, open project any different from hacking a commercial product?

 

You can use the project in place of the VN thing - rather than trying to hack the VN thing into doing something it is neither designed nor supported for.

 

How does the software installed on the computer unlock the USB to CAN hardware?

only VN can answer that!

 

Most likely, they will not answer it, because their business is to sell you the product & supporting services!

 

I see people making such software with the VN1600 also and it works,

So speak to those people, then!

 

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its not hacking it and its not in any way proprietary. Vector allows anyone with a license to use their VN with other tools which I see being used, but I still don't know how they built it and the support from Vector is "in-progress".

 

EDIT: I guess if they knew, they would not like it that I intend to replace the VN1600 with a different hardware, but its not in any way illegal.

Last Edited: Tue. Mar 24, 2020 - 01:05 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely this means you are going to have to implement the equivalent of CanOE on the micro ??

 

(I assume that when Vector VN1600 is driven from PC it is something like CanOE you are using - we do).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


clawson wrote:
CanOE

google was not very helpful on that:

 

 

laugh laugh laugh laugh laugh laugh 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Maybe he is up the creek without a paddle for said CanOE.

Ross McKenzie ValuSoft Melbourne Australia

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Vector device is a USB-to-CAN adapter. It has a proprietary comms protocol but there is a .DLL and example code available if, for example, you want to develop a PC app to talk to the CAN bus. So, dust off your C# or VB skills and follow the API docs.

 

Otherwise, get a $5 MCP2515-based CAN module from eBay and connect it to your preferred MCU using the SPI bus. There are Arduino libraries that can be used as a guide to the MCP2515's registers. ACAN2515 is a good example. You will need to know the CAN bus speed for your particular vehicle, but you should at least be able to view some CAN frames.

 

Talking to an ECU is not straightforward though. On modern cars, the accessible bus does not connect directly to the main ECU, as this would be unsafe. Also, the higher-level protocol may be encrypted, or at least unpublished. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vektor is possibly the "main player" in the CAN world. I'm pretty sure they are the ones who invented DBC file format for example. So they produce many software tools for the car industry:

 

https://www.vector.com/gb/en-gb/products/products-a-z/

 

and among those (foremost among those?) is CanOE:

 

https://www.vector.com/gb/en-gb/products/products-a-z/software/canoe/

 

It allows a very high level interface (because it uses things like Fibex, ARXML, DBC etc) to read and control the CAN devices on the multiple CAN busses in a modern vehicle. For those of us who actually do ECU development the Vektor software tools and hardware interfaces are as vital as ICEs, scopes and analyzers in other forms of embedded software development.

 

What OP seems to be thinking here is that he can replace the massively complex CanOE suite that you would usually use to drive a Vektor CAN/LIB/FB interface with an 8 bit micro. To be honest I don't know if Vektor even document the protocols on the USB interface between CanOE/PC and the USB-CAN interfaces. If this is all about giving a micro the capability to drive CAN to an ECU (in itself probably unwise - you can "sniff" the traffic to an ECU but driving it is a whole new ballpark!) then tryng to make use of a Vektor interface almost certainly is NOT the way to do it. Just get a generic micro that has USB and CAN interfaces (may need to trade up to 32 bit to get both) then decide on some USB controlling protocol (generic / HID / CDC perhaps ?) to do the PC to chip interface then do CAN out the other side in the direction of the auto/ECU

 

EDIT: 

but there is a .DLL and example code available if, for example, you want to develop a PC app to talk to the CAN bus

Ah, didn't know that, I thought the PC-VN interface protocol was completely proprietary. I still think a generic micro is going to be easier!

 Also, the higher-level protocol may be encrypted,

Indeed. Actually VERY secure indeed, esp in the case of potentially life threatening activity.

Last Edited: Tue. Mar 24, 2020 - 02:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ArakelTheDragon wrote:
I want to make a software to communicate with an ECU.

Perhaps if the OP explained what they intend to do by communicating with the ECU and which ECU they want to communicate with, someone may have more info for them.

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much! Post #13 and post #14 are very helpful. In order to use the CANoe library dll I will need to start checking some examples.

 

I am able to send and receive frames to the ECU. In truth it is possible to replace CANoe as some automotive brands do not use CANoe and require that you use their own specific tool through the VN1600 hardware. The x32 version of this tool(which is used instead of CANoe) is not working with the now x64 tools and Windows 10 leading to the development of a new one. CANoe acts like the serial terminal on the PC, its just a software on the PC which sends and receives frames to the ECU. CANoe works, the 32bit tool used instead of CANoe also works. It uses CAN and CAN FD. The interesting question is why did the VN1600 not recognize the software that I am developing now. Otherwise it would be the easiest to just replace the VN1600 with a generic USB to CAN hardware. It was important why doesn't the VN work before I start buying various things and putting them together. I will build the hardware(USB to CAN) based on the MCP2515 and MCP2561 and PIC18F14K50. My hardware should work with any serial terminal, but that is still to be tested.

 

EDIT: my original guess was correct, I need to unlock the VN and ECU, which happens with this .dll. Here is a link to the vector knowledge base:

https://kb.vector.com/entry/2/#

 

Can someone please point me to an example with this .dll. I can't find any.

 

This is the vector VN documentation:

https://assets.vector.com/cms/co...

Last Edited: Wed. Mar 25, 2020 - 10:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry for the double post.

 

It seems the people here know a lot about CAN and the tools for it, but they are afraid for the automotive secrecy.

 

Currently the tools that I have are as follows:

1. HiL -> with ControlDesk, INCA, CANoe, CANape, CANalyzer and many others.

2. Robert Bosch 1.3.1 TCU.

3. A software which we receive from the manufacturer(different brands). This software is unlocked and we can use it to test different functionality, mostly UDS service 0x19, 0x22, 0x23, 0x31.

 

Since there is a problem with the compatibility and I am planning on offering the customer to work as a subcontractor after I register my own company, I need to fix these problems. The x32 tool based on Vector hardware and VN1600/VN7610 needs to be replaced with a x64 one. The UML software for automation called EXAM does not work with the x32 tool which leads to serious block and I am unable to automate any tests, all have to be done manually.

 

I am also worried for the automotive secrecy and try not to tell you too much.

Last Edited: Thu. Mar 26, 2020 - 04:13 PM