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.

How to program GPIO of TMS320F28069 using TI-RTOS?

Other Parts Discussed in Thread: TMS320F28069, CONTROLSUITE, TMS320F2806

Hi All

I have been trying to get used to with the development of TI, but to my surprise, it's getting more and more complicated day by day. Currently I am facing a situation in which I am not even able to program GPIO of TMS320F28069 using the TI-RTOS. I was able to get an output on hardware yesterday by simple programming without TI-RTOS.

Can somebody please please please give me some kinds of demo projects for modules of TMS320F28069 like ADC, GPIO, PWM, SPI, UART and USB.

It seems quite strange not getting any kind of proper documentation from TI. It took me two entire days to just install CCS, ControlSUITE, TI-RTOS and SYS/BIOS as there wasn't a single guideline on how to install them and how to use them. If one gets any company's microcontroller nowadays, then he/she gets atleast the demo projects related to its modules so that he/she can atleast get to know the programming flow. TI does not provide it at all especially for TMS320F28069. So it seems to me that I have to waste so much of a time in learning the CCS only. There is no provision to find a keyword in entire project. One can only find a keyword in current file. That's really strange and frustrating in this era. CCS seems like a sea of confusions without soultions.

Anyways, I know TI is very good in hardware and it is very bad in software, so I can bear this problems. Please find attached herewith my project of GPIO that gives errors. I want to get to a forever loop that toggles the output pin every 50 uS. Anybody please tell me the uS delay function that I can use as I am really getting mad for not even able to find that.

Thanks In Advance.

ShaunakTMS320F2806_GPIO.zip

  • Hi Shaunak,

    Have you explored the controlSUITE examples for the F28069 yet? They're found under controlSUITE/device_support/f2806x/. If you aren't sure how to import them into CCS, there's a guide under docs/f2806x-FRM-EX-UG.pdf.

    We do have a macro DELAY_US that you can use to add a delay. "external_interrupt" and "epwm_dcevent_trip_comp" are two examples that use it, so you might want to try checking those out.

    If you haven't already, I would recommend checking out some of our workshops. There's one specifically for the F28069:
    processors.wiki.ti.com/.../C2000_Archived_Workshops

    For TI-RTOS:
    processors.wiki.ti.com/.../Introduction_to_the_TI-RTOS_Kernel_Workshop

    For CCS:
    processors.wiki.ti.com/.../Category:CCS_Training

    Whitney
  • Hi Whitney

    Thanks for replying.

    Now let me get to the point, because what I found pathetic about TI Support is that you people never put demo projects on forum. The more pathetic part is that the TI Documentation is just a waste. You guys just direct people to some wiki links that explain nothing and confuse us more.

    Anyways, let me get to the point. Please find attached herewith my project that is supposed to be built using:

    1. Code Composer Studio Version: 6.1.0.00104

    2. XDCTools Version: 3.31.0.24

    3. TI-RTOS Version: 2.12.1.33

    I am getting error when I build this project. (Please find attached herewith the error snapshot of the CCS IDE.)

    This is a very simple project in which I want to fire an interrupt after every 50 microseconds of time and I want to toggle the GPIO58 pin on every interrupt.

    Whitney, I kindly request you to go through this project and give me the solution. I once again kindly request you to give me the successfully buildable project because that's how embedded developers help each other by giving each other basic modules of codes and projects.

    Many many thanks in advance, Whitney.

    ShaunakGPIO_TIM_INT.zip

  • Hello,

    If you have specific feedback about what documentation or wiki pages are lacking, please let me know and I'll direct it to the documentation owners.

    I have several observations about your attached code.

    1. That error you are getting about codestart not fitting into memory is caused by the "boot from flash" setting in TI-RTOS. Turning on the TI-RTOS "boot from flash" will generate a linker command file that tries to put its own version of codestart into the section BEGIN. To get rid of this conflict, you can remove the codestart line in the TMS320F28069.cmd file and let the TI-RTOS-generated file fill it. After doing this, I was able to build the project successfully.

    2. TI-RTOS will do a lot of the device initialization. Because of this, you may not need to use several of the controlSUITE device initialization functions. For example, the Boot module will take care of disabling the watchdog and setting up the PLLs, so calling InitSysCtrl() is not needed and possibly conflicting. Similarly, the RTOS will plug its own Hwi dispatcher into the vector table, meaning calling controlSUITE's InitPieVectTable() function will overwrite the vector table and cause issues with the RTOS. I've commented out many of these functions. A call to InitPeripheralClocks() is still needed however to turn on ePWM3 (and other peripherals).

    3. CTRMODE wasn't being turned on anywhere, so I uncommented the line "EPwm3Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;" After I did that, I was able to get ePWM interrupts and see GPIO58 toggling on my oscilloscope. I did not check the frequency, but you should be able to adjust your PWM settings to get the desired one easily enough.

    There was one more additional change I made. Some of the Logging configuration in the .cfg file was causing the program to end up in the reset vector. I have commented it out for now. If you have trouble getting logging to work, I can ask someone who knows the Logging module better than I do to take a look.

    I have attached the three files I modified below.

    Whitney

    TMS320F28069_GPIO_TEST_changed_files.zip