• TI thinks resolved

CCS/TMS320F28335: Getting started with the C2000 in 2018

Part Number: TMS320F28335

Tool/software: Code Composer Studio

I apologize for the very broad question, but I'm totally lost; I've been struggling here for a few days now and I need help.

I've got a TMS320F28335 and the Experimenter Kit. I somehow managed to get an LED blinking on this after jumping through a series of (seemingly out-dated tutorials). My goal is to get TI-RTOS running on this and to start working with PWM and serial communications. However, like I said (coming from the Atmel/Arduino world) the documentation seems to be very scattered and out of date depending on where I look and I cannot seem to get a straight, simple answer. I'm still not entirely sure if I'm missing things; almost every attempt to import example code (other than the LED Blink) results in numerous compilation errors. I got started with the F2833x Firmware Development Package User's Guide (I reported an error in it, I presume it was taken down because I can no longer find the most current version, or any version, on the TI website). Some of the documents make reference to ControlSuite while others make reference to C2000Ware. Following along with these tutorials is very difficult because everything is different. TI-RTOS seems like a whole other beast (which again, is a separate download). I'm just not sure how to get started here for real, there's way too much information and no clear direction on how to just pick this thing up and go.

  • Hello, Frank
    I can't help you on TI-RTOS, but maybe you'll find some info useful.
    ControlSUITE and C2000ware are related products for C28-core based MCU. But controlSUITE is something like old name for C2000ware. I think it's better to download C2000ware:
    www.ti.com/.../C2000WARE

    All MCU stuff is in folder "device_support".

    So C2000ware is a pack with: peripheral headers, peripheral drivers, linker files and examples for all C28 MCUs. Including F28335.
    How to start: install C2000ware, open CCS (v7.4.0 is the last one). Then go "Project - Imort CCS projects...". Browse to "C:\ti\c2000\C2000Ware_1_00_03_00\device_support\f2833x\examples\cpu_timer" and press "Import". This is an example with... well CPU timers.
    Could you please try it?

    I found workshops useful enough, though they are for F28379D, but give it a try:
    processors.wiki.ti.com/.../C2000_Multi-Day_Workshop

    Regards, Disona.

  • In reply to Disona:

    Ok, thanks, that worked. But now suppose I want to make my own project, not an example project. How would I go about doing that? There are so many files that are linked to the project and it's not exactly clear which ones I need to add to do a particular task. I mean, the file names are self-explanatory, but the layers upon layers of directories make it impossible to find what I'm looking for without some sort of document to map out what belongs in each file and where it's located.
  • In reply to Frank Pernice90:

    Hi Frank,

    Welcome to C2000!

    Disona has given some very good tips. 

    In addition and especially for someone new to our device family, I'd like to recommend that you take a look at the F28335 Multi-Day workshop.  It was last updated in 2010 (we primarily focus on keeping 1-2 workshops up to date), but the content, labs and instructions should match up well - even to newer versions of CCS. 
    http://processors.wiki.ti.com/index.php/C2000_Archived_Workshops#C2000_Delfino_Multi-Day_Workshop_-_Revision_8.1_November_2010_.28ExpKit_F28335.3B_CCSv4.2.3B_DSP.2FBIOS_5.41.29

    Note that the first labs go through the process of building a new project. 

    I will comment that many people start with an example project and then adapt it to meet their needs.  Depends on preference and how much confidence one has with the example structure that C2000 built.

    For documentation, you'll find most information in the datasheet and the peripheral user guides.


    Thank you,
    Brett

  • In reply to Frank Pernice90:

    Well, maybe it will seem a little bit difficult. I once tried to work with arduino (after TI MCUs) and I was astonished by number of libraries for every caprice - i2c, spi, oled/led displays - every feature had a tested library. I just called a function - and it worked! But C28 MCus are not that easy.

    I don't know your skills in bare-metal programming, so my explanations might seem unnecessary, but anyway, i try give it step-by-step:

    First, create a project for your MCU (F28335) with "Projects - New CCS Project". Set project path and MCU type. Select "Empry project" in examples.

    When you set up a new project you have to describe MCU memory. This is done by linker script. It describes memory of your MCU and puts program sections into that memory: code, variables etc. Linker scripts have "*.cmd" extension. You can take a linker script from controlsuite ("C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_common\cmd"): "28335_RAM_lnk.cmd" if you want your project to reside in RAM memory (for debug) or "F28335.cmd" for flash.

    Any MCU is driven by its peripherals. Peripherals are controled with its registers. Peripheral regiesters reside in MCU memory (just like your program and data). TI gives you headers with peripheral description. You have to link that desritption to MCU memory, so you have to add one more linker script (C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_headers\cmd) called "DSP2833x_Headers_nonBIOS.cmd". Of course, this is not for RTOS - there is "nonBIOS" in its name. Because i don't know bios stuff =)

    So now you have full MCU memory description. It's time to define stuff that will reside in that memory. At first - structures for peripherals. For example - you have SPI module. It has some setttings - baudrate, package length, chip-select behavior etc. You set that settings with some registers. Those registers are combined into structers - you can access them in your program like "SpiRegs.Baudrate = 57600;". And those structures are defined in peripheral headers according to documetation. So you can (have to) add the headers into your project. The headers reside in "C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_headers\include" folder. You have to go to project properties (right click on your project), "CCS Build" - "C2000 Compiler"- "Include Optios". Then click "Add..." at "Add dir to path...", and browse to "C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_headers\include". Now you have path to headers in your ptoject.

    Ok, you have definitions for peripheral structures, but what about declaration? Well, declaration is in "DSP2833x_GlobalVariableDefs.c" file - "C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_headers\source". Copy this one to your project.

    Next, if you want (and you definitely want) your MCU to work properly, you have to set up MCU clock, enable peripherals and some other stuff. There are functions for this jobs, and you have to add source files with this functions to your project. The most important function is called "InitSysCtrl()". It is defined in one of source files. You have to browse to "C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_common\" folder and copy "source" folder to your project. Now you have a variety of peripheral-functions in your project. It was too easy... NO! It was not easy! For some reason there are 3 files that declare same interrupts. Delete
    "DSP2833x_SWPrioritizedDefaultIsr.c" and "DSP2833x_SWPrioritizedPieVect.c". Don't ask me why.

    You now have system functions. But that functions are tricky - they want to use some special variables and types (Uint16 for example). You can examine build errors and fix them OR you can just add some headers with types and funtion defines. The headres are located in "C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_common\include". Again you have to enter project properties and add this path to "Include options".

    Now - the only missing is "main" function. Create "main.c" file. Declare "void main (void)" in that file. Inside "void main()" call "InitSysCtrl()" function to set up the MCU. But don't forget to include headers for "InitSysCtrl()". For that you have to include FIRST "DSP2833x_Device.h" (it has typdefs and peripheral headers inclusion) and then "DSP2833x_Examples.h" - that one has "InitSysCtrl()" prototype.

    I now have F28335 empty project built. Do you have it? It's time to blink leds and spin a motor with FOC, i guess...

    It was easy =)

    Here's a "*.zip" file with an example, but you have to edit include paths. I hope this helps.

    F28335_proj.zip

    Regards, Disona.

  • Frank,

    Sorry about my delayed reply, but I was out on business travel this past week. In the past, I have had conversations with your company's engineering management about working with our devices.  As Brett has already pointed out, the F28335 workshop might be your best starting point.  I am the author of the workshops, and please do not get frustrated with the C2000.  Once the process is understood, things will get much easier.  The first minor issue that you will run into with the F28335 workshop is it was released back in November 2010 and developed with CCSv4, therefore some of the CCS related lab directions will differ slightly when using a newer version of CCS.  All of my workshops for the past +20 years have followed the same basic flow, which allows users to easily move between versions of CCS and also helps in understanding how to migrate between device families.  I just released a new F28379D (multi-day) workshop which uses the latest CCSv7.  The reason I am pointing this out to you, is so that you can refer to this workshop for updated lab directions that are specific to CCSv7 (that is, in case you are planning to use CCSv7).  All workshops are completely self-contained and do not require the installation of controlSUITE/C2000Ware.  All of the necessary support files (i.e. header files) are included with the installation (which makes it very portable).  However, please also note that the F28335 workshop includes a module on DSP/BIOS rather than TI-RTOS (SYS/BIOS).

    I understand you main question is - "where to start?" I strongly suggest downloading, installing, and running the F28335 workshop.  If you will be using CCSv7 rather than CCSv4, then also download the F28379D workshop manual to help assist with the CCS lab direction changes.  If you are still having difficulty, then please contact your local TI representative and we can try to have a conference call.  All of the workshop resources can be found at:

    http://processors.wiki.ti.com/index.php/C2000_32-bit_Real-Time_MCU_Training

    (Also, note that the F28379D one-day workshop has been recorded, but specifically module 3 video covers the basics of CCSv7. If you plan to use CCSv7 then this might be useful to you).

    Please let me know if this helps, or if you have any further questions. If this resolves your issue, please click the green "Verified Answer" button to close this thread.  Thank you.

    - Ken

  • In reply to Ken Schachter:

    www.mindshareadvantage.com/.../ is a good place to go to learn more about TI RTOS.

    Regards,

    Todd Anderson