# CAN stress test-creating some shorts on the CAN BUS

#### gxg513

Joined Oct 8, 2017
19
Hi all,

I have a project at my school and i need to create a circuit that through some switches creates some shorts on the CAN BUS.For example if I press on SWITCH1 in state A , I will create a short between CANH-CANL ,if i press on SWITCH 1 on the other state I will create a short between CANH-GND,
For SWITCH2,SWITCH3 etc other combinations: CANL-GND, CANH-CANL-GND , CanH- VDD(12 V) and CanL-VDD(12 V).

So i already done the PCB ,the simulations and now I want to test it.And there are some issues.
1)If i do not have a car ECU can I do the tests with a signal generator,and osciloscop just to check if the shorts occurs?
( if the ECU works the same way as the signal generator )
2) very important, what is the aplicability because the teacher told me that if you do some shorts on CAN the ECU.The frames will recover in a few seconds after you eliminate the short.I was wonder what can be the aplicability in this device (i did not find it on the internet) , because if we eliminate the shorts on any circuit( if the device is protected to big currents) will work after that just the same.If you know or you can provide me any documents about this process in the ECU ,it will mean a lot to me.

Thank you very much and i hope someone can help me with some answers.

Mod edit: cleaned up title for clarity - JohnInTX

Last edited by a moderator:

#### JohnInTX

Joined Jun 26, 2012
4,008
1) To test your switches, why not use a separate CAN driver chip to emulate the driver in that expen$ive ECU? You can inject a simple square wave by sending signals on the driver's inputs (complementary signals) and see what your shorting does. Make sure it doesn't smoke the hardware - it shouldn't but if it does, at least it's cheap. 2) I don't know what your teacher has in mind but I would do something like this to prove out the bus hardware i.e. can it take some abuse and recover without damage and if that is OK, connect it up to the real bus to see how the CAN messaging software manages bus problems i.e. does it detect failed messages? does it recover when/if the bus problems recover? What happens in the interim? Does a bus failure mean you can't do something important? What then? That's how I would approach it. Good luck! Thread Starter #### gxg513 Joined Oct 8, 2017 19 1) To test your switches, why not use a separate CAN driver chip to emulate the driver in that expen$ive ECU? You can inject a simple square wave by sending signals on the driver's inputs (complementary signals) and see what your shorting does. Make sure it doesn't smoke the hardware - it shouldn't but if it does, at least it's cheap.
2) I don't know what your teacher has in mind but I would do something like this to prove out the bus hardware i.e. can it take some abuse and recover without damage and if that is OK, connect it up to the real bus to see how the CAN messaging software manages bus problems i.e. does it detect failed messages? does it recover when/if the bus problems recover? What happens in the interim? Does a bus failure mean you can't do something important? What then?
That's how I would approach it.

Good luck!
1) What is CAN driver chip ? can you give me more details please? is the microcontroller who will generate the can frames?

2)So the can node should detect if the frame is defect but how cand i check that? in my circuit I will only have one can frame from the ecu and my device that will create the shorts on CAN and of course the voltage source.
I wanted to say that I not very familiar with the automotive , i only know the electronic part.Thank you

#### JohnInTX

Joined Jun 26, 2012
4,008
1) The driver interfaces the micro controller CAN logic with the physical bus. You indicated that you wanted to test your circuit for stressing the bus, I suggested you use a cheap driver chip for that test. That way, if you made a mistake and your stress test circuit damages the bus driver, it is just the cheap chip, not the expensive ECU. once you are satisfied that your stress circuit will not cause permanent damage, you can use it on a real CAN system.
A typical driver:
https://www.microchip.com/wwwproducts/en/MCP2561

2) The CAN logic in the micro controller will have error registers that count the various errors it finds on the bus. Your program needs to examine these registers to see how things are going. Most CAN implementations will take themselves off the bus if there are too many errors detected. You will have to read up on the CAN controller for your particular chip.