Discussion:
Bit Timing calculation
Thangapandeeswari Pandian
2003-08-07 08:51:15 UTC
Permalink
Hi,

I am working on CAN driver . i am getting Error Frames continously in CAN analyer while i am trying to transmit some message. i would like to know about my nit timimg calculation is correct.

Baud rate - 83.33 kbits/ sec.
System clock - 18.43MHz.
Nomianl Bit time is 16 tq (12 micro second)
location of sample point - 14 tq

Sync seg - 1tq
prop seg - 7 tq
phase seg - 4 tq
phase seg - 4tq

TSEG1 - 11 tq
TSEG2 - 4tq
SJW - 4 tq

I have calculated the BRP value using this formula

Baud rate = system clock / 2(BRP+1)(3+TSEG1 +TSEG2)

BRP = 6;

In can analzer, i have set the BAUD rate is 83.33 Kbits / sec and loaded the bit timing register value with C5 and 3A. I have chosen the sampling point at 75 %. Could ue help me why i am getting Error Frames.

Regards,
Eswari.





**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by the individual
or entity to which it is addressed. You are notified that any use, copying
or dissemination of the information contained in the E-MAIL in any manner
whatsoever is strictly prohibited.

***************************************************************************
Corrigan, Steve
2003-08-07 12:17:59 UTC
Permalink
Hi,



Try this one. http://www.intrepidcs.com/mcp2510/
<http://www.intrepidcs.com/mcp2510/>



Cheers,

Steve C.



-----Original Message-----
From: Thangapandeeswari Pandian [mailto:***@wipro.com]

Sent: Thursday, August 07, 2003 3:51 AM
To: ***@vector-informatik.de
Subject: [CANLIST] Bit Timing calculation



Hi,



I am working on CAN driver . i am getting Error Frames continously in CAN
analyer while i am trying to transmit some message. i would like to know
about my nit timimg calculation is correct.



Baud rate - 83.33 kbits/ sec.

System clock - 18.43MHz.

Nomianl Bit time is 16 tq (12 micro second)

location of sample point - 14 tq



Sync seg - 1tq

prop seg - 7 tq

phase seg - 4 tq

phase seg - 4tq



TSEG1 - 11 tq

TSEG2 - 4tq

SJW - 4 tq



I have calculated the BRP value using this formula



Baud rate = system clock / 2(BRP+1)(3+TSEG1 +TSEG2)



BRP = 6;



In can analzer, i have set the BAUD rate is 83.33 Kbits / sec and loaded the
bit timing register value with C5 and 3A. I have chosen the sampling point
at 75 %. Could ue help me why i am getting Error Frames.



Regards,

Eswari.










**************************Disclaimer************************************



Information contained in this E-MAIL being proprietary to Wipro Limited is

'privileged' and 'confidential' and intended for use only by the individual

or entity to which it is addressed. You are notified that any use, copying

or dissemination of the information contained in the E-MAIL in any manner

whatsoever is strictly prohibited.



***************************************************************************
l***@VisionAndAutomation.com
2003-08-07 16:05:40 UTC
Permalink
MessageI want to look at how CAN messages are actually defined (what's put
in arbitration IDS, data sent and read back etc. ) in order to learn how to
define my own message set, and I can't find something like that. Is all that
stuff proprietary and secret? I downloaded the J1939/21 an J2284/3 from SAE
but is there is no specific examples, only generalities. Can anyone point
at or send some actual messaging examples? I need to send commands and
receive an ACK and data or a NAK in a master multislave configuration in an
industrial testing application.

Thanks

lvilla
John Dammeyer
2003-08-07 17:52:43 UTC
Permalink
Hi Ivilla,

It's not completely secret. For the CiA CANOpen you have to belong to
the group ($500US I think) in order to access the documents that explain
their protocol. For DeviceNet membership also costs. Most of the
Automotive protocols require membership to the SAE. Honeywell has the
SDS; it may be free. CAN Kingdom is free.

In other words to evaluate various protocols you'll need to spend a few
thousand dollars and a few months to learn their protocols before you
can decide if one is better than the other for your application.
Another alternative is to hire a consultant (not me) that is experienced
in all of the above and have them first analyze your project and then
suggest the best protocol for you. That will probably also cost you
roughly the same amount but takes far less time.

There is a book being published by the Tutor's Group which explains
CANOpen fairly well. I think there is also a book written in German
(There might be a translation in English) available from CiA; check
their WEB site.

There have been various articles published in Circuit Cellar Magazine.
One on CANOpen that gives a simple overview. Don't remember off hand
which issue. I wrote an article on CANRF that is in the latest Aug2003
issue. In that article I explain a bit on MAPCAN.

MAPCAN is a different approach to ID usage from most of the other
protocols.

MAPCAN breaks the ID values into rings much like a RTOS. The first two
bits identify the ring # where lowest is highest priority and represents
interrupts or signals. The second ring is used for device and device
driver communications; the third for Task or Thread communications and
the 4th ring for file or large block transfers which should have the
lowest priority.

The next bit in the ID represents a Client/Server or in other words,
message direction. The last 8 in an 11 bit ID are either Task ID of
Sender or, Device Class (such as A/D, Ports, Keypad, Encoder, Motor
etc.) and Device # of sender. With 11 bit IDs the destination task or
device is in the first data byte; with 29 bit IDs the destination
follows the source in the ID part.

Hope that helps.

John Dammeyer


