• 0
daeroro

pmod can period

Question

Hello, I'm working on zybo z7 & pmod can

I want to transmit data from zybo z7 to other board(not zybo, tms570lc43x launchpad).

 

So I took a test :

(computer) - (usb2can) --------------------------- (can transceiver) - (tms570 board).

 

It really worked well.

 

426982104_2019-05-2220-53-40.thumb.jpg.74cdbe1ea895847459cd4f25ecf8158c.jpg

 

But I took a test like this:

(zybo-z7) - (pmod can) -------------------------------------- (can transceiver) - (tms570 board)

 

It doesn't work!!!!!

1577124217_2019-05-2220-54-33.thumb.jpg.b7e1ccea8ec2d93dc63bdc7459240e4f.jpg

 

and the signal period is about 8 times slower than above picture..

How can I make it work?

I need your advice

 

thanks!!

 

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
10 hours ago, vicentiu said:

Are you using Linux or bare metal on the Zybo Z7?

Hi, vicentiu.

I'm using vivado + sdk

-hardware design : https://reference.digilentinc.com/learn/programmable-logic/tutorials/pmod-ips/start

-sdk example : https://github.com/Digilent/vivado-library/blob/master/ip/Pmods/PmodCAN_v1_0/drivers/PmodCAN_v1_0/examples/TX.c
 

 + I ran the Lookback.c  example and it worked!!

Share this post


Link to post
Share on other sites
  • 0

Hi @daeroro,

It looks like you have been able to alter the bit rate which was discussed in your other post here

I would suggest exposing the signals between the Pmod Can and the Zybo and using an oscilloscope on these signals.

Do you have a CAN bus analyzer so you can better see what is being communicated between the Pmod CAN and the tms570 board?

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
19 hours ago, jpeyron said:

Hi @daeroro,

It looks like you have been able to alter the bit rate which was discussed in your other post here

I would suggest exposing the signals between the Pmod Can and the Zybo and using an oscilloscope on these signals.

Do you have a CAN bus analyzer so you can better see what is being communicated between the Pmod CAN and the tms570 board?

best regards,

Jon

Hi, @jpeyron

Thanks for reply.

 

Unfortunately, I can't alter the bit rate.

The graph was changed even if I used same hardware design and SDK example. I don't know why.

 

Have you ever tried to change bit rate and it worked??

thanks!!

Edited by daeroro

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Well, I figure out a bug in the example code.

In the CAN_Configure function :


   // Set CAN control mode to configuration
   CAN_ModifyReg(InstancePtr, CAN_CANCTRL_REG_ADDR, CAN_CAN_CANCTRL_MODE_MASK,
         CAN_ModeConfiguration );

 

needs to be changed like this:

 

   CAN_ModifyReg(InstancePtr, CAN_CANCTRL_REG_ADDR, CAN_CAN_CANCTRL_MODE_MASK,
         CAN_ModeConfiguration << CAN_CANCTRL_MODE_BIT);

 

So it can enter the configuration mode...

After changing the code, CAN communication between Zybo-z7 and MCU works really well.

 

You need to change your git example code.

 

Edited by daeroro

Share this post


Link to post
Share on other sites
  • 0

Hi @daeroro,

Thank you for sharing a resolution to an issue with the Pmod CAN driver. We will pass this information on to our content team.

best regards,

Jon

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