HCS12 and CAN-module

Started by mlammila November 25, 2003

I used before HC12 (60 and 128) and it's msCAN-module which worked fine.
Now I have tried to use MC9S12D64 microcontroller's msCAN-module and I
have got it to send messages (checked with oscilloscope) but there is
something wrong in the sending because my monitor program (national
intruments PCMCIA can card) gives framing error. I have tried to check
prescaler and timequanta register's settings but everything seems to
be ok.

Is there some radical differencies between old HC12 and the new HCS12
? One thing which I noticed was the using of the transmitting
registers (the new one 3 transmitregister is mapped to one register
which is visible to user and which must choose trough register) but is
there something else which I should consider when using msCAN-module ? Mika Lammila



You should check out AN2011/D - The MSCAN on the S12 compared with the
MSCAN on the HC12.

It details the differences (registers, etc)

John
http://embedded.mistekllc.com
> -----Original Message-----
> From: mlammila [mailto:]
> Sent: Tuesday, November 25, 2003 2:33 PM
> To:
> Subject: [68HC12] HCS12 and CAN-module >
> I used before HC12 (60 and 128) and it's msCAN-module which
> worked fine. Now I have tried to use MC9S12D64
> microcontroller's msCAN-module and I have got it to send
> messages (checked with oscilloscope) but there is something
> wrong in the sending because my monitor program (national
> intruments PCMCIA can card) gives framing error. I have tried
> to check prescaler and timequanta register's settings but
> everything seems to
> be ok.
>
> Is there some radical differencies between old HC12 and the
> new HCS12 ? One thing which I noticed was the using of the
> transmitting registers (the new one 3 transmitregister is
> mapped to one register which is visible to user and which
> must choose trough register) but is there something else
> which I should consider when using msCAN-module ? > Mika Lammila
> > ------------------------ Yahoo! Groups Sponsor
> ---------------------~--> Buy Ink Cartridges or Refill Kits
> for your HP, Epson, Canon or Lexmark Printer at MyInks.com.
> Free s/h on orders $50 or more to the US & Canada.
> http://www.c1tracking.com/l.asp?cidU11
>
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/dN_tlB/TM
---------------------------------~->

--------------------
">http://docs.yahoo.com/info/terms/


I have been writing an MSCAN protocol for the past 2 months and have had
about every problem that I ever imagined. Your problem sounds very similar
to one of my problems. I would get out a scope and send an empty standard
frame with IDR0 thru IDR3 all set to $00 and trigger on the frame sent,
measure the smallest bit width and verify your bit rate being sent and
received are what you expect. Also check out www.port.de where you will
find a calculator for the BTR0 and BTR1 registers. There are several ANs
from Motorola that are quite good and I have a list at work if you want a
copy. There is also a group "canbus" on yahoo that is solely for CAN but
you have to join it via vector-informatik.de not yahoo which is only a
mirror site.

Thanks for posting a CAN message, for a while I thought no one on this site
was interested in CAN.
Sydney Faria
----- Original Message -----
From: mlammila
To:
Sent: Tuesday, November 25, 2003 2:33 PM
Subject: [68HC12] HCS12 and CAN-module
I used before HC12 (60 and 128) and it's msCAN-module which worked fine.
Now I have tried to use MC9S12D64 microcontroller's msCAN-module and I
have got it to send messages (checked with oscilloscope) but there is
something wrong in the sending because my monitor program (national
intruments PCMCIA can card) gives framing error. I have tried to check
prescaler and timequanta register's settings but everything seems to
be ok.

Is there some radical differencies between old HC12 and the new HCS12
? One thing which I noticed was the using of the transmitting
registers (the new one 3 transmitregister is mapped to one register
which is visible to user and which must choose trough register) but is
there something else which I should consider when using msCAN-module ? Mika Lammila --------------------


You monitor the bus with an oscope so did you get a continuous stream or
just on frame of bits. this is easiest to see with a single frame with no
data and IDR0-IDR3 all set to $00. If you get a continuous stream, most
likely you have a timing problem, or your buss has a physical problem such
as reflections. If you get only one frame sent then you know that you have
sent and recognized (via the ACK bit) and the timing is not a problem
otherwise the ACK bit would not have been seen by the sender. There are a
lot of Motorola ANs, but you may want to check out www.port.de for a known
good BTR0,BTR1 register value with their calculator. I you get only one
frame sent, then you have to be able to check the Rx buffer to see if the
frame passed the filter mechanism.
SCF
----- Original Message -----
From: John Theofanopoulos
To:
Sent: Tuesday, November 25, 2003 3:06 PM
Subject: RE: [68HC12] HCS12 and CAN-module You should check out AN2011/D - The MSCAN on the S12 compared with the
MSCAN on the HC12.

It details the differences (registers, etc)

John
http://embedded.mistekllc.com
> -----Original Message-----
> From: mlammila [mailto:]
> Sent: Tuesday, November 25, 2003 2:33 PM
> To:
> Subject: [68HC12] HCS12 and CAN-module >
> I used before HC12 (60 and 128) and it's msCAN-module which
> worked fine. Now I have tried to use MC9S12D64
> microcontroller's msCAN-module and I have got it to send
> messages (checked with oscilloscope) but there is something
> wrong in the sending because my monitor program (national
> intruments PCMCIA can card) gives framing error. I have tried
> to check prescaler and timequanta register's settings but
> everything seems to
> be ok.
>
> Is there some radical differencies between old HC12 and the
> new HCS12 ? One thing which I noticed was the using of the
> transmitting registers (the new one 3 transmitregister is
> mapped to one register which is visible to user and which
> must choose trough register) but is there something else
> which I should consider when using msCAN-module ? > Mika Lammila >
> ------------------------

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


