CAN Configuration in polling mode

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

CAN Configuration in polling mode

Jump to solution
2,819 Views
ajayyadav1996
Contributor III

Hello,
I am using example project (Can_example_S32K312) from NXP in S32DS. Here in this example CAN is configured in polling mode and "Loopback" functionality. To get this CAN data on port I disabled option of Loopback in configuration but not able to get data on port pin. Code is stucked in while loop where  Can_MainFunction_Write function is called inside (Because CanIf_bTxFlag is not getting set). I am using port pin PTA27 as CAN0Tx and PTA28 as CAN0Rx. Can anybody help here?

Please refer attachments.

ajayyadav1996_0-1690282283204.png

ajayyadav1996_1-1690282324990.png

ajayyadav1996_0-1690282370754.png

ajayyadav1996_1-1690282396279.pngajayyadav1996_2-1690282413502.pngajayyadav1996_3-1690282434239.png

ajayyadav1996_4-1690282468713.png

 


Best Regards,
Ajay

0 Kudos
1 Solution
2,688 Views
ajayyadav1996
Contributor III

Hello Together,

It worked!! I was using (XS32K3XXEVB -Q257) eval board, Where CAN0 Transceiver is internally connected to PTC26 and PTC27. I changed port configuration and changed CAN Tx/Rx to PTC26 and PTC27. Also, I initialized Can transceiver. To initialize on board Can transceiver (TJA1153), We should send high signal (5Volt) to EN and STB pin. On my eval board EN is connected to PTC21 and STB is connected to PTC20. I created 2 dio channels for the same and made these pins high to initialize on board can transceiver (TJA1153). And it worked. Thank you Petr

BR,

Ajay

View solution in original post

0 Kudos
4 Replies
2,689 Views
ajayyadav1996
Contributor III

Hello Together,

It worked!! I was using (XS32K3XXEVB -Q257) eval board, Where CAN0 Transceiver is internally connected to PTC26 and PTC27. I changed port configuration and changed CAN Tx/Rx to PTC26 and PTC27. Also, I initialized Can transceiver. To initialize on board Can transceiver (TJA1153), We should send high signal (5Volt) to EN and STB pin. On my eval board EN is connected to PTC21 and STB is connected to PTC20. I created 2 dio channels for the same and made these pins high to initialize on board can transceiver (TJA1153). And it worked. Thank you Petr

BR,

Ajay

0 Kudos
2,760 Views
Adrsangar
Contributor I

Hi, 

I am using the board S32K344 TBOX. I am using the example project 'CAN_Example_S32K344'. I disabled the loopback mode of can and i have configured the ports PTA6 and PTA7 to CAN0_RX and CAN0_TX but i am not able to see can messages with the pcan connected to the board. Need i to configure anything else more?

Thank you in advance.

Adrsangar_0-1690453699039.png

Adrsangar_1-1690453713162.png

Adrsangar_2-1690453720704.png

 

 

0 Kudos
2,735 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if really using S32K344 Tbox board, then based on board schematic (https://www.nxp.com/webapp/Download?colCode=SCH-50735) no CAN transceiver is connected to PTA6/PTA7.
I can recommend to use some simple one, which do not require any init, e.g. TJA1462 which is connected to FlexCAN2 using PTC7/PTC6.

BR, Petr

2,791 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if not using loopback mode you need active CAN transceiver connected to CAN pins and have other node on CAN bus which can ACK sent message.
PTA27/PTA28 pins have CAN0 functionality but nothing is connected there. You can try connect both (PTA27/PTA28) for test and measure with scope/analyzer. You should see message transmitted still because of missing ACK. If you connect some external CAN transceiver then it can work when communicate with other node.
On the EVB PTA6/PTA7 pins are connected to CAN transceiver (TJA1043). To use it change pin setting and connect other node.

BR, Petr