• 0
Lakshmi Tejas M A

CAN interface with analog discovery 2

Question

Hi all

i am using Analog discovery 2 for communication purpose.(CAN)

I tried using the sample code given same as attached.

I am using PCAN to send/receive frames to analog discovery 2 , I am sending only one frame with Standard ID : 0x011 and Data: 0xaa 0xbb 0xcc 0xdd 0xee 0xff

but i am receiving lot of Frames with the same ID sent, lot of extended remote frames with CRC errors ,etc. I have attached the console output for reference. Can I know why i am facing the issue?

I tried same experiment with waveforms still having similar issue. I have attached the screen shot of it.
 

 

Digital_Can.py

CAN_Console.txt

Can.PNG

Edited by Lakshmi Tejas M A
Added waveform screenshot

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0
18 hours ago, attila said:

Hi @Lakshmi Tejas M A

It looks like your signal has high polarity. Set the Polarity to High in Logic Analyzer CAN interpreter options.
image.png.5597e10f812131f09f9417c6ae8e7d42.png

To use the high option in the Protocol tool and SDK please update to WF v3.8.6:
https://forum.digilentinc.com/topic/8908-waveforms-beta-download/

 

i tried that option of High and Low. I put CAN to High and CAN2 to LOW. still i get the similar erro. Attached screenshot

Capture.JPG

Edited by Lakshmi Tejas M A
Mistake edited

Share this post


Link to post
Share on other sites
  • 0

Hi @Lakshmi Tejas M A

Make sure the digital signal voltage levels are correct.
The digital input logic threshold is around 1.4V with protection to 0V and 3.3V.
When connecting signals out of this range use a series resistor of about 10k to limit the sink current.

 

Share this post


Link to post
Share on other sites
  • 0

Hi @Lakshmi Tejas M A

The CAN bus signals are differential.
To decode these with the AD2 logic analyzer you either need a transceiver to 3.3V logic or you may try using adaptor resistor/voltage divider. In this case it is suffice to connect one of signals low or high and of course the ground signal.

The AD2 inputs are 3.3V or 1.8V compatible, with logic threshold at ~1.4V and ~0.5V
To see the received voltage levels by the digital IOs use the oscilloscope inputs.

See the following posts and the references in it:

 

Share this post


Link to post
Share on other sites
  • 0

Hi @attila

Thank you for the suggestion to use the transceiver(using python). 

  1. transmission from AD2 to PCAN is happening (ID: 0x3fd DLC: 4 Data: 0x00 0x01 0x02 0x03)
  2. receiving in AD2 from PCAN(only one frame sent ID=0x135,DLC=3,Data=0xCC 0x01 0x01) I am still getting lot of frames(repeated correct frames, CRC error frames etc), I have attached the console of the same. Can you help me with this?
  3. Is there any option to not receive signals that are transmitted from ad2 itself? (self transmitted) 
  4. also wanted to know why i am reading the same signal again and again?
  5. I am using the sample code given.

image.png

Console.txt

Share this post


Link to post
Share on other sites
  • 0

Hi @Lakshmi Tejas M A

In first phase try to use the WaveForms application to be easier to trace the issues.
Like use Scope to see the voltage levels on TX/RX, use the Logic Analyzer or Protocol with Debug mode to see the signal timings... like this:

image.thumb.png.48e951ef1035b7c7c01808ea553ce0e7.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now