cancel
Showing results for 
Search instead for 
Did you mean: 

CAN

e239955_stm1_stmicro
Associate II
Posted on February 15, 2005 at 09:46

CAN

4 REPLIES 4
e239955_stm1_stmicro
Associate II
Posted on February 14, 2005 at 10:49

Hi,

I work, at the moment, on CAN. I made feew try to understand how to configure it.

My questions are :

* There are default Baudrate. With which clock frequency are they available ? I suppose the default one. (Which is it ?)

* Then I made many tried with a CAN bus and a CAN dongle.

I would like to have an 100k baudrate, with my specified clock frequency (100k baudrate are calculated with the clock's excel file).

I assumed, after Bus Off error, that the baudrate could be false. I had a look with an oscilloscope and I got a 125k baudrate. Why is it not the wanted baudrate ? Is there a fault in the Excel file ?

PS : I have attached my test file.

Thanks

________________

Attachments :

CAN_test.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Am&d=%2Fa%2F0X0000000bmc%2FXHyk_TJH_pG4zJ9qluqzQ3k4aSEqtjZt5nWzrGgoKXw&asPdf=false
ben2
Associate II
Posted on February 14, 2005 at 11:01

have you checked you are actually running at the freqeuncy you think you are. Check on the CK pin.

I believe there is an error in the st710 datasheet prior to version 5.

It says that there is a x28 multiplier for the PLL when it is only 24.

The excel speadsheet also has 28x multiplier in it, at least the copy I have. Maybe this is causing you problems.

I am running the core at 48Mhz and have a CAN frequency of 100k baud using the following values on the STR710 eval board

Have the PLL set to x12 /2 to give me a 48Mhz cpu frequency.

and have the following values in the CAN registers

BRPR = 0

BTR = 34d7 hex

edit : sorry forgot to add have divide by 2 on PCLK's

[ This message was edited by: ben_fnr on 14-02-2005 15:32 ]

e239955_stm1_stmicro
Associate II
Posted on February 14, 2005 at 11:47

Thanks ben_fnr,

That 's works well ...

I found my error. The result obtained by the excel files (BRP, Tseg1, Tseg2, Sjw) are the result with already - 1, and in the library, CAN Timing function soustracts again one .

(For example : Excel Files : SJW [0..3] and Library : SJW [1..4])

Regards

davidbellegarde9
Associate II
Posted on February 15, 2005 at 09:46

You are right. A confusion may happened.

In the library, tseg1, tseg2 and SJW are related to the real one. But in the “STR71x_Calculation.xls“, SJW, TSeg1, TSeg2 stand for the register value so all of them have to be increased by 1 to obtain the physical values.

Or if you know the real values, simply use them with the library and decreased them by 1 should give the register values which have to be written, which correspond to the values of the xls file.

This way to implement registers can be heavy and source of confusion/misunderstanding but is mandatory to avoid a added bit in the register. I mean to have for instance 16 available values with a four bit long register.

Regards.