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.

TCAN4550EVM: How to read/write to/from the TCAN4550 using an Arduino UNO

Part Number: TCAN4550EVM
Other Parts Discussed in Thread: TCAN4550

Hello,

I am currently working on a development project where I want to send values to the TCAN4550 EVM from the Arduino UNO so that the values are transmitted/sent to the CAN Bus and after that I want to receive these same values from the TCAN4550 EVM in the form of the CAN Bus in order to read it from the Arduino Serial Monitor in the computer. Is there a demo/starter code that could be sent to me or a library in arduino that uses the TCAN4550.

Thanks,

Kareem

  • Hi Kareem,

    The TCAN4550 boosterpack has some demo software available on its store page. This is primarily written for use with an MSP430 microcontroller, but it can be adapted to work in any C environment. 

    Regards, 
    Eric Schott 

  • Hey Eric,

    I looked into the Demo Software and the software guide. What I understood is that for the TCAN4550 function to work with the arduino Uno I would need to edit the TCAN4x5x_SPI.h and .c file. I recognized that the MSP430 used a port and a pin and sets it to SPI but on the Arduino Uno, pin 10 is the SPI CS pin. There are no different ports in the arduino as its very simple and doesnt have a ton of GPIO (Just the digital and analog). I tried implementing the CS pin number on the arduino into the TCAN4x5x_SPI.h software but I am confused how I can make it work and what I should change. 

    On the picture, I feel like I should change the SPI_CS-GPIO_PORT and PIN as well as the SPI_HW_ADDR, but there is no port number on the arduino Uno and I do not know what the SPI_HW_ADDR is and what role it plays. I checked a lot of the function mentioned in the  TCAN4x5x_SPI.h, a lot of them use the SPI_HW_ADDR as a parameter as well as the port and pin Defined variables. You can see I already changed the SPI_CS_GPIO_PIN to equal 10 becuase I know the arduino UNO CS pin is 10 but I also do not know if that would work. (Just simply defining the pin here as 10). Could you help guide me in the right direction and offer some support in making the code compatible with the Arduino UNO.

    Essentially my end result is , The arduino UNO is connected to a sensor, it gets the value from the sensor, I send that value to the TCAN4550 in order for it to be converted to the CAN BUS I then recieved that converted CAN BUS signal back into the arduino in order to view it in the serial monitor to check if the sensor value did in fact get converted into the CAN BUS. I am just having difficulty interfacing the arduino UNO with the TCAN4550 and writing code for it as I have little to no experience in CAN.

    Thank you for the help,

    Kareem

  • Hi Kareem,

    You should be able to replace the whole AHB_WRITE_32 and AHB_READ_32 functions in the TCAN4x5x_SPI.c with 32 bit write/read examples from the arduino standard library. The CS (or SS as its referred to in some other documentation) can simply be any available GPIO to set low during each SPI transaction. I'd recommend looking at the examples on the arduino website like the one here

    Unfortunately I am not able to provide direct software support as my expertise is in our transceiver devices themselves. For adapting the arduino code, forums related to this MCU specifically will likely be a better resource. If you have any questions about the TCAN4550 itself and how to configure it, please let us know here and we'll be happy to help!

    Regards,
    Eric Schott