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.

TMS320F28379D: TMS320F28379D

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hello.,

I need an code in which it displays 1 or o in oscilloscope using if statement ,if gpio pin is 44 it should display 1 in oscilloscope in wave and for pin 49 it should display 0.,the number should be dynamic depends on the user.i am using code composer studio to build the code

Example:

If(GPIO44=0){

{

GPIO=1

}

if(GPIo49=1)

{

GPIO = 0

}

  • #include "F2837xD_device.h" 
    #include "F2837xD_Examples.h" 

    void main(void)
    {
    // Initialize system
    InitSysCtrl();


    GPIO_SetupPinMux(44, GPIO_MUX_CPU1, 0);
    GPIO_SetupPinOptions(44, GPIO_INPUT, GPIO_PUSHPULL);
    GPIO_SetupPinMux(45, GPIO_MUX_CPU1, 0);
    GPIO_SetupPinOptions(45, GPIO_INPUT, GPIO_PUSHPULL);

    // Main loop
    while (1)
    {

    if (GpioDataRegs.GPADAT.bit.GPIO44 == 1)
    {

    GpioDataRegs.GPASET.bit.GPIO44 = 1;
    }
    else
    {

    GpioDataRegs.GPACLEAR.bit.GPIO44 = 1;
    }


    if (GpioDataRegs.GPADAT.bit.GPIO45 == 0)
    {

    GpioDataRegs.GPACLEAR.bit.GPIO45 = 0;
    }
    else
    {

    GpioDataRegs.GPASET.bit.GPIO45 = 1;
    }
    }
    }

    "Is this program correct? Will it output a signal of 1 for GPIO pin 44 and a signal of 0 for GPIO pin 45? I am planning to observe the output using an oscilloscope, which displays high and low signals. If there are any corrections needed, please let me know."

  • Hi Arun,

    Have you tried out this example from your side? Where you able to observe the GPIO ON/OFF?

    Please have a look at the GPIO example from the C2000Ware SDK and let me know if you have any other query.

    Thanks

    Aswin