MSCAN bean transmision problem

Started by sabinaca1997 May 27, 2004
Hi everyone on this list!

I am experiencing a problem with the programming of the MSCAN on a
MC9S12DP256BCPV.
I have created and tested a "quasi" CANOpen protocol using the
Processor Expert beans created from Codewarrior.
I just had to set the right baudrate, set the masks and using the
CAN_Init(), the SendFrameExt(...) and calling ReadFrame(...) from the
OnFullRxBuffer() interruption, I had the protocol up and running in
almost no time.

This was OK until......I connected one more device programmed the
same way. Then the bus gets crazy and none of the devices are able to
receive anything the CAN transceivers will undestand. The IXXAT
CanAnalyser shows warning level on the bus and is not showing
anything else until I disconnect one of my devices.

So, I can connect any number of CANOpen devices but only one of those
I have developed at the time.

Doesn't seem that the problem comes from the hardware on the board,
so I start to think that maybe the Bean I have used is not so very
good....or I have missed some configuration steps....reset flags...I
don't know!!

Any body has a hint or any experience using the beans? Any help would be highly appreciated!!!!!
Thanks in advance to everyone.

S. Catal



Hi,

I'm having successful communications using the same processor. The Lawicel WiCAN library for the
ICC-12 compiler for the 68HC12 is what I used as a starting point. I have no idea what the 'beans'
do. However, assuming that you have everything initialized correctly one common CAN design problem
is to have two modules send identical ID parts of the message with different data parts.

That's just not allowed. It's physically possible but each node will have a different CRC which
will then create error flags. That's why if you use only one of your nodes there aren't problems
but if you use two of your nodes with identical software they probably start transmitting at the
same time.

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: sabinaca1997 [mailto:]
> Sent: Thursday, May 27, 2004 4:46 AM
> To:
> Subject: [68HC12] MSCAN bean transmision problem > Hi everyone on this list!
>
> I am experiencing a problem with the programming of the MSCAN on a
> MC9S12DP256BCPV.
> I have created and tested a "quasi" CANOpen protocol using the
> Processor Expert beans created from Codewarrior.
> I just had to set the right baudrate, set the masks and using the
> CAN_Init(), the SendFrameExt(...) and calling ReadFrame(...) from the
> OnFullRxBuffer() interruption, I had the protocol up and running in
> almost no time.
>
> This was OK until......I connected one more device programmed the
> same way. Then the bus gets crazy and none of the devices are able to
> receive anything the CAN transceivers will undestand. The IXXAT
> CanAnalyser shows warning level on the bus and is not showing
> anything else until I disconnect one of my devices.
>
> So, I can connect any number of CANOpen devices but only one of those
> I have developed at the time.
>
> Doesn't seem that the problem comes from the hardware on the board,
> so I start to think that maybe the Bean I have used is not so very
> good....or I have missed some configuration steps....reset flags...I
> don't know!!
>
> Any body has a hint or any experience using the beans? > Any help would be highly appreciated!!!!!
> Thanks in advance to everyone.
>
> S. Catal>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Yahoo! Domains - Claim yours for only $14.70
> http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/dN_tlB/TM
> --------------------------
> ------~->
>
> --------------------To
> learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
> o learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
>
> Yahoo! Groups Links >
>





Hi,

