SYSCONFIG: switching between configurations

Part Number: SYSCONFIG

Tool/software:

I know that I can do this manually, but was wondering if there was a more abstract way.

I have a couple different modes I'd like to run, lets say in one mode, i slowely sample all of the ADC inputs, and in other mode i make the ADC max speed, and use the fifo, and only focus on 1 input.

conceptually i could have 2 different sysconfig files for the 2 modes.  then call the setup for either when i switch modes.  is there a way this could be supported?

worst case i could make one sysconfig, then compile with it so it generates SYSCFG_DL_ADC12_0_init() in ti_msp_dl_config.c, then copy the contents into my own file and call it SYSCFG_DL_ADC12_0_init_fastmode() or something, and then make sure that all the defines needed are defined and non conflicting...

just curious if there was an easier way.


  • Hi, 
    Could you try to use two different build configurations in CCS? i.e. by default CCS has Debug and Release build configurations, but you could add couple additional ones for regular and max ADC modes. You can then have majority of your files that are common, but you can exclude/include certain files. 

    I think the main issue is that it wouldn't avoid having two different syscfg files (you can exclude regular.syscfg from fast build configuration and viceversa). however, you would still need to manage two files syscfg files and resolve deltas that need to stay common. 

    Having a common/build specific .syscfg files is not something that we support today. We do have a ticket in our tracking system that captures this enhancement. 

    It is also possible that I misunderstood your question. I'll ask someone else to look this over and add their comments if they have a better suggestion. 

    Martin

  • If your goal is to have two different compilation modes, then I think Martin's suggestion is likely the best.  However, it sounds like your goal is to have two modes of operation within the same application, and you'd switch at runtime which mode you would be using.

    If the latter is indeed the case, you can add two ADC instances, but set them to the same peripheral and pin.  You'll get a conflict error, but you can select "ignore" to change it into a warning (which you can further suppress if you like).  This will generate code for two ADC instances using the same pin/peripheral.  You would just have to make sure to only initialize one of the two ADCs at a time.

    Darian

  • this sounds like what i'm looking for.  if i'm understanding what you are saying...but ideally i'll be using both ADC in one configuration, and then change how one of them works.
    currently i have ADC12_0 and ADC12_1, i make an additional ADC12_1_configB and ADC12_1_configC for example where the 2 new ones assign themselves to the same ADC1 resource.

    I'm not sure how to do this.  i can't add an extra

    or here:

    is there a way to disable the 2/2 limit?

  • Yes, but right now this can only be done by modifying the SysConfig SDK content:

    • Open source\ti\driverlib\.meta\adc12\ADC12MSPM0.syscfg.js in a text editor
    • Search for "maxInstances"
    • Comment that line out. 

    After you do that, SysConfig will no longer restrict how many instances you can add.

    I will follow up with the necessary people to ensure there's a way to do this without having to modify that code, but this should at least get you going