Need help getting mscan to sync

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

Need help getting mscan to sync

500 Views
boast
Contributor I

We're using a DEMO9S08DZ60-ND. We followed the appnotes for the mscan on the hc12, and modified it a bit. But mscan keeps getting stuck on the while loop trying to sync. We tried different sample code found online, and still nothing. The pins are only outputting 0V too.

 

void CANInit(void) {CANCTL0_INITRQ = 1; // enter initilization modewhile(!CANCTL1_INITAK); //wait until initialization mode is readyCANCTL1_CANE = 1; //enable mscan moduleCANCTL1_LOOPB = 1; //enable loopback modeCANCTL1_LISTEN = 0; //disable listen mode//set time segment 2 tq clock cycles to 3 CANBTR1_TSEG21 = 1;//set time segment 1 tq clock cycles to 6CANBTR1_TSEG12 = 1;CANBTR1_TSEG10 = 1;//set time quante of Synchronization jump width to 3 CANBTR0_SJW1= 1;// set clk prescale value to 3CANBTR0_BRP1 = 1; //disable identifier masking with don't cares. all messages received trigger interruptsCANIDMR0 = 0xFF;CANIDMR1 = 0xFF;CANIDMR2 = 0xFF;CANIDMR3 = 0xFF;CANIDMR4 = 0xFF;CANIDMR5 = 0xFF;CANIDMR6 = 0xFF;CANIDMR7 = 0xFF;CANCTL0_INITRQ = 0; // exit initialization modewhile(CANCTL1_SLPAK==1 && CANCTL1_INITAK==1); //wait until initialization mode exit successfullywhile(CANCTL0_SYNCH==0); //wait until mscan syncs}

 

 

not sure where exactly we're going wrong.

Labels (1)
0 Kudos
Reply
1 Reply

299 Views
kef
Specialist I

MSCAN is synchronized to the bus, when it receives valid message, send from different node. This probably won't ever happen in loopback mode.

0 Kudos
Reply