Unable to transmit CAN messages

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

Unable to transmit CAN messages

2,630 Views
jmu
Contributor I

Hi,

I am new to MSCAN and I am currently unable to transmit CAN messages. The micro controller is part of the MC9S12ZVC family and I am using a USB multilink universal debugger to communicate with the same. I am trying to code this using CodeWarrior with the help of Processor Expert. For the CAN messages to have 250k baud rate with a 20MHz external crystal or an internal oscillator of 1MHz what should the following flags be set to  -

 

 CAN0BTR0: SJW1, SJW0, BRP5, BRP4, BRP3, BRP2, BRP1, BRP0 
 CAN0BTR1: SAMP, TSEG22, TSEG21, TSEG20, TSEG13, TSEG12, TSEG11, TSEG10

 

I would deeply appreciate any help that comes my way.

 

Warm Regards,

Anurag

Labels (1)
Tags (1)
0 Kudos
Reply
9 Replies

2,423 Views
jmu
Contributor I

Thank you Alice. Really appreciate you looking it up and confirming it.

0 Kudos
Reply

2,423 Views
jmu
Contributor I

Alice, i am willing to bet CANH and CANL signals are not available on ZVCA package and will need a transceiver to translate the MSCAN signals.

0 Kudos
Reply

2,423 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Mahendra,

- Yes,  in the chip of MC9S12ZVC128MKH,  the pins CANH and CANL signal are not available,

we can see it from the Reference Manual, you also show it on the former information :

pastedImage_1.png

- About the Processor Expert configuration , please select the "Advanced", then you can see the more conifguration

selection :

pastedImage_2.png

Hope it helps


Have a great day,
Alice

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,423 Views
jmu
Contributor I

Hi Alice,

We need the CAN messages to show up on pins 29 and 31. They seem to show up just fine on PS2 (pin 36). I think the problem lies in routing the CAN messages to the required pin. From what we understand the register responsible for routing the CAN lines is MODRR0 which we tried setting to values from 0x00 to 0x07 with no success. Below are the registers values we are setting - 

pastedImage_1.png

We have also tried toggling the Split enable on and off but it doesn't seem to have any effect. 

Can you think of any registers that we need to set or any flags that we are required to enable to route the CAN lines to PIN 29 and 31? Once again deeply appreciate  your help regarding this matter. 

0 Kudos
Reply

2,423 Views
jmu
Contributor I

Looks like this is available in Port/IO routing but i am still struggling to transmit a message. Do we need to do anything on VCanphy0 interrupt service.

0 Kudos
Reply

2,423 Views
jmu
Contributor I

Hi Alice,

Thanks for your detailed answer. Unfortunately i dont see the options what you see. Is this a version issue or could it be a bug in the specific version of processor expert for our processor. We specifically want to use the pin 29 and 31 because our board uses these pins. Is there a backdoor option of check why we are not seeing anything other than MSCAN.

CANH_PHY2.png

0 Kudos
Reply

2,423 Views
jmu
Contributor I

Here's the specific problem.

So the CAN has been exposed to 3 different cpu pins PS0-PS1, PS2-PS3 and then there is CANH and CANL(pin 29 and 31). We can't seem to get it to work with CANH and CANL. It works on the other ones. In the initial part of the documentation there are dashes meaning 1st, 2nd, 3rd, 4th functions dont exist. We have had very little luck modifying MODRR0 to route it to these pins. It does not want to route MSCAN to CANPHY. So the question is has been removed and only 2 sets of CAN exists PS0-1 and PS2-3. I have attached the section with the dashes. We can't make heads or tails of it. CANH_PHY.png If you could confirm these CAN lines have not been discontinued can u please show us the exact way to configure it.

Thank you.

0 Kudos
Reply

2,423 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Mahendra,

- About the CAN module routing , please refer to Reference Manual :

pastedImage_1.png

- I see you use the Processor Expert,  after you add the component of CAN, you can configure the pin on

the component directly :

pastedImage_2.png

And there is demo code , you can also refer to : Right click the CAN component , then select "Help on component " ,

pastedImage_3.png

Then select "Typical Usage" :

pastedImage_5.png

- If these all can not help you , could you please tell me which pin do you want to be used as CAN pin , and

does your question is you do not know how to configure ?

Hope it helps !

Alice

0 Kudos
Reply

2,423 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Anurag,

Could you please describe your project in detail ?

What about the another CAN node communicate with MC9S12ZVC?

And which version of CW ? What about the code ? What about the problem ?

You can also show your project .

BR

Alice

0 Kudos
Reply