MSCAN on the HCS12

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MSCAN on the HCS12

4,763 Views
metboy
Contributor I
Hi,
I've just used the Software in the App Note AN3034 to program the MSCAN. I've changed nothing in the software, but only deactivated loop back self test mode ( in CANCTL1 ).
But in the CAN0SendFrame() the Transmission completes never. The Code execution freezes hier:
CAN0TFLG = txbuffer;   // Start transmission 
while ( (CAN0TFLG & txbuffer) != txbuffer);  
// Wait for Transmission completion
I have no idea why!
i'll be thankful for your help!
 
 
Labels (1)
0 Kudos
Reply
4 Replies

667 Views
Steve
NXP Employee
NXP Employee

metboy,

 The CAN bus requres that nodes acknowledge messages. This happens automatically, but you need at least two nodes on the bus otherwise it will never complete a transmission.

0 Kudos
Reply

667 Views
metboy
Contributor I

Thanks Steve,

for my purpuse, i have to use only one node at this time. can i send the acknowledge myself?  

0 Kudos
Reply

667 Views
imajeff
Contributor III
At least in my HC12 there is a LOOP bit I can set for testing, letting me send messages to myself.
0 Kudos
Reply

667 Views
Steve
NXP Employee
NXP Employee

You need a receiving CAN node so you either need to create a network or use loopback mode.

0 Kudos
Reply