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.

Problem with 60MHz TMS320F28027: cycle time more than 16.67 ns

Other Parts Discussed in Thread: TMS320F28027

Hello,

I use C2000 Piccolo LaunchPad with TMS320F28027 MCU on it. I just want to toggle one pin and the following is my code.

void main(void){
    while(1){
        uiYLED++;
        if(uiYLED==1){
            GpioDataRegs.GPADAT.bit.GPIO0=1;
            GpioDataRegs.GPADAT.bit.GPIO0=0;
            GpioDataRegs.GPADAT.all=0xffff;
            GpioDataRegs.GPADAT.all=0x0000;
            uiYLED=0;

}

}

}

The following is my initialization function.

void Initialize(void){
    // Initialize all the handles needed for this application
    myClk=CLK_init((void *)CLK_BASE_ADDR, sizeof(CLK_Obj));
    myCpu=CPU_init((void *)NULL, sizeof(CPU_Obj));
    myFlash=FLASH_init((void *)FLASH_BASE_ADDR, sizeof(FLASH_Obj));
    myGpio=GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj));
    myPie=PIE_init((void *)PIE_BASE_ADDR, sizeof(PIE_Obj));
    myPll=PLL_init((void *)PLL_BASE_ADDR, sizeof(PLL_Obj));
    myPwm1=PWM_init((void *)PWM_ePWM1_BASE_ADDR, sizeof(PWM_Obj));
    myPwm2=PWM_init((void *)PWM_ePWM2_BASE_ADDR, sizeof(PWM_Obj));
    myPwm3=PWM_init((void *)PWM_ePWM3_BASE_ADDR, sizeof(PWM_Obj));
    myAdc=ADC_init((void *)ADC_BASE_ADDR, sizeof(ADC_Obj));
    myWDog=WDOG_init((void *)WDOG_BASE_ADDR, sizeof(WDOG_Obj));
    mySpi=SPI_init((void *)SPIA_BASE_ADDR, sizeof(SPI_Obj));
    myCap=CAP_init((void *)CAPA_BASE_ADDR, sizeof(CAP_Obj));
    myPwr=PWR_init((void *)PWR_BASE_ADDR, sizeof(PWR_Obj));
    myTimer0=TIMER_init((void *)TIMER0_BASE_ADDR, sizeof(TIMER_Obj));

    // Perform basic system initialization
    WDOG_disable(myWDog);
    CLK_enableAdcClock(myClk);
    (*Device_cal)();
   

    // Select the internal oscillator 1 as the clock source
    CLK_setOscSrc(myClk, CLK_OscSrc_Internal);
   

    // Setup the PLL for x12 / 2 which will yield 120Mhz = 10Mhz * 12 / 2 (CPUCLK=60MHz)
    PLL_setup(myPll, PLL_Multiplier_12, PLL_DivideSelect_ClkIn_by_2);
    CLK_setLowSpdPreScaler(myClk, CLK_LowSpdPreScaler_SysClkOut_by_1);
    CLK_setClkOutPreScaler(myClk, CLK_ClkOutPreScaler_SysClkOut_by_1);
   

    // Disable the PIE and all interrupts
    PIE_disable(myPie);
    PIE_disableAllInts(myPie);
    CPU_disableGlobalInts(myCpu);
    CPU_clearIntFlags(myCpu);
   

    // If running from flash copy RAM only functions to RAM
    #ifdef _FLASH
        memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
    #endif
    

    // Enable XCLOCKOUT to allow monitoring of oscillator 1
    GPIO_setMode(myGpio, GPIO_Number_18, GPIO_18_Mode_XCLKOUT);
    CLK_setClkOutPreScaler(myClk, CLK_ClkOutPreScaler_SysClkOut_by_1);
    

    // Setup a debug vector table and enable the PIE
    PIE_setDebugIntVectorTable(myPie);
    PIE_enable(myPie);
}

 

On the scope when I see GPIO0 it is 1 for about 480ns and goes to zero in 30ns and the 1 for about 480ns. It keeps continue doing that because it is in a while loop.

My question is how can I get faster toggling? Is there any PLL or clock initialization that I missed?

I appreciate any help.

Ali