Note: This tutorial assumes that you have completed the previous tutorials: Tivaware and toolchain setup.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Hello world publisher on TM4C1294XL.

Description: Chatter publisher for the EK-TM4C1294XL board using UART over debug USB port.

Tutorial Level: INTERMEDIATE

Next Tutorial: Buttons publisher

Introduction

This tutorial is simply an extension of the previous Hello world publisher on TM4C123GXL for the EK-TM4C1294XL board.

You can repeat the process over the previously created project. Or refer to the reference project on rosserial_tivac_tutorials/chatter129.

Source code

   1 (...)
   2   // TivaC system clock configuration. Set to 80MHz.
   3   MAP_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
   4 (...)

On chatter/chatter.cpp change these lines to:

   1 (...)
   2   // Run from the PLL at 120 MHz.
   3   MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN |
   4                           SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), TM4C129FREQ);
   5 (...)

This change is required due to the different mechanisms which both MCUs use to control the system clock.

CMakeLists.txt

Now let's change the application's CMakeLists.txt file.

Due to the difference on how the clock frequency is set up for the TM4C129XL target, we need to add the frequency definition.

add_definitions(-DTM4C129FREQ=120000000)

And then change the target configuration by setting the board type.

generate_tivac_firmware(
  SRCS chatter.cpp
  BOARD tm4c1294xl
)

Build, flash and test

Now we can build our application when we run catkin and then upload.

catkin_make rosserial_tivac_tutorials_chatter_chatter.axf
catkin_make rosserial_tivac_tutorials_chatter_flash

Let's listen to our newly created topic from TivaC.

Run roscore.

roscore

On a new terminal, run serial_node.py from rosserial_python.

rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0

And watch the messages from the topic.

rostopic echo /chatter

Wiki: rosserial_tivac/Tutorials/Hello World129 (last edited 2015-11-14 21:41:39 by RoboSavvy)