Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hello,
I want to turn on switch through GPIO , I used delay function to do this job, at the same time i also turn on CPU TIMER2 for 20us and change from mode=0 to mode=1. my question is how to open timer2 and set timer2 for 20us, after delay
InitCpuTimers();
ConfigCpuTimer(&CpuTimer2, 200, 1000000);
CpuTimer2Regs.TCR.all = 0x4000; // Use write-only instruction to set TSS bit = 0
EALLOW;
GpioCtrlRegs.GPCPUD.bit.GPIO68 = 0;
GpioCtrlRegs.GPCMUX1.bit.GPIO68 = 0; // GPIO11 = GPIO27
GpioCtrlRegs.GPCDIR.bit.GPIO68 = 1; // GPIO11 = output
GpioDataRegs.GPCCLEAR.bit.GPIO68 = 1;
mode = 0;
DELAY_US(433333);
GpioDataRegs.GPCSET.bit.GPIO68 = 1;
//Open timer2 ???
// Set a timer 20u??
//change mode
mode = 1;