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.

TMS320F28388D: How to convert Sysconfig-based code to driverlib code?

Part Number: TMS320F28388D
Other Parts Discussed in Thread: SYSCONFIG

I have some sysconfig-based code that works (for example, led_ex1_blinky) and wish to convert it to a non sysconfig-based project (for example, adc_ex1_epwm_input_cpu2) and am wondering how to proceed?

That is, for setup I think I have, in the sysconfig project:

GPIO_setPadConfig(STATUS1, GPIO_PIN_TYPE_STD);
GPIO_setQualificationMode(STATUS1, GPIO_QUAL_SYNC);
GPIO_setDirectionMode(STATUS1, GPIO_DIR_MODE_OUT);
GPIO_setControllerCore(STATUS1, GPIO_CORE_CPU2);

and for operation I have:

GPIO_writePin(STATUS1, 0);

if (GPIO_readPin(CONTROL1)) ...

what are the equivalents if I'm not using sysconfig?  I think it's:

#define STATUS1 30 // GPIO30 (amber LED)

GPIO_SetupPinOptions(STATUS1, true , GPIO_SYNC); // STATUS1 is an output, not input, and syncs with PLLsysclk with standard push-pull
GPIO_SetupPinMux(STATUS1, GPIO_MUX_CPU2, 0); // STATUS1 is on CPU2, mux position 0 (a GPIO)

and

GPIO_WritePin(STATUS1, 1);

if (GPIO_ReadPin(CONTROL1)) ...

but this doesn't seem to work.  What did I miss?

  • Hi, 

    The Sysconfig generated code is based on driverlib APIs , so you can add the same code in your project. 

    You can look at the generated Board_init function and add the same to the project.

    Any particular reason on why you don't want to use sysconfig based project

    Best Regards

    Siddharth

  • The reluctance to use sysconfig arises when I get a driverlib-only TI project such as the example I cited, and I'm not prepared to deal with side effects from adding in sysconfig, in part due to my relative newness to the platform.

    It turns out the exact technique above (GPIO_SetupPinOptions/SetupPinMux) works fine on CPU1 only with adc_ex2_soc_epwm, for example. It looks like I may have needed to do the setup before something else

  • Eric , 

    I didn't understand on what you meant by "needed to do the setup before somethin else" .  

    Do you mean you are able to run only on CPU1 by adding the sysconfig generated code to the project?

    Pls clarify

    Best Regards

    Siddharth