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.

CCS: Twiddle LEDs

Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

I am trying to download a ready-made demo program from "C2000Ware_2_00_00_02\device_support\f28004x\examples\launchxl\launchxl_ex1_f280049c_demo.c", there is no reaction (leds do not blink)

And wrote a separate program for leds only, also no reaction:

#include "F28x_Project.h"

void InitAll();
void InitGPIO();

void main()
{

InitAll();//with internal ocsl
//InitSysCtrl();
InitPieCtrl();
InitPieVectTable();
InitGPIO();

while(1){
GpioDataRegs.GPADAT.bit.GPIO23 = 1;
DELAY_US(1000000);

GpioDataRegs.GPADAT.bit.GPIO23 = 0;
DELAY_US(1000000);
}
}


void InitAll(){
//
// Disable the watchdog
//
DisableDog();

#ifdef _FLASH
//
// Copy time critical code and Flash setup code to RAM
// This includes the following functions: InitFlash();
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
// symbols are created by the linker. Refer to the device .cmd file.
//
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
#endif

//
// PLLSYSCLK = (XTAL_OSC) * (IMULT + FMULT) / (PLLSYSCLKDIV)
//
//InitSysPll(XTAL_OSC,IMULT_10,FMULT_0,PLLCLK_BY_2);
SysIntOsc1Sel();

//
// Call Flash Initialization to setup flash waitstates
// This function must reside in RAM
//
InitFlash();

//
// Turn on all peripherals
//
InitPeripheralClocks();
}

void InitGPIO(){
EALLOW;

GpioCtrlRegs.GPAMUX2.bit.GPIO23 = 0;
GpioCtrlRegs.GPAAMSEL.bit.GPIO23 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO23 = 1;

EDIS;


}

  • Your code looks fine--the only thing I noticed is that since your SYSCLK is running off of INTOSC1 with no multiplier, the DELAY_US() macro isn't going to give you an accurate number of microseconds unless you updates the CPU_RATE value in f28004x_examples.h. Right now your LED toggle is probably happening every 20 seconds.

    Whitney