Hello:
I'm planning to implement a CAN lab in our post diploma course on embedded
controllers. The course uses the HCS12 EVB board from Motorola and I would
like to integrate 8 of these boards using CAN interface. We use the
Codewarrior development system.

It would be great if I could either get hold of some C source code to begin
implementation or some useful reference material.

Any help would be greatly appreciated.

Thanks very much,
Len Klochek
John Theofanopoulos wrote:

> You should check out AN2011/D - The MSCAN on the S12 compared with the
> MSCAN on the HC12.
>
> It details the differences (registers, etc)
>
> John
> http://embedded.mistekllc.com
>
> > -----Original Message-----
> > From: mlammila [mailto:]
> > Sent: Tuesday, November 25, 2003 2:33 PM
> > To:
> > Subject: [68HC12] HCS12 and CAN-module
> >
> >
> >
> > I used before HC12 (60 and 128) and it's msCAN-module which
> > worked fine. Now I have tried to use MC9S12D64
> > microcontroller's msCAN-module and I have got it to send
> > messages (checked with oscilloscope) but there is something
> > wrong in the sending because my monitor program (national
> > intruments PCMCIA can card) gives framing error. I have tried
> > to check prescaler and timequanta register's settings but
> > everything seems to
> > be ok.
> >
> > Is there some radical differencies between old HC12 and the
> > new HCS12 ? One thing which I noticed was the using of the
> > transmitting registers (the new one 3 transmitregister is
> > mapped to one register which is visible to user and which
> > must choose trough register) but is there something else
> > which I should consider when using msCAN-module ?
> >
> >
> > Mika Lammila
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > ---------------------~--> Buy Ink Cartridges or Refill Kits
> > for your HP, Epson, Canon or Lexmark Printer at MyInks.com.
> > Free s/h on orders $50 or more to the US & Canada.
> > http://www.c1tracking.com/l.asp?cidU11
> >
> http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/dN_tlB/TM
> ---------------------------------~->
>
> -------------------- >
> ">http://docs.yahoo.com/info/terms/ > -------------------- >
> ">http://docs.yahoo.com/info/terms/






At 10:48 PM 12/1/03 -0500, you wrote:
>Hello:
>I'm planning to implement a CAN lab in our post diploma course on embedded
>controllers. The course uses the HCS12 EVB board from Motorola and I would
>like to integrate 8 of these boards using CAN interface. We use the
>Codewarrior development system.
>
>It would be great if I could either get hold of some C source code to begin
>implementation or some useful reference material.
>

You're supposed to leave that "as an exercise for the student"... :-) ... Gary Olmstead
Toucan Technology
Ventura CA



Motorola dev site has about six application notes that will help, and some
of these have some C example code. check out www.port.de, and the book on
68HC12 by Professor Huang (Delmar pub) has a lot of good information. Also
check out vector-informatik.de (canbus site on Yahoo is a mirror of this
site). I gave some source code (assembly) to Roger at Axman and have done
some development with the 68Hc12D60 MSCAN module. SCF
----- Original Message -----
From: Len Klochek
To:
Sent: Monday, December 01, 2003 10:48 PM
Subject: Re: [68HC12] HCS12 and CAN-module Hello:
I'm planning to implement a CAN lab in our post diploma course on embedded
controllers. The course uses the HCS12 EVB board from Motorola and I would
like to integrate 8 of these boards using CAN interface. We use the
Codewarrior development system.

It would be great if I could either get hold of some C source code to
begin
implementation or some useful reference material.

Any help would be greatly appreciated.

Thanks very much,
Len Klochek
John Theofanopoulos wrote:

> You should check out AN2011/D - The MSCAN on the S12 compared with the
> MSCAN on the HC12.
>
> It details the differences (registers, etc)
>
> John
> http://embedded.mistekllc.com
>
> > -----Original Message-----
> > From: mlammila [mailto:]
> > Sent: Tuesday, November 25, 2003 2:33 PM
> > To:
> > Subject: [68HC12] HCS12 and CAN-module
> >
> >
> >
> > I used before HC12 (60 and 128) and it's msCAN-module which
> > worked fine. Now I have tried to use MC9S12D64
> > microcontroller's msCAN-module and I have got it to send
> > messages (checked with oscilloscope) but there is something
> > wrong in the sending because my monitor program (national
> > intruments PCMCIA can card) gives framing error. I have tried
> > to check prescaler and timequanta register's settings but
> > everything seems to
> > be ok.
> >
> > Is there some radical differencies between old HC12 and the
> > new HCS12 ? One thing which I noticed was the using of the
> > transmitting registers (the new one 3 transmitregister is
> > mapped to one register which is visible to user and which
> > must choose trough register) but is there something else
> > which I should consider when using msCAN-module ?
> >
> >
> > Mika Lammila
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > ---------------------~--> Buy Ink Cartridges or Refill Kits
> > for your HP, Epson, Canon or Lexmark Printer at MyInks.com.
> > Free s/h on orders $50 or more to the US & Canada.
> > http://www.c1tracking.com/l.asp?cidU11
> >
> http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/dN_tlB/TM
> ---------------------------------~->
>
> -------------------- >
> ">http://docs.yahoo.com/info/terms/ > -------------------- >
> ">http://docs.yahoo.com/info/terms/ Yahoo! Groups Sponsor
--------------------