Devkit S12ZVC : CANH stucked High

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Devkit S12ZVC : CANH stucked High

916 次查看
luca_ferrario
Contributor II

Hello,

I've got a problem with the CAN bus, I've configured the MSCAN0 with code warrior expert (bit rate: 250 kbit). The system works fine in loop back mode: I can send data and the event CAN1_OnFullRxBuffer() is called, tha masks also work fine. I've got a problem when I want to use the CANPHY with CANH and CANL pins of the board: the CANH pin is stucked at high voltage! :smileysad:

I configured the CANPHY in this way:

CP0CR_CPE = 1; //Module Enable
CP0CR_SPE = 1; //Split Enable

and the M0C0RR[2:0] to 000

Did i miss something in the configuration of the CANPHY?

I've also tried to probe the data between CANPHY and MSCAN0 with the M0C0RR[2:0] configuration 0b100, in order to use the pins TXCAN0 and CPRXD0 as probes.

Channel 0: MSCAN0 TXCAN

Channel 1: MSCAN0 RXCAN

Channel 2: CANPHY0 CANH

Channel 3: CANPHY0 CANL

The RX data is coming from a PCAN simulator, if  the simulator is stopped no data is present on channel1 and channel 3.

pastedImage_156.png

Thanks for your help!

Regards

标记 (3)
0 项奖励
回复
2 回复数

828 次查看
luca_ferrario
Contributor II

I think I found the issue!

I have a problem with processor expert generation, cause I've downloaded an example that is not generated with the expert and with these libraries and seem to work fine:

#include <hidef.h>
#include "derivative.h"

void PLL_init(void){
CPMUCLKS_PLLSEL = 1; //FBUS = FPLL/2. FBUS = 32MHz,
CPMUREFDIV_REFFRQ = 1; //Reference clock between 2MHZ and 6MHZ.
CPMUREFDIV_REFDIV = 0x1; //FREF=8/(1+1) = 4MHZ
CPMUSYNR_VCOFRQ = 0x1; //FVCO is between 48MHZ and 80MHZ
CPMUSYNR_SYNDIV = 0x7; //FVCO = 2xFREFx(SYNDIV+1) = FVCO = 2x4x(7+1) = 64MHZ
CPMUPOSTDIV_POSTDIV = 0x0; //FPLL = FVCO/(POSTDIV+1). FPLL = 64MHZ/(0+1) FPLL = 64MHz
CPMUOSC_OSCE = 1; //External oscillator enable. 8MHZ. FREF=FOSC/(REFDIV+1)
while(!CPMUIFLG_LOCK){} // Wait for LOCK.
CPMUIFLG = 0xFF; // clear CMPMU int flags - not needed but good practice
}

There is a way to generate a functional CAN example with processor expert?

Cause I've generated the rest of my code with processor expert... :smileysad:

thanks!

0 项奖励
回复

828 次查看
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

Unfortunately, there is no CAN example with Processor Expert. 

I recommend you to look at AN4975 https://www.nxp.com/docs/en/application-note/AN4975.pdf 

By PLL_init() function you configured the clock frequency but you can also configure it by processor expert.

Best regards,

Diana

0 项奖励
回复