Jump to content
  • 0

zybo z7-10 pmod CAN bit rate problem


daeroro

Question

Hi

I'm using pmod CAN module to communicate between zybo z7-10 and tms570LC4357 launch pad(Texas Instrument).

The connection is like this :

zybo z7-10( - Pmod CAN module) ----------------- CAN trasceiver(SN65HVD230) -- tms570LC4357 launch pad

 

I took a test with  zybo z7-10 - tms570LC4357 launch pad(bit rate = 250kbps),

the oscilloscope graph is the graph with delta x = 82us, 1/delta x = 12.2KHz.

And CAN doesn't work..

(the probe is picking CANH(red), CANL(yellow) in Pmod CAN module)

 

20190423_172628.jpg

 

I'd like to change bit rate, so I took a look the datasheet ( mcp25625).

And change registers CNF1, CNF2, CNF3

CNF1 (0x41) -> (0x09)
CNF2 (0xFB) -> (0xFF)
CNF3 (0x86) -> (0x87)

250kbps         -> 40kbps

 

but...!

the graph's period doesn't change at all..

 

Is there anything I shall do more things to change bit rate?


Sorry for bad english..

please answer..

thx!!

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Thanks for reply!!

I made vivado block design referencing this tutorial

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

1886896044_2019-04-2518-45-45.thumb.png.cbfa226a7aadd9356442b71368e7a151.png

And the sdk code reference is this

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

 

The mode TX.c example uses is normal!

 

Is this right that Pmod CAN has internal 20MHz clock source?

In the schematic below, CSTCE20MV13L99-R0 datasheet says it's 20MHz

1039320462_2019-05-0420-47-28.png.2d53465d15ba2edc4f58d019d403098f.png

 

Sorry for BAD english again..!

Thanks for reading!!

Link to comment
Share on other sites

16 hours ago, jpeyron said:

Hi @daeroro,

The Pmod CAN IP core does not use the interrupts.  How many Pmod CAN's do you have. If you have two Pmod CAN's are you able to run the loop back demo? The data sheet here will help you configure the Pmod CAN. 

 best regards,

Jon

Thanks for answering @jpeyron

Well,,, you missed the hyperlink of data sheet..

 

 

I already run the loop back demo and it did work properly.

1769158874_2019-04-1815-18-57.png.3d45d15c122eda72023ebe6210778bb3.png

 

What I really want to do is transmitting data from fpga(zybo-z7) to mcu(TMS570LC4357 launch pad).

So bit timing configuration is important, I think.

 

Is that right that if I change the bit rate, the oscilloscope waveform changes? (What I meant is deltaT in waveform below)

The deltaT(in below graph) doesn't change at all

528027405_2019-05-0722-58-03.png.d1ba742c464c1265b24c9138c04442e8.png

best regards,

daero

Link to comment
Share on other sites

I had the same problem with PMOD CAN and Arty S7 Board using Xilinx Vivado and SDK. Baud rate did not change at all.

The problem is the last byte in the CAN_ModifyReg command in PmodCAN.c file, which is "CAN_ModeConfiguration". The enumeration  CAN_Mode in PmodCAN.h is wrong/cannot be used in this way. CAN_ModeConfiguration has value 4  (0x04) but 0x80 is needed for the command. See chapter 5.9 "Bit Modify Instruction " and "CAN Control Register"  in the MCP25625 datasheet.

With this change, baud rate changes and CAN communication works. 

image.png.706e8f138bda3ec1a0efa86a9ca82755.png

image.png.ada5f5c8f6fdf6ac27c33feb798d1ffc.png

Link to comment
Share on other sites

Hi @Thies and @daeroro,

I have updated the following code to reflect the correct  CAN_ModeConfiguration register:

typedef enum CAN_Mode {
   CAN_ModeNormalOperation = 0,
   CAN_ModeSleep,
   CAN_ModeLoopback,
   CAN_ModeListenOnly,
   CAN_ModeConfiguration = 0x80
} CAN_Mode;

best regards,

Jon

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...