Hello,
I'm using KDS to development of an CAN comunication project.
I'm trying to understand the CAN_Node1_demo example. This example is building and I can send this to the board by openSDA. But I don't understand the baud rate and how this program works.
I have a PEAK CAN hardware and can't read anything from the FRDM KE06.
Can anyone help me to understand how this example works?
I have the same project in a microchip microcontroler and this works fine. NXP/Freescale is new to me and I'm very confusing in this hardware.
Thanks.
Hi Renan,
For example:
If you want to set the standard identifier 0x7E, then you should:
#define NODE_ID1 0x7E<<18
sCANTxItemInfo.bIsExtOrStand = 0; //standard frame
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I need to receive the 0x50 standard ID.
I change the CAN_IDAR0 to 0x50 << 1, but don't works.
Is there another register to change?
Thanks
Hi
Please modify the baudrate define:
#define BAUD_RATE_SJW 0 /*!< 1 set Synchronization Jump Width. */
#define BAUD_RATE_BRP 19 /*!< 1 Baud Rate Prescaler */
#define BAUD_RATE_SAMP 0 /*!< 0-One sample per bit, 1-three sample per bit. */
#define BAUD_RATE_TSEG1 TSEG_5 /*!< Time Segment 1*/
#define BAUD_RATE_TSEG2 TSEG_4 /*!< Time Segment 2*/
#define BAUD_RATE_CLOCK 20000000L/*!< clock source for MSCAN 20M bus clock, 8M external clock*/
#define Baud_RATE BAUD_RATE_CLOCK /(BAUD_RATE_BRP+1) / (1 + BAUD_RATE_TSEG1+ BAUD_RATE_TSEG2)
Then you can see the 100kbps CAN messages.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I know this is an old post, but can u provide the name of the tool used to see the CAN messages log? It would be very useful for my project.
:smileyhappy:
Another question, How can I send standard identifier messages?
I try to change the code to do that, but don't work. The transmit messages has 0x000 in the ID field.
Thanks.
Still not working.
Opening the serial terminal to see the debug messages only appears the initial messages from the code:
--System Log BEGINS--
Familly ID = 0x0, Sub-family ID = 0x6, Revision ID = 0x2, Pin ID = 0x8
Pin Reset--System Log ENDS--
Running the KE06 CAN_Node1_demo project.
In PCAN View software don't appear any message.
Thanks.