Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hi,
I am using hardware loop on the dock for GPIO 12 as Digital Input and GPIO 14 as Digital Output and later on using two loops for with condition. Function is not working. Please help me to know my error in the code..
######################################################################################## Code:
#include "F28x_Project.h"
#define BLINKY_LED_GPIO 12
void main(void)
{
InitSysCtrl();
InitGpio();
GPIO_SetupPinMux(BLINKY_LED_GPIO, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(BLINKY_LED_GPIO, GPIO_INPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(31, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(31, GPIO_OUTPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(34, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(34, GPIO_OUTPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(14, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(14, GPIO_OUTPUT, GPIO_PUSHPULL);
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EINT;
ERTM;
GPIO_WritePin(14,0);
if (BLINKY_LED_GPIO==1)
{
for(;;)
{
GPIO_WritePin(34, 0);
DELAY_US(1000*500);
GPIO_WritePin(34, 1);
DELAY_US(1000*500);
}
}
else
{
for(;;)
{
GPIO_WritePin(31, 0);
DELAY_US(1000*500);
GPIO_WritePin(31, 1);
DELAY_US(1000*500);
}
}
}
//
// End of file
//
The output of the program gives always blinking of LED 31 on control card.
### Does it require an additional line to read DI..?
Thanks and Regards,
Rahul Sharma