This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hi,
I am trying to connect C2000 launchpad XL TMS320F28379D to elmo driver.
So I started step by step
I wanted to check how does CAN work
So I pulled up the external CAN example and as mentioned in the example
GPIO 30 (CAN A RX) was connected to directly to GPIO 8 (CAN B TX) using jumper
GPIO 31 (CAN A TX) was connected to directly to GPIO 10 (CAN B RX) using jumper
Is this approach correct?
Do I have to change frequency or anything else
Also the pin numbers I have used is as below, I have pulled them from schematic
GPIO 30 - pin 46
GPIO 31 - pin 45
GPIO 10 - pin 76
GPIO 8 - pin 78
This is not a valid approach. Please read section 3.2 of my app.note SPRA876.
Dear Hareesh J,
Thankyou for your reply. As per the article I need a transceiver to connect to the TXA and RXA pins which can convert the signals to CAN H and CAN L (the can bus) to which all the can devices can be connected.
I had a couple of doubts:
1. There are CAN H , CAN L and GND pins on the F28379D launchpad ver. 2 which implies it has an inbuilt transceiver. Is my assumption correct?
2. If my assumption is correct, how do I Code those pins to send data over CAN H and CAN L pins, here my intention is to connect two F28379D boards with CAN H and CAN L lines and watch CAN communication (send and receive the data over CAN bus) . How do I code it? Is there an example of the same?
3. If my assumption is incorrect then I would use transceiver to convert TXA and RXA signals to CAN H and CAN L. Is this right?
4. Once I am able to properly work with CAN communication with two boards my final aim is to connect one launchpad to elmo driver solo gold twitter which supports CANopen communication
Thanks in advance
1. There are CAN H , CAN L and GND pins on the F28379D launchpad ver. 2 which implies it has an inbuilt transceiver. Is my assumption correct?
Correct. You can see the transceiver in the schematics in C:\ti\c2000\C2000Ware_1_00_06_00\boards\LaunchPads\LAUNCHXL_F28379D\R2.0 directory of C2000Ware.
2. If my assumption is correct, how do I Code those pins to send data over CAN H and CAN L pins, here my intention is to connect two F28379D boards with CAN H and CAN L lines and watch CAN communication (send and receive the data over CAN bus) . How do I code it? Is there an example of the same?
Please take a look at can_ex3_external_transmit example in C:\ti\c2000\C2000Ware_1_00_06_00\driverlib\f2837xd\examples\cpu1\can
3. If my assumption is incorrect then I would use transceiver to convert TXA and RXA signals to CAN H and CAN L. Is this right?
Transceiver is part of the Launchpad.
Thankyou for the reply
I have couple of doubts more
as seen in the above screenshot, the connection come to D and R of the transceiver come from GPIO12 and GPIO17,
Hence I need to include the above GPIO pin numbers instead of GPIO 30,31 which is used by default in the code. Right?
Secondly I am trying to find the pin map which shows me the GPIO pin to pin number mapping on the physical board?
I have referred schematic and datasheet.
My approach is to find GPIO pin 10 in below diagram and since its pin 6 in J8 it would be pin 76 on the physical board. Is this approach correct?
and last one,
Since I have to start CAN communication on two boards I will program GPIO 12 and GPIO 17 in board 1 and send TX msg from it and write similar code in other board to receive the messages sent. Is this understanding of CAN correct.
Thank you in advance sir!!
Hence I need to include the above GPIO pin numbers instead of GPIO 30,31 which is used by default in the code. Right?
My approach is to find GPIO pin 10 in below diagram and since its pin 6 in J8 it would be pin 76 on the physical board. Is this approach correct?
Since I have to start CAN communication on two boards I will program GPIO 12 and GPIO 17 in board 1 and send TX msg from it and write similar code in other board to receive the messages sent. Is this understanding of CAN correct.
As shown in the above screenshot the physical board I am referring to is above one. As I was saying on schematic it shows GPIO 10 corresponds to 6th pin in J8 that means on the physical board it means pin 76. Is this understanding correct?
Just confirming GPIO12 and GPIO17 would have to be programmed to generate CANH and CANL signals. These waveforms could be watched on oscilloscope by connecting the probe to CANH and probe GND to CAN GND?
Can I just code the transmission part and program on one board and just monitor the CAN waveforms on the output before writing a code for receiving end. This should work right? Or does the receive code must and all the CAN bus needs to connected?
Thank you in advance
As shown in the above screenshot the physical board I am referring to is above one. As I was saying on schematic it shows GPIO 10 corresponds to 6th pin in J8 that means on the physical board it means pin 76. Is this understanding correct?
Just confirming GPIO12 and GPIO17 would have to be programmed to generate CANH and CANL signals. These waveforms could be watched on oscilloscope by connecting the probe to CANH and probe GND to CAN GND?
Can I just code the transmission part and program on one board and just monitor the CAN waveforms on the output before writing a code for receiving end. This should work right? Or does the receive code must and all the CAN bus needs to connected?
Dear Sir,
Thankyou for the reply. From the waveform, I can conclude the transmitter is sending the same frame again and again. As you have said and also I have read in your note SPRA876b and SPRA890, the transmitter is not receiving any ACK bits.
Now I have a couple of doubts:
1. Is the ACK generation done by writing a separate code or is it taken care of by the CAN protocol itself? (ofcourse after successful connection is established)
2. I have single stepped my receive side code in debug mode and the code does not enter CANbISR, so is my conclusion of wrong logic in receive side correct or am I missing something else .Code is written below.
3. Can you share any document on how to write mailboxes in transmit and receive side. My understanding of CAN is whatever mailboxes I write in CAN on transmit side the same mailboxes have to written on receive side by making appropriate changes. Is this understanding correct.
4. What exactly is the difference of CAN msg object and CAN mailboxes.
Dear Sir, I am new to this communication. Thankyou in advance
From the waveform, I can conclude the transmitter is sending the same frame again and again. As you have said and also I have read in your note SPRA876b and SPRA890, the transmitter is not receiving any ACK bits.
OK. This is what I suspected. Your first order of business is to ensure that an ACK is received. Unless this happens, any further debug is pointless.
Is the ACK generation done by writing a separate code or is it taken care of by the CAN protocol itself? (of course after successful connection is established)
It is taken care of by the protocol. Any receiver that received the frame successfully will generate an ACK.
I have single stepped my receive side code in debug mode and the code does not enter CANbISR, so is my conclusion of wrong logic in receive side correct or am I missing something else .Code is written below.
If code does not enter the ISR, the frame is not received. Not surprising since you don’t even see an ACK.
Can you share any document on how to write mailboxes in transmit and receive side. My understanding of CAN is whatever mailboxes I write in CAN on transmit side the same mailboxes have to written on receive side by making appropriate changes. Is this understanding correct.
I don’t have any "document", but this is the reason we have the C2000Ware examples. Your understanding is incorrect. Any MBX can transmit to any other MBX (or mailboxes across different nodes). For example, MBX1 on node A can transmit to MBX23 on node B.
What exactly is the difference of CAN msg object and CAN mailboxes.
No difference. They are one and the same.