Hi Friends, I have two piece Trk-kea128 boards. I am using Code Warrior and Processor Expert .
I want to Can-Bus communication between two boards.
When I pressed button TRK-1 will send message and When TRK-2 received true message The led will turn on.
Regards,
Uğur
Hi,
I am also working on similar task with freedom ke06z boards.
I have two MKE06Z boards with me. One is Evaluation board and one is custom board.
I have connected the CAN_H and CAN_L pins of the evaluation board to CAN_H and CAN_L of the custom board.
I am planning to make an LED to blink on custom board when I press a button on evaluation board.
On evaluation board I have created a project on KDS. In this project I have added CAN_LDD component. In the typical usage I see a program Sending data frame with interrupt service. I have just copied that code.
Similarly on the custom board side I have created another project and in that project also I have added CAN_LDD component and here I copied the code Receiving data frame with interrupt service.
I flash the both codes to their respective boards. I never see LED blinking on my custom board when I press a button on evaluation board. The interrupts never occured in both projects.
Am I doing it on right way?.
Pls someone suggest the correct way?. I am not able to find where Im doing mistake.
Hi Alice,
I didn't add Gpio_LDD because I am writing code of loopback but It isn't working.
Can_Tx <======> Can_Rx short circuit
I am using Can_LDD and Bit_IO and Console_IO.
My code is here.
I am sorry for I couldn't answer early.
Have a great day,
Uğur
Hello Ugur,
I have checked your project and test on my side .
Please change these place :
1) Please enable the CAN interrupt, or you can not use the interrupt function , so the flag of
"DataFrameTxFlg" can not set to "TRUE" :
2) The array of " InputData[]" is start from "0", not "1" , so please configure the code to "
Then re-build the project ,the LED can light , i have test it on my board .
Hope it helps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Alice,
I wrote this code but I couldn't add button code. how can i add button code?
Regards,
Have a great day,
Ugur
Hello Ugur,
You can add one "GPIO_LDD" component , then configure the gpio to your button pin.
Hope it helps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Alice,
I didn't add Gpio_LDD because I am writing code of loopback but It isn't working.
Can_Tx <======> Can_Rx short circuit
I am using Can_LDD and Bit_IO and Console_IO.
My code is here.
I am sorry for I couldn't answer early.
Have a great day,
Uğur
Hello Ugur,
You can configure the GPIO interrupt to send message ;
in the CAN receive interrupt to set on the LED.
About the CAN send and receive configuration, please refer to the
"Typical Usage" :
Hope it helps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------