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.

TI RTOS using ADC on Concerto c28 - howto?

Other Parts Discussed in Thread: CONTROLSUITE

Hello everybody,
I need some help by using Interrupts and ADC, for my TI RTOS-Project. I'm using the F28m35H52C1 Controller and I will modify the "DEMO_F28M35H52C1_C28xx" Project files. I followed the "SYS/BIOS and controlSUITE ADC Example" But what is the next Step, to use / activate ADC.

  • Hi C.Lorei,

    First of all, what version of TI-RTOS/CCS/XDCtools are you using?  

    Secondly, can you provide more info on what you are trying to do:  

    • Are you just trying to get the peripheral working?
    • Are you having problems with the Hwis?
    • Any error messages?

    Regards,

    -- Emmanuel

  • Hi Emmanuel,
    I use the CCS 6.0.1.00040 with the tirtos 1.21.0.09

    I did import the two projects
    1. (View - Resource Explorer - TI-RTOS - 28M35x Concerto - F28M25H52C1 - Cortex M - TMDXDOCKH52C1 - TI Target Examples - Demo Example - Demo[M3])
    2. (View - Resource Explorer - TI-RTOS - 28M35x Concerto - F28M25H52C1 - C28xx - TMDXDOCKH52C1 - TI Target Examples - Demo Example - (Demo[C28])

    and made the following changes at the Demo[C28] Project:
    - Enable the Clock Module
    - Creating a Clock Module Instance
    - Enable Clock Manager and Software Interrupt Support
    - Creating Hwi Instance
    - Configuring Semaphore Instance
    - Configuring Task Instance
    add the "empty" functions Void startAdcSeq(UArg arg0), Void readAdc(UArg arg0) and Void copyResult(UArg arg0, UArg arg1) into the demo_c28.c File and the folwing Lines into the demo_c28.cmd File Outside a Section
    Adc1Regs.ADCCTL2.bit.ADCNONOVERLAP = 1;
    Adc1Regs.ADCCTL1.bit.INTPULSEPOS = 1;
    Adc1Regs.INTSEL1N2.bit.INT1E = 1;
    Adc1Regs.INTSEL1N2.bit.INT1CONT = 0;
    Adc1Regs.INTSEL1N2.bit.INT1SEL = 0;
    Adc1Regs.ADCSOC0CTL.bit.CHSEL = 0;
    Adc1Regs.ADCSOC0CTL.bit.ACQPS = 6;

    When I build the Project, there are no errors or warnings, as far as good, so I increase an Variable at every HWI and share this with the m3 to display the Value. This works also, but now I have no clue what's the next step is to use / activate ADC.
    When I use the function code from the examples-website, there are several warnings, errors and missing c-files but i'm not sure which files are needed in my project.
  • Hi C.Lorei,

    The Void startAdcSeq(UArg arg0), Void readAdc(UArg arg0) and Void copyResult(UArg arg0, UArg arg1) functions should not be empty, these are Task functions which start the conversion, read the result and store it in a logging buffer (respectively).  At the top of the page, you can download the actual project source (link).  You should be able to copy the source over to your project build and run it (I just tested to make sure it worked).  

    Please see the task.c file, it has the tasks which will be executed on the C28 core. 

    Hope this helps,

    -- Emmanuel

  • Hi Emmanuel,

    ich try to copy the code for startAdcSeq(UArg arg0), readAdc(UArg arg0),copyResult(UArg arg0, UArg arg1) into my Project. But when I build it, i get three errors. Adc1Regs (Line 197 and 209) and at Line 207 Adc1Result is undefine.

    I append my cmd-, cfg-, and c-file, maybe I'm blind but I can not find my error

    5023.demo_F28M35H52C1_C28XX.zip

  • Hi,

    The errors you are receiving is because you do not have the all of the required source files.  The project mentioned above has additional files (copied from controlSuite [link]) which contain APIs and memory location assignments required to build successfully.

    I think you need a fresh start, can you delete all of the source file from your project and just copy over the source files from the example (task.c, task.cfg, *.c, *.asm, etc)?  You should be able to build and run it now.

    Here is a small breakdown of the files:

    • F28M35x_Adc.c, F28M35x_SysCtrl.c, F28M35x_usDelay.asm - these are device support & driver files.  These files contain APIs to communicate with the underlying hardware.  These are part of the controlSuite product (found in <controlSUITE_install_dir>\device_support\f28m35x\v205\F28M35x_common\source).
    • , F28M35x_Headers_BIOS.cmd, F28M35x_GlobalVariableDefs.c - These files define the device peripherals and their memory location.  These are also provided as part of the controlSuite product (found in <controlSUITE_install_dir>\device_support\f28m35x\v205\F28M35x_headers\cmd and <controlSUITE_install_dir>\device_support\f28m35x\v205\F28M35x_headers\source respectively) .  

    The files mentioned above are used in your application (task.c) to configure the ADC peripheral and initiate ADC conversions. 

    Let me know if this helps,

    -- Emmanuel

  • Hi Emmanuel, It does not work and I'm starting to lose my patience.
    I try to configure a few ADC, PWM and HWI at the C28-Project. It takes now more than 3 months.
    But I think I have to go back a little further and describe my plan a bit more in detail.
    My M3 project communicate via IPC with the M28 project.
    The M3 send some commands to the M28-side for processing there. The result will send back to M3-side.
    This works fine, but now I want to do some HWI, ADC and PWN stuff in my C28-Project. So I search for some code examples to get this done.
    I found that link above and try to combine my C28-Project with that example.
    After some try and error, I create a post without getting answers, so I start this Post.

    I try to copy the example files into my Project (like you said), try to build it and get a mass of errors.

    So I tried a new way, I import the example project into my workspace and what surprise, the result is a mass of errors.
    The XDCtools version 3.22.4.46 is not install (downlaod and install this file),
    next error is "Inter-processor Communication' v1.23.5.40 is not currently installed and no compatible version is available"
    and ${IPC_CG_ROOT}/packages [Unresolved]


    So I Create an new C2XX Project from the scratch and include/import the files
    F28M35x_Adc.c, F28M35x_GlobalVariableDefs.c,F28M35x_SysCtrl.c,F28M35x_usDelay.asm, edit the cfg-file), add
    "C:\TI\controlSUITE\device_support\f28m35x\v205\F28M35x_common\include" and
    "C:\TI\controlSUITE\device_support\f28m35x\v205\F28M35x_headers\include" to the include search path.
    Build the Project with the error "declaration is incompatible with "volatile struct PIE_VECT_TABLE PieVectTable".

    Maybe I'm too dumb for it, but is there no simple way to use ADC, PWM and HWI in that (Demo Example - (Demo[C28])) example project? What I also do not understand is why there are no IO operations on the C28 with RTOS are possible. So that I have to include external configuration files.

    --Christian

    [CCS6.0.1.00040, TIRTOS 2.10.1.38, RTSC/XDCtools 3.30.5.60 / 3.30.3.47 / 3.22.4.46; SYS/BIOS 6.41.2.41]

    0005.Empty_C28.zip5315.Sysbios_adc_concerto.zip

  • Hello Christian,
    I have a similar problem / project
    Do you now have succeeded or are at least a bit further?
    Holger
  • Hi Holger, I'm still on my journey of discovery but always stuck on the problem.