Thanks for your answer, but I don't think that is the problem now
(although at some time I'm sure it was), because the ID for the sent
messages is different. That is the one difference between the 2
boards.

I'm still trying to find the solution... if you have any other
suggestion I will be very glad to hear it!!
The Processor expert beans are creating a set of functions to
initialize and send-receive from/to mscan.
From the code examples I have seen around, the "Beans" are doing
pretty much the same as them, so I guess that is ok, but it would be
nice if anybody could tell me about their experience with
those "Beans", are they good enough? Do they have bugs?

As I say, still testing different solutions....

Thanks again!
Sabina Catalbr />
--- In , John Dammeyer <johnd@a...> wrote:
> Hi,
>
> I'm having successful communications using the same processor. The
Lawicel WiCAN library for the
> ICC-12 compiler for the 68HC12 is what I used as a starting point.
I have no idea what the 'beans'
> do. However, assuming that you have everything initialized
correctly one common CAN design problem
> is to have two modules send identical ID parts of the message with
different data parts.
>
> That's just not allowed. It's physically possible but each node
will have a different CRC which
> will then create error flags. That's why if you use only one of
your nodes there aren't problems
> but if you use two of your nodes with identical software they
probably start transmitting at the
> same time.
>
> 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: sabinaca1997 [mailto:sabinaca@h...]
> > Sent: Thursday, May 27, 2004 4:46 AM
> > To:
> > Subject: [68HC12] MSCAN bean transmision problem
> >
> >
> > Hi everyone on this list!
> >
> > I am experiencing a problem with the programming of the MSCAN on
a
> > MC9S12DP256BCPV.
> > I have created and tested a "quasi" CANOpen protocol using the
> > Processor Expert beans created from Codewarrior.
> > I just had to set the right baudrate, set the masks and using the
> > CAN_Init(), the SendFrameExt(...) and calling ReadFrame(...) from
the
> > OnFullRxBuffer() interruption, I had the protocol up and running
in
> > almost no time.
> >
> > This was OK until......I connected one more device programmed the
> > same way. Then the bus gets crazy and none of the devices are
able to
> > receive anything the CAN transceivers will undestand. The IXXAT
> > CanAnalyser shows warning level on the bus and is not showing
> > anything else until I disconnect one of my devices.
> >
> > So, I can connect any number of CANOpen devices but only one of
those
> > I have developed at the time.
> >
> > Doesn't seem that the problem comes from the hardware on the
board,
> > so I start to think that maybe the Bean I have used is not so
very
> > good....or I have missed some configuration steps....reset
flags...I
> > don't know!!
> >
> > Any body has a hint or any experience using the beans?
> >
> >
> > Any help would be highly appreciated!!!!!
> > Thanks in advance to everyone.
> >
> > S. Catalbr /> > >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > --------------------~-->
> > Yahoo! Domains - Claim yours for only $14.70
> > http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/dN_tlB/TM
> > --------------------------
> > ------~->
> >
> > --------------------To
> > learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> > o learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >




Hi,

Check bit rate, clock source and node-id. Make sure that you don't enable
MSCAN before bitrate is configured.
In a bean, MSCAN is enabled before initialization of timing register,
acceptance code and mask:

CAN0CTL0 = 1; /* Set the control register */
CAN0CTL1 = 128; <-- CANE bit /* Set the control register */
CAN0IDAC_IDAM = 0; /* Set the acceptance mode */
*(dword *)&CAN0IDAR0 = 0; /* Set the acceptance code */
*(dword *)&CAN0IDAR4 = 0; /* Set the acceptance code */
*(dword *)&CAN0IDMR0 = 0; /* Set the acceptance mask */
*(dword *)&CAN0IDMR4 = 0; /* Set the acceptance mask */
CAN1_SetHigh(); <-- Bit rate /* Set speed */

If transmission is enabled before the correct bitrate is set, then the
device(node) may try to synchronize with wrong bit rate and this will "jam"
the CAN bus.

Regards,

Juuso Kaitalo
Software Developer
Honeywell - Automation & Control Solutions
Real-time software
Control System Development
Finland -----Original Message-----
From: sabinaca1997 [mailto:]
Sent: 28. toukokuuta 2004 10:58
To:
Subject: [68HC12] Re: MSCAN bean transmision problem Hi,

Thanks for your answer, but I don't think that is the problem now
(although at some time I'm sure it was), because the ID for the sent
messages is different. That is the one difference between the 2
boards.

I'm still trying to find the solution... if you have any other
suggestion I will be very glad to hear it!!
The Processor expert beans are creating a set of functions to
initialize and send-receive from/to mscan.
From the code examples I have seen around, the "Beans" are doing
pretty much the same as them, so I guess that is ok, but it would be
nice if anybody could tell me about their experience with
those "Beans", are they good enough? Do they have bugs?

As I say, still testing different solutions....

Thanks again!
Sabina Catalbr />
--- In , John Dammeyer <johnd@a...> wrote:
> Hi,
>
> I'm having successful communications using the same processor. The
Lawicel WiCAN library for the
> ICC-12 compiler for the 68HC12 is what I used as a starting point.
I have no idea what the 'beans'
> do. However, assuming that you have everything initialized
correctly one common CAN design problem
> is to have two modules send identical ID parts of the message with
different data parts.
>
> That's just not allowed. It's physically possible but each node
will have a different CRC which
> will then create error flags. That's why if you use only one of
your nodes there aren't problems
> but if you use two of your nodes with identical software they
probably start transmitting at the
> same time.
>
> 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: sabinaca1997 [mailto:sabinaca@h...]
> > Sent: Thursday, May 27, 2004 4:46 AM
> > To:
> > Subject: [68HC12] MSCAN bean transmision problem
> >
> >
> > Hi everyone on this list!
> >
> > I am experiencing a problem with the programming of the MSCAN on
a
> > MC9S12DP256BCPV.
> > I have created and tested a "quasi" CANOpen protocol using the
> > Processor Expert beans created from Codewarrior.
> > I just had to set the right baudrate, set the masks and using the
> > CAN_Init(), the SendFrameExt(...) and calling ReadFrame(...) from
the
> > OnFullRxBuffer() interruption, I had the protocol up and running
in
> > almost no time.
> >
> > This was OK until......I connected one more device programmed the
> > same way. Then the bus gets crazy and none of the devices are
able to
> > receive anything the CAN transceivers will undestand. The IXXAT
> > CanAnalyser shows warning level on the bus and is not showing
> > anything else until I disconnect one of my devices.
> >
> > So, I can connect any number of CANOpen devices but only one of
those
> > I have developed at the time.
> >
> > Doesn't seem that the problem comes from the hardware on the
board,
> > so I start to think that maybe the Bean I have used is not so
very
> > good....or I have missed some configuration steps....reset
flags...I
> > don't know!!
> >
> > Any body has a hint or any experience using the beans?
> >
> >
> > Any help would be highly appreciated!!!!!
> > Thanks in advance to everyone.
> >
> > S. Catalbr /> > >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > --------------------~-->
> > Yahoo! Domains - Claim yours for only $14.70
> > http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/dN_tlB/TM
> > --------------------------
> > ------~->
> >
> > --------------------To
> > learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> > o learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >

--------------------To learn more about
Motorola Microcontrollers, please visit
http://www.motorola.com/mcu
o learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu

Yahoo! Groups Links



Hi,

Thanks for a new tip!

Well I'm not sure, but I believe those things (bit rate, clock
source, etc) are in place, because the board is working fine with any
other sort of CAN device connected to it, but another with the same
microcontroller and transceiver.

In case I wasn't quite clear in my previous message, I'll try to
explain the problem better:

We have:
Board nr. 1, with ID = 1, mscan enabled sending COB-ID 0x701 every
100ms
Board nr. 2, ID = 7, mscan enabled sending COB-ID 0x707 every 200ms
Board nr. 3, mscan is not enabled.
All our boards have TJA1040 transceivers.

Our board nr. 1 (for example) works fine when connected to, for
example, 3 IXXAT PC boards and 1 CAN device with a SJA1000 CAN
controller. This way I can send and receive CAN messages without any
kind of problem.

If I disconnect from the bus nr. 1 and put nr. 2 instead, works fine
still.
If I connect to the bus both nr. 1 and nr. 2, or nr. 1(or 2) and nr. 3
(no mscan enabled!) the HC12 seems to get crazy, and the RX signal
becomes pulses with 4.8kHz, instead of CAN messages.

Could be a hardware problem as well, but I can't figure it out!

Does any body have a CAN application using the Processor expert beans
working fine with several devices of the same type?

Any help will be appreciated!!

Sabina Catalbr />
--- In , "Kaitalo, Juuso (FI06)"
<Juuso.Kaitalo@h...> wrote:
> Hi,
>
> Check bit rate, clock source and node-id. Make sure that you don't
enable
> MSCAN before bitrate is configured.
> In a bean, MSCAN is enabled before initialization of timing
register,
> acceptance code and mask:
>
> CAN0CTL0 = 1; /* Set the control register
*/
> CAN0CTL1 = 128; <-- CANE bit /* Set the control register
*/
> CAN0IDAC_IDAM = 0; /* Set the acceptance mode */
> *(dword *)&CAN0IDAR0 = 0; /* Set the acceptance code */
> *(dword *)&CAN0IDAR4 = 0; /* Set the acceptance code */
> *(dword *)&CAN0IDMR0 = 0; /* Set the acceptance mask */
> *(dword *)&CAN0IDMR4 = 0; /* Set the acceptance mask */
> CAN1_SetHigh(); <-- Bit rate /* Set speed */
>
> If transmission is enabled before the correct bitrate is set, then
the
> device(node) may try to synchronize with wrong bit rate and this
will "jam"
> the CAN bus.
>
> Regards,
>
> Juuso Kaitalo
> Software Developer
> Honeywell - Automation & Control Solutions
> Real-time software
> Control System Development
> Finland > -----Original Message-----
> From: sabinaca1997 [mailto:sabinaca@h...]
> Sent: 28. toukokuuta 2004 10:58
> To:
> Subject: [68HC12] Re: MSCAN bean transmision problem > Hi,
>
> Thanks for your answer, but I don't think that is the problem now
> (although at some time I'm sure it was), because the ID for the
sent
> messages is different. That is the one difference between the 2
> boards.
>
> I'm still trying to find the solution... if you have any other
> suggestion I will be very glad to hear it!!
> The Processor expert beans are creating a set of functions to
> initialize and send-receive from/to mscan.
> From the code examples I have seen around, the "Beans" are doing
> pretty much the same as them, so I guess that is ok, but it would
be
> nice if anybody could tell me about their experience with
> those "Beans", are they good enough? Do they have bugs?
>
> As I say, still testing different solutions....
>
> Thanks again!
> Sabina Catalbr /> >
> --- In , John Dammeyer <johnd@a...> wrote:
> > Hi,
> >
> > I'm having successful communications using the same processor.
The
> Lawicel WiCAN library for the
> > ICC-12 compiler for the 68HC12 is what I used as a starting
point.
> I have no idea what the 'beans'
> > do. However, assuming that you have everything initialized
> correctly one common CAN design problem
> > is to have two modules send identical ID parts of the message
with
> different data parts.
> >
> > That's just not allowed. It's physically possible but each node
> will have a different CRC which
> > will then create error flags. That's why if you use only one of
> your nodes there aren't problems
> > but if you use two of your nodes with identical software they
> probably start transmitting at the
> > same time.
> >
> > 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: sabinaca1997 [mailto:sabinaca@h...]
> > > Sent: Thursday, May 27, 2004 4:46 AM
> > > To:
> > > Subject: [68HC12] MSCAN bean transmision problem
> > >
> > >
> > > Hi everyone on this list!
> > >
> > > I am experiencing a problem with the programming of the MSCAN
on
> a
> > > MC9S12DP256BCPV.
> > > I have created and tested a "quasi" CANOpen protocol using the
> > > Processor Expert beans created from Codewarrior.
> > > I just had to set the right baudrate, set the masks and using
the
> > > CAN_Init(), the SendFrameExt(...) and calling ReadFrame(...)
from
> the
> > > OnFullRxBuffer() interruption, I had the protocol up and
running
> in
> > > almost no time.
> > >
> > > This was OK until......I connected one more device programmed
the
> > > same way. Then the bus gets crazy and none of the devices are
> able to
> > > receive anything the CAN transceivers will undestand. The IXXAT
> > > CanAnalyser shows warning level on the bus and is not showing
> > > anything else until I disconnect one of my devices.
> > >
> > > So, I can connect any number of CANOpen devices but only one of
> those
> > > I have developed at the time.
> > >
> > > Doesn't seem that the problem comes from the hardware on the
> board,
> > > so I start to think that maybe the Bean I have used is not so
> very
> > > good....or I have missed some configuration steps....reset
> flags...I
> > > don't know!!
> > >
> > > Any body has a hint or any experience using the beans?
> > >
> > >
> > > Any help would be highly appreciated!!!!!
> > > Thanks in advance to everyone.
> > >
> > > S. Catalbr /> > > >
> > >
> > >
> > > ------------------------ Yahoo! Groups Sponsor
> > > --------------------~-->
> > > Yahoo! Domains - Claim yours for only $14.70
> > > http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/dN_tlB/TM
> > > --------------------------
> > > ------~->
> > >
> > > --------------------To
> > > learn more about Motorola Microcontrollers, please visit
> > > http://www.motorola.com/mcu
> > > o learn more about Motorola Microcontrollers, please visit
> > > http://www.motorola.com/mcu
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
>
> --------------------To learn
more about
> Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
> o learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
>
> Yahoo! Groups Links




It almost sounds like you've got your transceiver wired in such
a way that it is looping data back on the bus without the HC12.
There should be no reason why the disabled mscan device
should interfere with the working one. How do you have the
HC12 to transceiver wired and how is the transceiver wired to
the bus? Something else to try would be to run a simple CAN
test program on each node.
Steve

Steven D. Letkeman BSc.
President - Zanthic Technologies Inc.
403-526-8318
www.zanthic.com Embedded micro-controllers and CAN interfaces
www.brightan.com Automated lighting systems

----- Original Message -----
From: sabinaca1997
To:
Sent: Friday, May 28, 2004 6:46 AM
Subject: [68HC12] Re: MSCAN bean transmision problem Hi,

Thanks for a new tip!

Well I'm not sure, but I believe those things (bit rate, clock
source, etc) are in place, because the board is working fine with any
other sort of CAN device connected to it, but another with the same
microcontroller and transceiver.

In case I wasn't quite clear in my previous message, I'll try to
explain the problem better:

We have:
Board nr. 1, with ID = 1, mscan enabled sending COB-ID 0x701 every
100ms
Board nr. 2, ID = 7, mscan enabled sending COB-ID 0x707 every 200ms
Board nr. 3, mscan is not enabled.
All our boards have TJA1040 transceivers.

Our board nr. 1 (for example) works fine when connected to, for
example, 3 IXXAT PC boards and 1 CAN device with a SJA1000 CAN
controller. This way I can send and receive CAN messages without any
kind of problem.

If I disconnect from the bus nr. 1 and put nr. 2 instead, works fine
still.
If I connect to the bus both nr. 1 and nr. 2, or nr. 1(or 2) and nr. 3
(no mscan enabled!) the HC12 seems to get crazy, and the RX signal
becomes pulses with 4.8kHz, instead of CAN messages.

Could be a hardware problem as well, but I can't figure it out!

Does any body have a CAN application using the Processor expert beans
working fine with several devices of the same type?

Any help will be appreciated!!

Sabina Catalbr />
--- In , "Kaitalo, Juuso (FI06)"
<Juuso.Kaitalo@h...> wrote:
> Hi,
>
> Check bit rate, clock source and node-id. Make sure that you don't
enable
> MSCAN before bitrate is configured.
> In a bean, MSCAN is enabled before initialization of timing
register,
> acceptance code and mask:
>
> CAN0CTL0 = 1; /* Set the control register
*/
> CAN0CTL1 = 128; <-- CANE bit /* Set the control register
*/
> CAN0IDAC_IDAM = 0; /* Set the acceptance mode */
> *(dword *)&CAN0IDAR0 = 0; /* Set the acceptance code */
> *(dword *)&CAN0IDAR4 = 0; /* Set the acceptance code */
> *(dword *)&CAN0IDMR0 = 0; /* Set the acceptance mask */
> *(dword *)&CAN0IDMR4 = 0; /* Set the acceptance mask */
> CAN1_SetHigh(); <-- Bit rate /* Set speed */
>
> If transmission is enabled before the correct bitrate is set, then
the
> device(node) may try to synchronize with wrong bit rate and this
will "jam"
> the CAN bus.
>
> Regards,
>
> Juuso Kaitalo
> Software Developer
> Honeywell - Automation & Control Solutions
> Real-time software
> Control System Development
> Finland > -----Original Message-----
> From: sabinaca1997 [mailto:sabinaca@h...]
> Sent: 28. toukokuuta 2004 10:58
> To:
> Subject: [68HC12] Re: MSCAN bean transmision problem > Hi,
>
> Thanks for your answer, but I don't think that is the problem now
> (although at some time I'm sure it was), because the ID for the
sent
> messages is different. That is the one difference between the 2
> boards.
>
> I'm still trying to find the solution... if you have any other
> suggestion I will be very glad to hear it!!
> The Processor expert beans are creating a set of functions to
> initialize and send-receive from/to mscan.
> From the code examples I have seen around, the "Beans" are doing
> pretty much the same as them, so I guess that is ok, but it would
be
> nice if anybody could tell me about their experience with
> those "Beans", are they good enough? Do they have bugs?
>
> As I say, still testing different solutions....
>
> Thanks again!
> Sabina Catalbr /> >
> --- In , John Dammeyer <johnd@a...> wrote:
> > Hi,
> >
> > I'm having successful communications using the same processor.
The
> Lawicel WiCAN library for the
> > ICC-12 compiler for the 68HC12 is what I used as a starting
point.
> I have no idea what the 'beans'
> > do. However, assuming that you have everything initialized
> correctly one common CAN design problem
> > is to have two modules send identical ID parts of the message
with
> different data parts.
> >
> > That's just not allowed. It's physically possible but each node
> will have a different CRC which
> > will then create error flags. That's why if you use only one of
> your nodes there aren't problems
> > but if you use two of your nodes with identical software they
> probably start transmitting at the
> > same time.
> >
> > 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: sabinaca1997 [mailto:sabinaca@h...]
> > > Sent: Thursday, May 27, 2004 4:46 AM
> > > To:
> > > Subject: [68HC12] MSCAN bean transmision problem
> > >
> > >
> > > Hi everyone on this list!
> > >
> > > I am experiencing a problem with the programming of the MSCAN
on
> a
> > > MC9S12DP256BCPV.
> > > I have created and tested a "quasi" CANOpen protocol using the
> > > Processor Expert beans created from Codewarrior.
> > > I just had to set the right baudrate, set the masks and using
the
> > > CAN_Init(), the SendFrameExt(...) and calling ReadFrame(...)
from
> the
> > > OnFullRxBuffer() interruption, I had the protocol up and
running
> in
> > > almost no time.
> > >
> > > This was OK until......I connected one more device programmed
the
> > > same way. Then the bus gets crazy and none of the devices are
> able to
> > > receive anything the CAN transceivers will undestand. The IXXAT
> > > CanAnalyser shows warning level on the bus and is not showing
> > > anything else until I disconnect one of my devices.
> > >
> > > So, I can connect any number of CANOpen devices but only one of
> those
> > > I have developed at the time.
> > >
> > > Doesn't seem that the problem comes from the hardware on the
> board,
> > > so I start to think that maybe the Bean I have used is not so
> very
> > > good....or I have missed some configuration steps....reset
> flags...I
> > > don't know!!
> > >
> > > Any body has a hint or any experience using the beans?
> > >
> > >
> > > Any help would be highly appreciated!!!!!
> > > Thanks in advance to everyone.
> > >
> > > S. Catalbr /> > > >
> > >
> > >
> > > ------------------------ ------
Yahoo! Groups Links

a.. To



Hi,

Thanks for answering!
Well, could be... but, at least form what I can see, we have a
TJA1040 Tranceiver connected to our microcontroller trough a digitial

We have connected directly the output of the tranceiver to the bus
(CANH,CANL), and we have put a ceramic capacitor of 100nf to ground
to improve the EMC behaviour in each CAN ouput.
We mcu is connected to a Digital Isolator Adum1301 to separate the
Can zone to the mcu zone.
And the Digital Isolator Output is connected to the input of the
Tranceiver.
If you want, I can send you a capture screen of the Scheme.

Thanks in advance.

S. Catal

--- In , "Steve Letkeman" <hc12list1@z...>
wrote:
> It almost sounds like you've got your transceiver wired in such
> a way that it is looping data back on the bus without the HC12.
> There should be no reason why the disabled mscan device
> should interfere with the working one. How do you have the
> HC12 to transceiver wired and how is the transceiver wired to
> the bus? Something else to try would be to run a simple CAN
> test program on each node.
> Steve
>
> Steven D. Letkeman BSc.
> President - Zanthic Technologies Inc.
> 403-526-8318
> www.zanthic.com Embedded micro-controllers and CAN interfaces
> www.brightan.com Automated lighting systems
>
> ----- Original Message -----
> From: sabinaca1997
> To:
> Sent: Friday, May 28, 2004 6:46 AM
> Subject: [68HC12] Re: MSCAN bean transmision problem > Hi,
>
> Thanks for a new tip!
>
> Well I'm not sure, but I believe those things (bit rate, clock
> source, etc) are in place, because the board is working fine with
any
> other sort of CAN device connected to it, but another with the
same
> microcontroller and transceiver.
>
> In case I wasn't quite clear in my previous message, I'll try to
> explain the problem better:
>
> We have:
> Board nr. 1, with ID = 1, mscan enabled sending COB-ID 0x701
every
> 100ms
> Board nr. 2, ID = 7, mscan enabled sending COB-ID 0x707 every
200ms
> Board nr. 3, mscan is not enabled.
> All our boards have TJA1040 transceivers.
>
> Our board nr. 1 (for example) works fine when connected to, for
> example, 3 IXXAT PC boards and 1 CAN device with a SJA1000 CAN
> controller. This way I can send and receive CAN messages without
any
> kind of problem.
>
> If I disconnect from the bus nr. 1 and put nr. 2 instead, works
fine
> still.
> If I connect to the bus both nr. 1 and nr. 2, or nr. 1(or 2) and
nr. 3
> (no mscan enabled!) the HC12 seems to get crazy, and the RX
signal
> becomes pulses with 4.8kHz, instead of CAN messages.
>
> Could be a hardware problem as well, but I can't figure it out!
>
> Does any body have a CAN application using the Processor expert
beans
> working fine with several devices of the same type?
>
> Any help will be appreciated!!
>
> Sabina Catalbr /> >
> --- In , "Kaitalo, Juuso (FI06)"
> <Juuso.Kaitalo@h...> wrote:
> > Hi,
> >
> > Check bit rate, clock source and node-id. Make sure that you
don't
> enable
> > MSCAN before bitrate is configured.
> > In a bean, MSCAN is enabled before initialization of timing
> register,
> > acceptance code and mask:
> >
> > CAN0CTL0 = 1; /* Set the control
register
> */
> > CAN0CTL1 = 128; <-- CANE bit /* Set the control
register
> */
> > CAN0IDAC_IDAM = 0; /* Set the acceptance
mode */
> > *(dword *)&CAN0IDAR0 = 0; /* Set the acceptance
code */
> > *(dword *)&CAN0IDAR4 = 0; /* Set the acceptance
code */
> > *(dword *)&CAN0IDMR0 = 0; /* Set the acceptance
mask */
> > *(dword *)&CAN0IDMR4 = 0; /* Set the acceptance
mask */
> > CAN1_SetHigh(); <-- Bit rate /* Set
speed */
> >
> > If transmission is enabled before the correct bitrate is set,
then
> the
> > device(node) may try to synchronize with wrong bit rate and
this
> will "jam"
> > the CAN bus.
> >
> > Regards,
> >
> > Juuso Kaitalo
> > Software Developer
> > Honeywell - Automation & Control Solutions
> > Real-time software
> > Control System Development
> > Finland
> >
> >
> > -----Original Message-----
> > From: sabinaca1997 [mailto:sabinaca@h...]
> > Sent: 28. toukokuuta 2004 10:58
> > To:
> > Subject: [68HC12] Re: MSCAN bean transmision problem
> >
> >
> > Hi,
> >
> > Thanks for your answer, but I don't think that is the problem
now
> > (although at some time I'm sure it was), because the ID for the
> sent
> > messages is different. That is the one difference between the 2
> > boards.
> >
> > I'm still trying to find the solution... if you have any other
> > suggestion I will be very glad to hear it!!
> > The Processor expert beans are creating a set of functions to
> > initialize and send-receive from/to mscan.
> > From the code examples I have seen around, the "Beans" are
doing
> > pretty much the same as them, so I guess that is ok, but it
would
> be
> > nice if anybody could tell me about their experience with
> > those "Beans", are they good enough? Do they have bugs?
> >
> > As I say, still testing different solutions....
> >
> > Thanks again!
> > Sabina Catalbr /> > >
> > --- In , John Dammeyer <johnd@a...> wrote:
> > > Hi,
> > >
> > > I'm having successful communications using the same
processor.
> The
> > Lawicel WiCAN library for the
> > > ICC-12 compiler for the 68HC12 is what I used as a starting
> point.
> > I have no idea what the 'beans'
> > > do. However, assuming that you have everything initialized
> > correctly one common CAN design problem
> > > is to have two modules send identical ID parts of the message
> with
> > different data parts.
> > >
> > > That's just not allowed. It's physically possible but each
node
> > will have a different CRC which
> > > will then create error flags. That's why if you use only one
of
> > your nodes there aren't problems
> > > but if you use two of your nodes with identical software they
> > probably start transmitting at the
> > > same time.
> > >
> > > 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: sabinaca1997 [mailto:sabinaca@h...]
> > > > Sent: Thursday, May 27, 2004 4:46 AM
> > > > To:
> > > > Subject: [68HC12] MSCAN bean transmision problem
> > > >
> > > >
> > > > Hi everyone on this list!
> > > >
> > > > I am experiencing a problem with the programming of the
MSCAN
> on
> > a
> > > > MC9S12DP256BCPV.
> > > > I have created and tested a "quasi" CANOpen protocol using
the
> > > > Processor Expert beans created from Codewarrior.
> > > > I just had to set the right baudrate, set the masks and
using
> the
> > > > CAN_Init(), the SendFrameExt(...) and calling ReadFrame
(...)
> from
> > the
> > > > OnFullRxBuffer() interruption, I had the protocol up and
> running
> > in
> > > > almost no time.
> > > >
> > > > This was OK until......I connected one more device
programmed
> the
> > > > same way. Then the bus gets crazy and none of the devices
are
> > able to
> > > > receive anything the CAN transceivers will undestand. The
IXXAT
> > > > CanAnalyser shows warning level on the bus and is not
showing
> > > > anything else until I disconnect one of my devices.
> > > >
> > > > So, I can connect any number of CANOpen devices but only
one of
> > those
> > > > I have developed at the time.
> > > >
> > > > Doesn't seem that the problem comes from the hardware on
the
> > board,
> > > > so I start to think that maybe the Bean I have used is not
so
> > very
> > > > good....or I have missed some configuration steps....reset
> > flags...I
> > > > don't know!!
> > > >
> > > > Any body has a hint or any experience using the beans?
> > > >
> > > >
> > > > Any help would be highly appreciated!!!!!
> > > > Thanks in advance to everyone.
> > > >
> > > > S. Catalbr /> > > > >
> > > >
> > > >
> > > > ------------------------ > --------------------------------
----------
> Yahoo! Groups Links
>
> a.. To >
>




If you think the hardware is OK, than I would simplify the software
down to a basic CAN send and receive functionality. I have posted
a sample program for CAN to this list a number of times that you
could use or you can email me directly for it. I'll take a quick
look at the schematic if you want to send that to me directly.
Steve

Steven D. Letkeman BSc.
President - Zanthic Technologies Inc.
403-526-8318
www.zanthic.com Embedded micro-controllers and CAN interfaces
www.brightan.com Automated lighting systems

----- Original Message -----
From: sabinaca1997
To:
Sent: Friday, May 28, 2004 8:30 AM
Subject: [68HC12] Re: MSCAN bean transmision problem Hi,

Thanks for answering!
Well, could be... but, at least form what I can see, we have a
TJA1040 Tranceiver connected to our microcontroller trough a digitial

We have connected directly the output of the tranceiver to the bus
(CANH,CANL), and we have put a ceramic capacitor of 100nf to ground
to improve the EMC behaviour in each CAN ouput.
We mcu is connected to a Digital Isolator Adum1301 to separate the
Can zone to the mcu zone.
And the Digital Isolator Output is connected to the input of the
Tranceiver.
If you want, I can send you a capture screen of the Scheme.

Thanks in advance.

S. Catal

--- In , "Steve Letkeman" <hc12list1@z...>
wrote:
> It almost sounds like you've got your transceiver wired in such
> a way that it is looping data back on the bus without the HC12.
> There should be no reason why the disabled mscan device
> should interfere with the working one. How do you have the
> HC12 to transceiver wired and how is the transceiver wired to
> the bus? Something else to try would be to run a simple CAN
> test program on each node.
> Steve
>
> Steven D. Letkeman BSc.
> President - Zanthic Technologies Inc.
> 403-526-8318
> www.zanthic.com Embedded micro-controllers and CAN interfaces
> www.brightan.com Automated lighting systems
>
> ----- Original Message -----
> From: sabinaca1997
> To:
> Sent: Friday, May 28, 2004 6:46 AM
> Subject: [68HC12] Re: MSCAN bean transmision problem > Hi,
>
> Thanks for a new tip!
>
> Well I'm not sure, but I believe those things (bit rate, clock
> source, etc) are in place, because the board is working fine with
any
> other sort of CAN device connected to it, but another with the
same
> microcontroller and transceiver.
>
> In case I wasn't quite clear in my previous message, I'll try to
> explain the problem better:
>
> We have:
> Board nr. 1, with ID = 1, mscan enabled sending COB-ID 0x701
every
> 100ms
> Board nr. 2, ID = 7, mscan enabled sending COB-ID 0x707 every
200ms
> Board nr. 3, mscan is not enabled.
> All our boards have TJA1040 transceivers.
>
> Our board nr. 1 (for example) works fine when connected to, for
> example, 3 IXXAT PC boards and 1 CAN device with a SJA1000 CAN
> controller. This way I can send and receive CAN messages without
any
> kind of problem.
>
> If I disconnect from the bus nr. 1 and put nr. 2 instead, works
fine
> still.
> If I connect to the bus both nr. 1 and nr. 2, or nr. 1(or 2) and
nr. 3
> (no mscan enabled!) the HC12 seems to get crazy, and the RX
signal
> becomes pulses with 4.8kHz, instead of CAN messages.
>
> Could be a hardware problem as well, but I can't figure it out!
>
> Does any body have a CAN application using the Processor expert
beans
> working fine with several devices of the same type?
>
> Any help will be appreciated!!
>
> Sabina Catalbr /> >
> --- In , "Kaitalo, Juuso (FI06)"
> <Juuso.Kaitalo@h...> wrote:
> > Hi,
> >
> > Check bit rate, clock source and node-id. Make sure that you
don't
> enable
> > MSCAN before bitrate is configured.
> > In a bean, MSCAN is enabled before initialization of timing
> register,
> > acceptance code and mask:
> >
> > CAN0CTL0 = 1; /* Set the control
register
> */
> > CAN0CTL1 = 128; <-- CANE bit /* Set the control
register
> */
> > CAN0IDAC_IDAM = 0; /* Set the acceptance
mode */
> > *(dword *)&CAN0IDAR0 = 0; /* Set the acceptance
code */
> > *(dword *)&CAN0IDAR4 = 0; /* Set the acceptance
code */
> > *(dword *)&CAN0IDMR0 = 0; /* Set the acceptance
mask */
> > *(dword *)&CAN0IDMR4 = 0; /* Set the acceptance
mask */
> > CAN1_SetHigh(); <-- Bit rate /* Set
speed */
> >
> > If transmission is enabled before the correct bitrate is set,
then
> the
> > device(node) may try to synchronize with wrong bit rate and
this
> will "jam"
> > the CAN bus.
> >
> > Regards,
> >
> > Juuso Kaitalo
> > Software Developer
> > Honeywell - Automation & Control Solutions
> > Real-time software
> > Control System Development
> > Finland
> >
> >
> > -----Original Message-----
> > From: sabinaca1997 [mailto:sabinaca@h...]
> > Sent: 28. toukokuuta 2004 10:58
> > To:
> > Subject: [68HC12] Re: MSCAN bean transmision problem
> >
> >
> > Hi,
> >
> > Thanks for your answer, but I don't think that is the problem
now
> > (although at some time I'm sure it was), because the ID for the
> sent
> > messages is different. That is the one difference between the 2
> > boards.
> >
> > I'm still trying to find the solution... if you have any other
> > suggestion I will be very glad to hear it!!
> > The Processor expert beans are creating a set of functions to
> > initialize and send-receive from/to mscan.
> > From the code examples I have seen around, the "Beans" are
doing
> > pretty much the same as them, so I guess that is ok, but it
would
> be
> > nice if anybody could tell me about their experience with
> > those "Beans", are they good enough? Do they have bugs?
> >
> > As I say, still testing different solutions....
> >
> > Thanks again!
> > Sabina Catalbr /> > >
> > --- In , John Dammeyer <johnd@a...> wrote:
> > > Hi,
> > >
> > > I'm having successful communications using the same
processor.
> The
> > Lawicel WiCAN library for the
> > > ICC-12 compiler for the 68HC12 is what I used as a starting
> point.
> > I have no idea what the 'beans'
> > > do. However, assuming that you have everything initialized
> > correctly one common CAN design problem
> > > is to have two modules send identical ID parts of the message
> with
> > different data parts.
> > >
> > > That's just not allowed. It's physically possible but each
node
> > will have a different CRC which
> > > will then create error flags. That's why if you use only one
of
> > your nodes there aren't problems
> > > but if you use two of your nodes with identical software they
> > probably start transmitting at the
> > > same time.
> > >
> > > 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: sabinaca1997 [mailto:sabinaca@h...]
> > > > Sent: Thursday, May 27, 2004 4:46 AM
> > > > To:
> > > > Subject: [68HC12] MSCAN bean transmision problem
> > > >
> > > >
> > > > Hi everyone on this list!
> > > >
> > > > I am experiencing a problem with the programming of the
MSCAN
> on
> > a
> > > > MC9S12DP256BCPV.
> > > > I have created and tested a "quasi" CANOpen protocol using
the
> > > > Processor Expert beans created from Codewarrior.
> > > > I just had to set the right baudrate, set the masks and
using
> the
> > > > CAN_Init(), the SendFrameExt(...) and calling ReadFrame
(...)
> from
> > the
> > > > OnFullRxBuffer() interruption, I had the protocol up and
> running
> > in
> > > > almost no time.
> > > >
> > > > This was OK until......I connected one more device
programmed
> the
> > > > same way. Then the bus gets crazy and none of the devices
are
> > able to
> > > > receive anything the CAN transceivers will undestand. The
IXXAT
> > > > CanAnalyser shows warning level on the bus and is not
showing
> > > > anything else until I disconnect one of my devices.
> > > >
> > > > So, I can connect any number of CANOpen devices but only
one of
> > those
> > > > I have developed at the time.
> > > >
> > > > Doesn't seem that the problem comes from the hardware on
the
> > board,
> > > > so I start to think that maybe the Bean I have used is not
so
> > very
> > > > good....or I have missed some configuration steps....reset
> > flags...I
> > > > don't know!!
> > > >
> > > > Any body has a hint or any experience using the beans?
> > > >
> > > >
> > > > Any help would be highly appreciated!!!!!
> > > > Thanks in advance to everyone.
> > > >
> > > > S. Catalbr /> > > > >
> > > >
> > > >
> > > > ------------------------ > --------------------------------
----------
> Yahoo! Groups Links
>
> a.. To >
>
--------------------To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu
o learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu
------
Yahoo! Groups Links

a.. To



Hi Steve,

Thanks for your tips!!
I'm still dealing with the same problem.
As you suggested, I have a very simple project. Just the CAN bean and
a Timer.
Sending CAN_A_SendFrameExt(0x701, DATA_FRAME, 1, 5) after 10 seconds,
only once.

Now we are trying to track down the problem to the basic, so, looking
the signal with the osciloscope, with the bus not connected to
anything, we analize the TX signal, and the result is that as soon a
signal is sent, and nothing is connected to the line, the mcu
gets "jammed" or at least that is what it looks like. The TX pin from
the mcu is sending pulses with 5kHz period, nothing similar to a CAN
signal.

Does anybody know if this is normal with the bus not connected to
the board (PM1_TxCAN0_TxB in the air)?
I would expect that the signal just looks fine when nothing is
connected, or does it have to be connected to a transceiver?

Thanks again!!

Sabina

--- In , "Steve Letkeman" <hc12list1@z...>
wrote:
> If you think the hardware is OK, than I would simplify the software
> down to a basic CAN send and receive functionality. I have posted
> a sample program for CAN to this list a number of times that you
> could use or you can email me directly for it. I'll take a quick
> look at the schematic if you want to send that to me directly.
> Steve
>
> Steven D. Letkeman BSc.
> President - Zanthic Technologies Inc.
> 403-526-8318
> www.zanthic.com Embedded micro-controllers and CAN interfaces
> www.brightan.com Automated lighting systems
>
> ----- Original Message -----
> From: sabinaca1997
> To:
> Sent: Friday, May 28, 2004 8:30 AM
> Subject: [68HC12] Re: MSCAN bean transmision problem > Hi,
>
> Thanks for answering!
> Well, could be... but, at least form what I can see, we have a
> TJA1040 Tranceiver connected to our microcontroller trough a
digitial
>
> We have connected directly the output of the tranceiver to the
bus
> (CANH,CANL), and we have put a ceramic capacitor of 100nf to
ground
> to improve the EMC behaviour in each CAN ouput.
> We mcu is connected to a Digital Isolator Adum1301 to separate
the
> Can zone to the mcu zone.
> And the Digital Isolator Output is connected to the input of the
> Tranceiver.
> If you want, I can send you a capture screen of the Scheme.
>
> Thanks in advance.
>
> S. Catal>
>
> --- In , "Steve Letkeman" <hc12list1@z...>
> wrote:
> > It almost sounds like you've got your transceiver wired in such
> > a way that it is looping data back on the bus without the HC12.
> > There should be no reason why the disabled mscan device
> > should interfere with the working one. How do you have the
> > HC12 to transceiver wired and how is the transceiver wired to
> > the bus? Something else to try would be to run a simple CAN
> > test program on each node.
> > Steve
> >
> > Steven D. Letkeman BSc.
> > President - Zanthic Technologies Inc.
> > 403-526-8318
> > www.zanthic.com Embedded micro-controllers and CAN interfaces
> > www.brightan.com Automated lighting systems
> >
> > ----- Original Message -----
> > From: sabinaca1997
> > To:
> > Sent: Friday, May 28, 2004 6:46 AM
> > Subject: [68HC12] Re: MSCAN bean transmision problem
> >
> >
> > Hi,
> >
> > Thanks for a new tip!
> >
> > Well I'm not sure, but I believe those things (bit rate,
clock
> > source, etc) are in place, because the board is working fine
with
> any
> > other sort of CAN device connected to it, but another with
the
> same
> > microcontroller and transceiver.
> >
> > In case I wasn't quite clear in my previous message, I'll try
to
> > explain the problem better:
> >
> > We have:
> > Board nr. 1, with ID = 1, mscan enabled sending COB-ID 0x701
> every
> > 100ms
> > Board nr. 2, ID = 7, mscan enabled sending COB-ID 0x707 every
> 200ms
> > Board nr. 3, mscan is not enabled.
> > All our boards have TJA1040 transceivers.
> >
> > Our board nr. 1 (for example) works fine when connected to,
for
> > example, 3 IXXAT PC boards and 1 CAN device with a SJA1000
CAN
> > controller. This way I can send and receive CAN messages
without
> any
> > kind of problem.
> >
> > If I disconnect from the bus nr. 1 and put nr. 2 instead,
works
> fine
> > still.
> > If I connect to the bus both nr. 1 and nr. 2, or nr. 1(or 2)
and
> nr. 3
> > (no mscan enabled!) the HC12 seems to get crazy, and the RX
> signal
> > becomes pulses with 4.8kHz, instead of CAN messages.
> >
> > Could be a hardware problem as well, but I can't figure it
out!
> >
> > Does any body have a CAN application using the Processor
expert
> beans
> > working fine with several devices of the same type?
> >
> > Any help will be appreciated!!
> >
> > Sabina Catalbr /> > >
> > --- In , "Kaitalo, Juuso (FI06)"
> > <Juuso.Kaitalo@h...> wrote:
> > > Hi,
> > >
> > > Check bit rate, clock source and node-id. Make sure that
you
> don't
> > enable
> > > MSCAN before bitrate is configured.
> > > In a bean, MSCAN is enabled before initialization of timing
> > register,
> > > acceptance code and mask:
> > >
> > > CAN0CTL0 = 1; /* Set the control
> register
> > */
> > > CAN0CTL1 = 128; <-- CANE bit /* Set the control
> register
> > */
> > > CAN0IDAC_IDAM = 0; /* Set the
acceptance
> mode */
> > > *(dword *)&CAN0IDAR0 = 0; /* Set the
acceptance
> code */
> > > *(dword *)&CAN0IDAR4 = 0; /* Set the
acceptance
> code */
> > > *(dword *)&CAN0IDMR0 = 0; /* Set the
acceptance
> mask */
> > > *(dword *)&CAN0IDMR4 = 0; /* Set the
acceptance
> mask */
> > > CAN1_SetHigh(); <-- Bit rate /* Set
> speed */
> > >
> > > If transmission is enabled before the correct bitrate is
set,
> then
> > the
> > > device(node) may try to synchronize with wrong bit rate and
> this
> > will "jam"
> > > the CAN bus.
> > >
> > > Regards,
> > >
> > > Juuso Kaitalo
> > > Software Developer
> > > Honeywell - Automation & Control Solutions
> > > Real-time software
> > > Control System Development
> > > Finland
> > >
> > >
> > > -----Original Message-----
> > > From: sabinaca1997 [mailto:sabinaca@h...]
> > > Sent: 28. toukokuuta 2004 10:58
> > > To:
> > > Subject: [68HC12] Re: MSCAN bean transmision problem
> > >
> > >
> > > Hi,
> > >
> > > Thanks for your answer, but I don't think that is the
problem
> now
> > > (although at some time I'm sure it was), because the ID for
the
> > sent
> > > messages is different. That is the one difference between
the 2
> > > boards.
> > >
> > > I'm still trying to find the solution... if you have any
other
> > > suggestion I will be very glad to hear it!!
> > > The Processor expert beans are creating a set of functions
to
> > > initialize and send-receive from/to mscan.
> > > From the code examples I have seen around, the "Beans" are
> doing
> > > pretty much the same as them, so I guess that is ok, but it
> would
> > be
> > > nice if anybody could tell me about their experience with
> > > those "Beans", are they good enough? Do they have bugs?
> > >
> > > As I say, still testing different solutions....
> > >
> > > Thanks again!
> > > Sabina Catalbr /> > > >
> > > --- In , John Dammeyer <johnd@a...>
wrote:
> > > > Hi,
> > > >
> > > > I'm having successful communications using the same
> processor.
> > The
> > > Lawicel WiCAN library for the
> > > > ICC-12 compiler for the 68HC12 is what I used as a
starting
> > point.
> > > I have no idea what the 'beans'
> > > > do. However, assuming that you have everything
initialized
> > > correctly one common CAN design problem
> > > > is to have two modules send identical ID parts of the
message
> > with
> > > different data parts.
> > > >
> > > > That's just not allowed. It's physically possible but
each
> node
> > > will have a different CRC which
> > > > will then create error flags. That's why if you use only
one
> of
> > > your nodes there aren't problems
> > > > but if you use two of your nodes with identical software
they
> > > probably start transmitting at the
> > > > same time.
> > > >
> > > > 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: sabinaca1997 [mailto:sabinaca@h...]
> > > > > Sent: Thursday, May 27, 2004 4:46 AM
> > > > > To:
> > > > > Subject: [68HC12] MSCAN bean transmision problem
> > > > >
> > > > >
> > > > > Hi everyone on this list!
> > > > >
> > > > > I am experiencing a problem with the programming of the
> MSCAN
> > on
> > > a
> > > > > MC9S12DP256BCPV.
> > > > > I have created and tested a "quasi" CANOpen protocol
using
> the
> > > > > Processor Expert beans created from Codewarrior.
> > > > > I just had to set the right baudrate, set the masks and
> using
> > the
> > > > > CAN_Init(), the SendFrameExt(...) and calling ReadFrame
> (...)
> > from
> > > the
> > > > > OnFullRxBuffer() interruption, I had the protocol up
and
> > running
> > > in
> > > > > almost no time.
> > > > >
> > > > > This was OK until......I connected one more device
> programmed
> > the
> > > > > same way. Then the bus gets crazy and none of the
devices
> are
> > > able to
> > > > > receive anything the CAN transceivers will undestand.
The
> IXXAT
> > > > > CanAnalyser shows warning level on the bus and is not
> showing
> > > > > anything else until I disconnect one of my devices.
> > > > >
> > > > > So, I can connect any number of CANOpen devices but
only
> one of
> > > those
> > > > > I have developed at the time.
> > > > >
> > > > > Doesn't seem that the problem comes from the hardware
on
> the
> > > board,
> > > > > so I start to think that maybe the Bean I have used is
not
> so
> > > very
> > > > > good....or I have missed some configuration
steps....reset
> > > flags...I
> > > > > don't know!!
> > > > >
> > > > > Any body has a hint or any experience using the beans?
> > > > >
> > > > >
> > > > > Any help would be highly appreciated!!!!!
> > > > > Thanks in advance to everyone.
> > > > >
> > > > > S. Catalbr /> > > > > >
> > > > >
> > > > >
> > > > > ------------------------
> >
> >
> >
> >
> >
> > ----------------------------
----
> ----------
> > Yahoo! Groups Links
> >
> > a.. To
> >
> >
> >
> >
> --------------------To learn
more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
> o learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu >
> --------------------------------
----------
> Yahoo! Groups Links
>
> a.. To >
>





Hi Sabina,

The way CAN works is that a second CAN device must be there to insert a dominant ACK bit into the
recessive ACK slot in order for the transmitter to stop sending.

That's not to say that sending with an open loop doesn't yield some diagnostic information. When
the CAN device doesn't get an ACK it sends again and again and again.

Now it depends on the type of scope you have but if you adjust your scope so it triggers on one of
the edges and does a single shot and holds that for you to look at you can easily determine the bit
rate of the message. You might have to do this a few times but eventually you will see a shorter
high or a shorter low. All other highs and lows are multiples of this.

If your scope isn't a storage scope then you have to adjust the trigger and the sweep rate until you
see that shortest trace somewhat steady. Harder to explain than to actually do.

The point is that if the width of that short bit is 3uS for example then that means your bit rate is
333,333 bps. Everyone on the network has to run the same bit rate.

Another scope trick is to have a number of nodes on the network and to carefully adjust the trigger
level so it just triggers on a dominant bit. If you have enough nodes, the ACK sent by all nodes
is usually a strong dominant bit than all the other dominant bits from a single node. Trigger on
that strong dominant and put the trigger at the far right hand side of the screen and you'll see the
last few bits of the CRC field.

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: sabinaca1997 [mailto:]
> Sent: Tuesday, June 01, 2004 7:09 AM
> To:
> Subject: [68HC12] Re: MSCAN bean transmision problem > Hi Steve,
>
> Thanks for your tips!!
> I'm still dealing with the same problem.
> As you suggested, I have a very simple project. Just the CAN bean and
> a Timer.
> Sending CAN_A_SendFrameExt(0x701, DATA_FRAME, 1, 5) after 10 seconds,
> only once.
>
> Now we are trying to track down the problem to the basic, so, looking
> the signal with the osciloscope, with the bus not connected to
> anything, we analize the TX signal, and the result is that as soon a
> signal is sent, and nothing is connected to the line, the mcu
> gets "jammed" or at least that is what it looks like. The TX pin from
> the mcu is sending pulses with 5kHz period, nothing similar to a CAN
> signal.
>
> Does anybody know if this is normal with the bus not connected to
> the board (PM1_TxCAN0_TxB in the air)?
> I would expect that the signal just looks fine when nothing is
> connected, or does it have to be connected to a transceiver?
>
> Thanks again!!
>
> Sabina
>
> --- In , "Steve Letkeman" <hc12list1@z...>
> wrote:
> > If you think the hardware is OK, than I would simplify the software
> > down to a basic CAN send and receive functionality. I have posted
> > a sample program for CAN to this list a number of times that you
> > could use or you can email me directly for it. I'll take a quick
> > look at the schematic if you want to send that to me directly.
> > Steve
> >
> > Steven D. Letkeman BSc.
> > President - Zanthic Technologies Inc.
> > 403-526-8318
> > www.zanthic.com Embedded micro-controllers and CAN interfaces
> > www.brightan.com Automated lighting systems
> >
> > ----- Original Message -----
> > From: sabinaca1997
> > To:
> > Sent: Friday, May 28, 2004 8:30 AM
> > Subject: [68HC12] Re: MSCAN bean transmision problem
> >
> >
> > Hi,
> >
> > Thanks for answering!
> > Well, could be... but, at least form what I can see, we have a
> > TJA1040 Tranceiver connected to our microcontroller trough a
> digitial
> >
> > We have connected directly the output of the tranceiver to the
> bus
> > (CANH,CANL), and we have put a ceramic capacitor of 100nf to
> ground
> > to improve the EMC behaviour in each CAN ouput.
> > We mcu is connected to a Digital Isolator Adum1301 to separate
> the
> > Can zone to the mcu zone.
> > And the Digital Isolator Output is connected to the input of the
> > Tranceiver.
> > If you want, I can send you a capture screen of the Scheme.
> >
> > Thanks in advance.
> >
> > S. Catalbr /> > >
> >
> >
> >
> > --- In , "Steve Letkeman" <hc12list1@z...>
> > wrote:
> > > It almost sounds like you've got your transceiver wired in such
> > > a way that it is looping data back on the bus without the HC12.
> > > There should be no reason why the disabled mscan device
> > > should interfere with the working one. How do you have the
> > > HC12 to transceiver wired and how is the transceiver wired to
> > > the bus? Something else to try would be to run a simple CAN
> > > test program on each node.
> > > Steve
> > >
> > > Steven D. Letkeman BSc.
> > > President - Zanthic Technologies Inc.
> > > 403-526-8318
> > > www.zanthic.com Embedded micro-controllers and CAN interfaces
> > > www.brightan.com Automated lighting systems
> > >
> > > ----- Original Message -----
> > > From: sabinaca1997
> > > To:
> > > Sent: Friday, May 28, 2004 6:46 AM
> > > Subject: [68HC12] Re: MSCAN bean transmision problem
> > >
> > >
> > > Hi,
> > >
> > > Thanks for a new tip!
> > >
> > > Well I'm not sure, but I believe those things (bit rate,
> clock
> > > source, etc) are in place, because the board is working fine
> with
> > any
> > > other sort of CAN device connected to it, but another with
> the
> > same
> > > microcontroller and transceiver.
> > >
> > > In case I wasn't quite clear in my previous message, I'll try
> to
> > > explain the problem better:
> > >
> > > We have:
> > > Board nr. 1, with ID = 1, mscan enabled sending COB-ID 0x701
> > every
> > > 100ms
> > > Board nr. 2, ID = 7, mscan enabled sending COB-ID 0x707 every
> > 200ms
> > > Board nr. 3, mscan is not enabled.
> > > All our boards have TJA1040 transceivers.
> > >
> > > Our board nr. 1 (for example) works fine when connected to,
> for
> > > example, 3 IXXAT PC boards and 1 CAN device with a SJA1000
> CAN
> > > controller. This way I can send and receive CAN messages
> without
> > any
> > > kind of problem.
> > >
> > > If I disconnect from the bus nr. 1 and put nr. 2 instead,
> works
> > fine
> > > still.
> > > If I connect to the bus both nr. 1 and nr. 2, or nr. 1(or 2)
> and
> > nr. 3
> > > (no mscan enabled!) the HC12 seems to get crazy, and the RX
> > signal
> > > becomes pulses with 4.8kHz, instead of CAN messages.
> > >
> > > Could be a hardware problem as well, but I can't figure it
> out!
> > >
> > > Does any body have a CAN application using the Processor
> expert
> > beans
> > > working fine with several devices of the same type?
> > >
> > > Any help will be appreciated!!
> > >
> > > Sabina Catalbr /> > > >
> > > --- In , "Kaitalo, Juuso (FI06)"
> > > <Juuso.Kaitalo@h...> wrote:
> > > > Hi,
> > > >
> > > > Check bit rate, clock source and node-id. Make sure that
> you
> > don't
> > > enable
> > > > MSCAN before bitrate is configured.
> > > > In a bean, MSCAN is enabled before initialization of timing
> > > register,
> > > > acceptance code and mask:
> > > >
> > > > CAN0CTL0 = 1; /* Set the control
> > register
> > > */
> > > > CAN0CTL1 = 128; <-- CANE bit /* Set the control
> > register
> > > */
> > > > CAN0IDAC_IDAM = 0; /* Set the
> acceptance
> > mode */
> > > > *(dword *)&CAN0IDAR0 = 0; /* Set the
> acceptance
> > code */
> > > > *(dword *)&CAN0IDAR4 = 0; /* Set the
> acceptance
> > code */
> > > > *(dword *)&CAN0IDMR0 = 0; /* Set the
> acceptance
> > mask */
> > > > *(dword *)&CAN0IDMR4 = 0; /* Set the
> acceptance
> > mask */
> > > > CAN1_SetHigh(); <-- Bit rate /* Set
> > speed */
> > > >
> > > > If transmission is enabled before the correct bitrate is
> set,
> > then
> > > the
> > > > device(node) may try to synchronize with wrong bit rate and
> > this
> > > will "jam"
> > > > the CAN bus.
> > > >
> > > > Regards,
> > > >
> > > > Juuso Kaitalo
> > > > Software Developer
> > > > Honeywell - Automation & Control Solutions
> > > > Real-time software
> > > > Control System Development
> > > > Finland
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: sabinaca1997 [mailto:sabinaca@h...]
> > > > Sent: 28. toukokuuta 2004 10:58
> > > > To:
> > > > Subject: [68HC12] Re: MSCAN bean transmision problem
> > > >
> > > >
> > > > Hi,
> > > >
> > > > Thanks for your answer, but I don't think that is the
> problem
> > now
> > > > (although at some time I'm sure it was), because the ID for
> the
> > > sent
> > > > messages is different. That is the one difference between
> the 2
> > > > boards.
> > > >
> > > > I'm still trying to find the solution... if you have any
> other
> > > > suggestion I will be very glad to hear it!!
> > > > The Processor expert beans are creating a set of functions
> to
> > > > initialize and send-receive from/to mscan.
> > > > From the code examples I have seen around, the "Beans" are
> > doing
> > > > pretty much the same as them, so I guess that is ok, but it
> > would
> > > be
> > > > nice if anybody could tell me about their experience with
> > > > those "Beans", are they good enough? Do they have bugs?
> > > >
> > > > As I say, still testing different solutions....
> > > >
> > > > Thanks again!
> > > > Sabina Catalbr /> > > > >
> > > > --- In , John Dammeyer <johnd@a...>
> wrote:
> > > > > Hi,
> > > > >
> > > > > I'm having successful communications using the same
> > processor.
> > > The
> > > > Lawicel WiCAN library for the
> > > > > ICC-12 compiler for the 68HC12 is what I used as a
> starting
> > > point.
> > > > I have no idea what the 'beans'
> > > > > do. However, assuming that you have everything
> initialized
> > > > correctly one common CAN design problem
> > > > > is to have two modules send identical ID parts of the
> message
> > > with
> > > > different data parts.
> > > > >
> > > > > That's just not allowed. It's physically possible but
> each
> > node
> > > > will have a different CRC which
> > > > > will then create error flags. That's why if you use only
> one
> > of
> > > > your nodes there aren't problems
> > > > > but if you use two of your nodes with identical software
> they
> > > > probably start transmitting at the
> > > > > same time.
> > > > >
> > > > > 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: sabinaca1997 [mailto:sabinaca@h...]
> > > > > > Sent: Thursday, May 27, 2004 4:46 AM
> > > > > > To:
> > > > > > Subject: [68HC12] MSCAN bean transmision problem
> > > > > >
> > > > > >
> > > > > > Hi everyone on this list!
> > > > > >
> > > > > > I am experiencing a problem with the programming of the
> > MSCAN
> > > on
> > > > a
> > > > > > MC9S12DP256BCPV.
> > > > > > I have created and tested a "quasi" CANOpen protocol
> using
> > the
> > > > > > Processor Expert beans created from Codewarrior.
> > > > > > I just had to set the right baudrate, set the masks and
> > using
> > > the
> > > > > > CAN_Init(), the SendFrameExt(...) and calling ReadFrame
> > (...)
> > > from
> > > > the
> > > > > > OnFullRxBuffer() interruption, I had the protocol up
> and
> > > running
> > > > in
> > > > > > almost no time.
> > > > > >
> > > > > > This was OK until......I connected one more device
> > programmed
> > > the
> > > > > > same way. Then the bus gets crazy and none of the
> devices
> > are
> > > > able to
> > > > > > receive anything the CAN transceivers will undestand.
> The
> > IXXAT
> > > > > > CanAnalyser shows warning level on the bus and is not
> > showing
> > > > > > anything else until I disconnect one of my devices.
> > > > > >
> > > > > > So, I can connect any number of CANOpen devices but
> only
> > one of
> > > > those
> > > > > > I have developed at the time.
> > > > > >
> > > > > > Doesn't seem that the problem comes from the hardware
> on
> > the
> > > > board,
> > > > > > so I start to think that maybe the Bean I have used is
> not
> > so
> > > > very
> > > > > > good....or I have missed some configuration
> steps....reset
> > > > flags...I
> > > > > > don't know!!
> > > > > >
> > > > > > Any body has a hint or any experience using the beans?
> > > > > >
> > > > > >
> > > > > > Any help would be highly appreciated!!!!!
> > > > > > Thanks in advance to everyone.
> > > > > >
> > > > > > S. Catalbr /> > > > > > >
> > > > > >
> > > > > >
> > > > > > ------------------------
> > >
> > >
> > >
> > >
> > >
> > > ----------------------------
> ----
> > ----------
> > > Yahoo! Groups Links
> > >
> > > a.. To
> > >
> > >
> > >
> > >
> >
> >
> >
> > --------------------To learn
> more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> > o learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --------------------------------
> ----------
> > Yahoo! Groups Links
> >
> > a.. To
> >
> >
> >
> >
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dN_tlB/TM
> --------------------------
> ------~->
>
> --------------------To
> learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
> o learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
>
> Yahoo! Groups Links >
>