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.

EK-TM4C1294XL: I2C Communication and Its Library

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: DRV10975

Hi All,

I am beginner of TI environment.

I develop an embedded system with motor control subsystem using "Tiva C Series TM4C1294 Connected LaunchPad Evaluation Kit".

Now I do a programming for I2C communication between the LaunchPad board and motor dirver board. I need information about a library for motor driver (DRV10975 12-V, Three-Phase, Sensorless BLDC Motor Driver). I got I2C.c and I2C.h file from site (TI Resource Explore), and use it for the communication. When I read document of "Using Feature Set of I2C Master on TM4C129x Microcontrollers", and used function SysCtlPeripheralReady for examples then I could not find where is the library including such the function. I think I have not yet installed necessary library.

There are so many documents, and I confused which document should I read firstly.

Best Regards,

Takano

  • Takano,
    If you have not done that yet, you need to download and install TivaWare library from TI's site.
    And specifically for I2C, you need to #include i2c.h on your main header.
    You also need to add the TivaWare library to your project properties path.
    Regards
    Bruno
  • Hi Bruno,

    I have installed "SW-TM4C-2.1.4.178.exe" and set include path, however I still meet error causeing missing of include path in a code.

    for example I want to use "SysCtlPeripheralEnable" function but not in there. How to solve this?

    Best Regards,

    Takano

  • Hello Takano,

    and happy PI day everyone!

    This seems to be a recurring question here... there are several "copies" of the answer on the forum, but sometimes it gets hard to find.

    I decided I'll create some public web pages with detailed instructions to whatever I can answer, and post the link as a reply. Time won't permit too much content, certainly nor will my limited knowledge... But it will hopefully be useful for some!

    Anyway, for now I'll just paste some unformatted ugly notes that I have here, without further explanations (maybe they will confuse you more than help, maybe you already found the answer to your doubt)...

    Workspace configurations:

    Go to Window/Preferences, and type “variables” to find the proper entry, which is “Build Variables”. Add these two variables to your workspace, using the correct paths on your computer:

    TIVA_ROOT, type Path, C:\ti\my_tivaware_directory

    Project configurations:

    There are 3 places which require path related settings, to allow proper compilation:

    1. Build/ArmCompiler/Include options/”Add dir to #include” window

    1. "${CG_TOOL_ROOT}/include"

    2. "${TIVA_ROOT}"

    • Build/ArmLinker/FileSearchPath/Include_library_file…

    1. "libc.a"

    2. "${TIVA_ROOT}/driverlib/ccs/Debug/driverlib.lib"

    • Build/ArmLinker/FileSearchPath/Add<dir>_to_library…

    1. "${CG_TOOL_ROOT}/lib"

    2. "${CG_TOOL_ROOT}/include"

    The temporary link for the welcome page of the "hints collection" I mentioned above is here.

  • Hi, Thank you for your effort.

    Unfortunately, default installing does not set environment variables;
    CG_TOOL_ROOT
    TIVA_ROOT
    are at least not set upped. So, I use absolute path for these path settings.

    And your message is important for beginners to kick-start project, so I recommend to place this information to top page with highlighting.

    Best Regards,
    Takano
  • Takano said:
    message is important for beginners to kick-start project, so I recommend to place this information to top page with highlighting.

    So, so true - yet be advised - top page (ocean-front real estate) as always is "reserved" for (absolutely) vital: "Blogs, Groups, Videos."    Critical tech data is (somewhere!)    Famed, "Ready, Shoot, (then) Aim" (somehow) comes to mind...

  • Takano,

    Indeed, the default installing does not set those variables. I configure my TIVA_ROOT after a new installation of Code Composer.

    That's done via CCS Menu window/preferences, and start typing "var..." on the text filter until you find code_composer_studio/build/variables. Create the variable there once "in your life". I like doing that and avoid absolute path inside projects: if all is well set, I can easily open a project on a different computer which has a totally different directory structure, and it compiles seamlessly.

    As for the CG_TOOL_ROOT, that's an interesting point... I'm not sure where it is defined - but it is not the same as above. Might be automagically created when the compiler is installed? I'll figure out eventually and add to my document pages... Anyway, it is certainly defined, if I look into one project directory:

    The nice/clean thing about this strategy is that I don't need to drag a big list of included files showing up on the main folder of the project tree.

    Too early for all your "highlighting" proposal, but thanks for saying that! As kind of a "note to self", other recurring themes I plan to write are:

    - Options for how to program a bare TM4C silicon in a custom board

    - EEPROM considerations

    - Frequency/PWM reading and measuring

    - Bootloader strategies

    - Creating a well organized library

    - ADC circuit, triggering and conversion

    I'm by no means an expert on any of these themes, but they are things I see being asked often, and I've somehow dealt with in the recent years... Let's see if that will ever come up...

    Regards

    Bruno

  • Bruno,

    I'd like to echo thanks to you here for your efforts with your documents. They're really helping be understand the lay of the land in CCS. It's a bit byzantine for the noob...

    Lou

  • Hey Lou, thanks for your kind words! Glad to be able to help.
    Probably shared this one before, but it is still within the subject, and doesn't hurt to repeat:
    Happened a long time ago, for keeping my usual settings in an external text document. The document software decided it was a beautiful thing to automatically replace regular quotes for those curly "forward quotes" and "closing quotes", or whatever name such thing has (they look nice when quoting a wise text on a book...)
    Then, one day on a new project, I copied the settings and pasted into CCS.
    Well, guess how much time it to us to figure out why we could not compile / find a library that was "perfectly" configured and included??????? Can one really spot the visual difference between " and “ in a debug environment?
    Bruno