I am using the PCAN-USB Pro to introduce bus errors to test the response of my system and I have a few questions.
What exactly does the adapter do to destroy a frame at a given bit position, generate an error frame starting at that bit position? If I generate an error at each bit position, walking through the message from bit 1 to N, I was expecting to see the error frame move corresponding to the bit position but this doesn't seem to be the case.
Is bit position before or after bit stuffing? It seems to be before bit stuffing.
PCAN-USB pro starts to produce an error-frame (6 dominant bits) at the given bit-position.
But the bit position where a CAN-Error is detected by other nodes may vary.
The TRANSMITTER of the message will see an error as soon as it tries to send a recessive level that is owerwritten by the dominant level of the error frame. This may take up to 5 bittimes. (in case the transmitter wants to send 5 dominant bits there is no error-frame visible on the bus until the 6th bit is dominant - at the 6th position a stuff-but with recessive level is expected)
Any RECEIVER will detect an error-frame as soon as 6 dominant bits are received. This may be the case after 1 bittime (previous 5 bits were already dominant, first bit of error-frame overrides the recessive stuff-bit), and can take up to 6 bittimes (previous bit was recessive, stuff-error is detected after max. 6 bittimes)
Thanks for the quick reply.
Is Bit Position under Destroy Multiple Frames the bit position prior to bit stuffing?
I read in the manual that Destroy Multiple Frames only works on receive messages. Does this mean that you can inject error frames on transmit messages sent from PCAN-View but you must do this using the Destroy Single Frame mechanism?
the Bit-Position includes the stuff-bits, it is the position of the raw can frame that is transmitted on the physical lines.
If you want to destroy a transmit frame you can only use the single frame mechanism.
You could connect both CAN-channels of PCAN-USB pro and use the second CAN-channel to destroy multiple CAN-frames that you send on CAN-channel 1.
One more difference between "destroy single frame" and "destroy multiple frames":
The option "destroy multiple frames" needs a CAN-identifier. Therefor this works only once the arbitration phase is completed (CAN identifier completely transmitted on the bus). A bit-position within the arbitration field would not result in a destroyed CAN-message.
"Destroy single frame" destroys the next frame on the bus, either transmit or receive. The bit position can be any position within the complete frame (including arbitration field).
SOF bit is included in the count, SOF-Bit is at bit-position 0.
See attached picture:
Bitrate=500 kbit/s = 2µs/bit
Error-Generator is set to Bit-Position 24.
Count start at 0, therfore (24+1)*2µs=50µs. At this position a dominant level is generated.
Time betreen two orange cursor lines is 50µs. The red line indicate the position when a sequence of 6 dominant bits is detected.
- error-gen 500kbit.PNG (22.14 KiB) Viewed 4460 times