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.

CAN communication between TM4C123G AND TM4C129 microcontrollers.

Other Parts Discussed in Thread: SN65HVD1050, SN65HVD251, TM4C123GH6PM, TM4C1294NCPDT

Hello,

I want to design an application on my TIVA TM4C123G launchpad which will transmit any CAN message to either another TM4C123 or TM4C129 launchpad.

Is there any example already available for the same?

i am using CCSv6 on my desktop.

Please help.

Thanks in advance.

  • Yes Amit,
    There are two COM ports shown by the device manager.
    And i have entered the COM ports correctly in the two puTTy terminals.
    But still the transmiter aint showing anything and the receiver is showing the messages received along with the incremented count.
  • Also Amit, the next thing that i want to do is to transmit the CAN message from the simple_tx code via WiFi to a remote PC.
    How should i go ahead?
    I have started digging for some WiFi over UART modules and have found the HLK-M30 module. and the ESP8266 module.
    How should i integrate the module with my TM4C123 board and what modifications in the code shall i make?
  • Hello Ninad

    Why jump to the next problem, when the current one is not solved?

    Regards
    Amit
  • Hello Amit,
    The transmission of the CAN message si happening, the only thing is that it is not getting displayed on the puTTy terminal at the transmitter side.
    And as far my project deadline goes, i need to start working on wireless transmission of the same transmitted CAN message via WiFi.

    Please help.
    Thanks in advance.
    Ninad.
  • Hello Ninad

    I wrote a similar code for TM4C129 based on the CAN example of DK-TM4C123. Perhaps you can use the same for the TM4C129 and make the changes to remove the grlib on TM4C123 and see if it works. I have tested it to work for TM4C123 and TM4C129

    can.7z

    Regards

    Amit

  • Thank you so much Amit.
    The CAN portion of my project seems pretty much done.
    Now comes the UART part.
    I am trying to use UART1 just to verify the code so that i can go ahead and interface an esp8266 board with it.
    the code is as follows:
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    int main(void)
    {
    SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
    GPIOPinConfigure(GPIO_PB0_U1RX);
    GPIOPinConfigure(GPIO_PB1_U1TX);
    GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 115200,
    (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
    UARTEnable(UART1_BASE);
    UARTCharPut(UART1_BASE, 'E');
    UARTCharPut(UART1_BASE, 'n');
    UARTCharPut(UART1_BASE, 't');
    UARTCharPut(UART1_BASE, 'e');
    UARTCharPut(UART1_BASE, 'r');
    UARTCharPut(UART1_BASE, ' ');
    UARTCharPut(UART1_BASE, 'T');
    UARTCharPut(UART1_BASE, 'e');
    UARTCharPut(UART1_BASE, 'x');
    UARTCharPut(UART1_BASE, 't');
    UARTCharPut(UART1_BASE, ':');
    UARTCharPut(UART1_BASE, ' ');
    }

    There is nothing that gets displayed on the serial monitor.(puTTY)
    Where as if am using UART0, the message is getting displayed.

    Please help.

    Thanks in Advance.
  • Hello Ninad,

    Is this the TM4C123 code? Did you check if there is any Bus Fault received by the CPU. If no then does the PB1 pin show activity when you provide the UARTCharPut.

    Regards
    Amit