CAN Communication

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello

   

I have CY8CKIT-030 board kit and CY8CKIT-017 CAN board, I try to listen CAN communication and for this reason, I installed on my board the CAN example.

   

But CAN protocol is extended (29 bits), and Bitrate=50kbit, and I don't know where I must change CAN parameter to listen correctly.

   

In my example, the application return me Rx errors and I think that the problem is CAN configuration.

   

I changed differents parameter in CAN setup, but it doesn't work ok

   

 

   

Thank you in advanced

0 Likes
12 Replies
Anonymous
Not applicable

I have a CAN controller to 50 Kbps... and then I put this values to configure CAN:

   

Settings

   

BRP=41

   

Tseg1=3

   

Tseg2=5

   

Calculator

   

24000KHz (disabled)

   

Desired Baud rate= 20Kbps

   

SJW=1

   

Sample Mode=1-Sample

   

 

   

Are these values correct?

   

Thank you

0 Likes
Anonymous
Not applicable

Hi,

   

I assume you are using two PSoC CY8CKIT-001s  and two CY8CKIT-017s for the CAN communication. Make sure that the settings for CAN component in both the PSoCs are the same for 'Timing' tab. 

   

Try these:

   

Settings

   

BRP = 2

   

TSEG1 = 11

   

TSEG2 = 4

   

Calculator

   

Clock frequency = 24000kHz

   

Desired Baud Rate = 500Kbps

   

SJW = 1

   

Sample mode = 1-Sample

0 Likes
Anonymous
Not applicable

 Hi,

   

You can also go to the following link and download the project with this Application Note and try it.

   

http://www.cypress.com/?rID=37766

   

Another sample project is available within the PSoC Creator itself. Go to the Start page, in Examples and Kits section, choose Find Example Project. Program the CANExampleControl project in one PSoC and CANExampleRemote in the second PSoC. 

   

Thanks,

   

Ranjith

0 Likes
Anonymous
Not applicable

I use a CAN example, but the application return me Rx errors then I suppose that the problem is with timing parameters.

   

I don't know what values introduce to use a device 50 kbps and 12 Mhz

0 Likes
Anonymous
Not applicable

I use a CAN extended transmiter connected to CY8CKIT-017 and this to CY8CKIT-030. 

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can use the timing calculator to calculate the values. Just enter the desired baud rate. After that, the table below show possible values. Check the CAN component data sheet (page 5) for an explanation of these values.

   

I would suggest a setting of BRP=39, Tseg1=5, Tseg2=6. This gives a sample point right in the middle of the cycle.

   

For the 29 bit protocol, look at the data sheet again (page 12 ff). There you see that you need to configure the mailbox correctly (set it to Full=yes, IDE=yes, then you can enter a 29-bit address).

0 Likes
Anonymous
Not applicable

If my CAN transmitor has clock 16 Mhz, I must change Cypress project demo and I must modify BUS_CLK to 16Mhz?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The crystal frequency of the CAN bus master should not matter, only the baud rate. So when you have set the CAN component to the correct baud rate, you should be fine.

0 Likes
Anonymous
Not applicable

Ok, It works fine with 125 Kbps, but could I configure Crypress project to use 50 Kbps?

   

In desired Baud rate options, there are posibilities: 1000, 800, 500, 250, 125, 62.5, 20, 10

   

 

   

Thank you

0 Likes
Anonymous
Not applicable

With BRP 39 Tseg1 5 and Tseg2 6, I think that it works ok

   

 

   

Thank you

0 Likes
Anonymous
Not applicable

 Always choose the desired baud rate in the CAN component and select appropriate BRP, TSeg1 and Tseg2 from the drop down menu so that the sample point comes in the middle.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I don't think it makes much sense to answer questions one year old. The person asking the question either has solved it by now or given up. And even if you do - provide _new_ information and don't repeat what has been said before...

0 Likes