ts-7000
[Top] [All Lists]

[ts-7000] TS-CAN1 and odd (non-1K) baud rates

To:
Subject: [ts-7000] TS-CAN1 and odd (non-1K) baud rates
From: "ak12181966" <>
Date: Thu, 23 Jul 2009 11:37:54 -0000
Greetings,

I'm posting this because I thought it might be of use to somebody else at some 
point...

I purchased the TS-CAN1 for use with a TS-7800 system in an automotive 
application.  For those that don't know, this application typically uses the 
following baud rates:  500kbps, 125kbps and 83.333kbps.

With the TS-CAN1, there is a command-line parameter to set the desired baud 
rate when the CAN driver module is loaded, for example:

insmod -f /usr/lincan/modules/lincan.ko hw=tscan1 baudrate=125

In my early testing, this seems to make the CAN bus operate fine at 125K and 
500K.  All was well...  However, it is a problem specifying 83.333 on the 
command line because the "baudrate" parameter only accepts an integer argument.

Faced with trying to build the ocera lincan sources myself, and, if that was 
successful, attempting to change the sources and have it actually work so that 
my non-1K-integer baud rate would work....OR....thinking of looking into how 
much it would cost for Technologic Systems to do such a thing for me, I was a 
bit daunted and discouraged.

Then I noticed that there is also a "clockfreq" parameter that can be passed to 
insmod when loading the module.  I got to wondering if I could play with the 
baudrate and clockfreq parameters together to achieve my needed 83.333K baud 
rate.

The short answer is yes, I could.  It seems that clockfreq is only used, in 
conjunction with baudrate, to set the CAN bus speed.  What I needed was a round 
number (an integer 1K value) for each parameter that would yield a non 1k 
integer speed value on the actual CAN bus.

Looking at the TS-CAN1 board, I noticed that it has a 16MHz crystal, thus I 
believed (correctly) that the default clockfreq parameter is 16000.  Doing some 
math, 16000 / 83.333 yields 192, so I theorized that any combination of integer 
values for clockfreq and baudrate that had a ratio of 192-to-1 would give me 
83.333K on the actual CAN bus.

Turns out that this idea is correct.  Here's what I ended up with to achieve my 
desired 83.333K rate:

insmod -f lincan.ko hw=tscan1 baudrate=100 clockfreq=19200

Executing this and hooking up a test tool operating at 83.333K and then 
executing:

sendburst -d/dev/can0 -w1 -b3 -i1
(example from the TS-CAN1 documentation)

showed that messages were being properly received in my CAN tool.





------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] TS-CAN1 and odd (non-1K) baud rates, ak12181966 <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU