Hi Elites,
I have CAN emulator(gridconnect USB/CAN adapter) connected to S32K144 board as in below picture.
For your information: I am running S32K144_CAN_SLAVE_Example application on board.
I am able to send CAN message from emulator to S32K144. Even LED is toggling on the board, it is receiving CAN messages.
But I am unable to send CAN messages from board to emulator i.e, When I press button on board, it seems board should send CAN message but emulator is observing stuff error as in below picture.
Any suggestion please, why board is not able to send CAN messages ?
Thanks
Mohan
hi,Mohan:
can you tell me some details about it?how to change the time setting?
Hi,
Can you please check FlexCAN sample example in S32 Design studio. It will work for both sending and receiving CAN messages.
Thanks
Mohan
Hi MoHan,
Can you supply your correct configuration sample!
Thanks,
Frank
hi,Mohan:
Have you solved this problem?I met it the same to u.Evenmore ,I amnot able to send CAN message from emulator to S32K144, neither.
wait for you reply.
thanks
Ean
Hi Ean,
Yes problem is solved for me. It was problem with clock setting.
Thanks
Mohan
Hello Mohan,
could you please check timing settings? At the first sight it looks like timing error.
Regards,
Martin
Hi Martin,
Please see bit rate timings. This is captured during debugging.
Thanks
Mohan
Hello Mohan,
and what are the timing settings you use in your USB/CAN tool?
Could you please measure the CAN bus when you send data from microcontroller and send me the screen?
Also, could you please send me the screen of USB/CAN tool receive message settings?
Regards,
Martin
Hi Martin,
I am using 500 kBit/s time setting. Please see below screenshot.
With this setting, sending of CAN message to board(S32K144 EVB) from USB/CAN tool is successful.
There is problem only when CAN message is sent from board to USB/CAN tool. Below screenshot for reference.
I am running below example on board.
Thanks
Mohan
Hello Mohan,
your timing settings set in FlexCAN module seems to be strange. Please use the settings below:
CAN0->CTRL1 = 0x00DB0006; /* Configure for 500 KHz bit time */
/* Time quanta freq = 16 time quanta x 500 KHz bit time= 8MHz */
/* PRESDIV+1 = Fclksrc/Ftq = 8 MHz/8 MHz = 1 */
/* so PRESDIV = 0 */
/* PSEG2 = Phase_Seg2 - 1 = 4 - 1 = 3 */
/* PSEG1 = PSEG2 = 3 */
/* PROPSEG= Prop_Seg - 1 = 7 - 1 = 6 */
/* RJW: since Phase_Seg2 >=4, RJW+1=4 so RJW=3. */
/* SMP = 1: use 3 bits per CAN sample */
/* CLKSRC=0 (unchanged): Fcanclk= Fosc= 8 MHz */
Regards,
Martin
Hi Martin,
On MCU side I made your changes. Below screenshot for reference.
Still I am only able to send CAN message from USB/CAN tool to MCU.
But I am not able to send CAN message from MCU. Below screenshot observed on PCAN view.
Hello Mohan,
unfortunately, I do not have USB/CAN adapter to check on my side. I can only recommend you to use second S32K board and try the communication between two boards.
Regards,
Martin
Hi Martin,
How do I check timing settings ?, can you please elaborate more on this.
Thanks
Mohan