Wireless CAN with the CANRF module now available.
http://www.autoartisans.com/products
Automation Artisans Inc.
Ph. 1 250 544 4950


-----Original Message-----
From: canlist-***@vector-informatik.de
[mailto:canlist-***@vector-informatik.de] On Behalf Of
***@VisionAndAutomation.com
Sent: Thursday, August 07, 2003 9:06 AM
To: ***@vector-informatik.de
Subject: [CANLIST] CAN messaging examples


I want to look at how CAN messages are actually defined (what's put in
arbitration IDS, data sent and read back etc. ) in order to learn how to
define my own message set, and I can't find something like that. Is all
that stuff proprietary and secret? I downloaded the J1939/21 an J2284/3
from SAE but is there is no specific examples, only generalities. Can
anyone point at or send some actual messaging examples? I need to send
commands and receive an ACK and data or a NAK in a master multislave
configuration in an industrial testing application.

Thanks

lvilla
Heinz-Jürgen Oertel
2003-08-07 20:23:49 UTC
Permalink
Post by John Dammeyer
Hi Ivilla,
It's not completely secret. For the CiA CANOpen you have to belong to
the group ($500US I think) in order to access the documents that explain
their protocol.
..[more]...

http://www.can-cia.org/services/cialiterature/
You need CiA DS 301 (Version 4.02)
"CANopen Application Layer and Communication Profile" and you don't have to
belong to CiA!
The document amounts to 65,00 Euro (+ postage) for non Germans.
Don't think that we ever reach an exchange rate adequate to US $500.

Regards Heinz


+===================================================================
| Heinz-Jürgen Oertel port GmbH http://www.port.de
| mailto:***@port.de
| phone +49 345 77755-0 fax +49 345 77755-20
| Regensburger Str. 7b, D-06132 Halle/Saale, Germany
| CAN Wiki http://www.port.de/cgi-bin/CAN
| Newsletter: http://www.port.de/engl/company/content/abo_form.html
+===================================================================


--
Archives and useful links: http://groups.yahoo.com/group/CANbus
Subscribe and unsubscribe at www.vector-informatik.com/canlist/
Report any problems to <canlist-***@vector-informatik.de>
Tutors of ESAcademy
2003-08-08 05:33:50 UTC
Permalink
Hi lvilla,
Post by l***@VisionAndAutomation.com
MessageI want to look at how CAN messages are actually defined
(what's put
Post by l***@VisionAndAutomation.com
in arbitration IDS, data sent and read back etc. ) in order to
learn how to
Post by l***@VisionAndAutomation.com
define my own message set, and I can't find something like that.
For a quick overview on how CANopen uses the CAN identifiers see our
online training classes at:

http://www.esacademy.com/myacademy

Select "Introduction to CANopen" and go to slide 18

For more details select the full-day CANopen class, go to
Contents: Intermediate and select the Message details

Olaf

Tutor at ESAcademy
www.esacademy.com
www.microcanopen.com




--
Archives and useful links: http://groups.yahoo.com/group/CANbus
Subscribe and unsubscribe at www.vector-informatik.com/canlist/
Report any problems to <canlist-***@vector-informatik.de>

lalita godbole
2003-08-07 16:26:39 UTC
Permalink
I like to check by hooking up an oscilloscope between CAN_H and CAN_L.
It will tell you if the bit rate is actually set to 83.33 kbits/sec, and
if not by how much it is off.


Also,

sysClk
------------------------------------ = number of Tq in 1 bit
time
(bit rate * 2 * (BRP + 1))

From the numbers you mention

18.43 MHz
-------------------------------------------- = 15.79 = number of tq in
1 bit time
2* (83.33 * 1000) * (6 + 1)


15.79 = 3 + TSEG1 + TSEG2

TSEG1 + TSEG2 = 12.79 rounded up to 13

The values you mention add up to more than this:
TSEG1 - 11 tq
TSEG2 - 4tq


Lalita



-----Original Message-----
From: canlist-***@vector-informatik.de
[mailto:canlist-***@vector-informatik.de] On Behalf Of
Thangapandeeswari Pandian
Sent: Thursday, August 07, 2003 1:51 AM
To: ***@vector-informatik.de
Subject: [CANLIST] Bit Timing calculation


Hi,

I am working on CAN driver . i am getting Error Frames continously in
CAN analyer while i am trying to transmit some message. i would like to
know about my nit timimg calculation is correct.

Baud rate - 83.33 kbits/ sec.
System clock - 18.43MHz.
Nomianl Bit time is 16 tq (12 micro second)
location of sample point - 14 tq

Sync seg - 1tq
prop seg - 7 tq
phase seg - 4 tq
phase seg - 4tq

TSEG1 - 11 tq
TSEG2 - 4tq
SJW - 4 tq

I have calculated the BRP value using this formula

Baud rate = system clock / 2(BRP+1)(3+TSEG1 +TSEG2)

BRP = 6;

In can analzer, i have set the BAUD rate is 83.33 Kbits / sec and loaded
the bit timing register value with C5 and 3A. I have chosen the sampling
point at 75 %. Could ue help me why i am getting Error Frames.

Regards,
Eswari.





**************************Disclaimer************************************



Information contained in this E-MAIL being proprietary to Wipro Limited
is

'privileged' and 'confidential' and intended for use only by the
individual

or entity to which it is addressed. You are notified that any use,
copying

or dissemination of the information contained in the E-MAIL in any
manner

whatsoever is strictly prohibited.



************************************************************************
***
Continue reading on narkive:
Loading...