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/LAUNCHXL-F28027: program not running on launch xl- f28027

Part Number: LAUNCHXL-F28027
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hello team,

I have developed a program on f28027 with reference from launch xl- f28069.

The program is sucessfully build and loaded in flash of f28027. 

The problem is I cant control the motor. The input outputs assigned are good to observe.

What could be possibly wrong?

Please guide me.

  • Hi Jesal,

    Can you provide more details about your issue. Also did you try running other examples on board ? Refer examples in C2000Ware for your device.

    Thanks
    Vasudha
  •  Hello Vasudha,

    Yes, I tried running lab projects from C2000ware and I could run it good.

    I could run the program that i developed, all analog inputs are ok.

    But i have taken hall sensor inputs which i am unable to get it on the variable.

    I could see it in the register data bits GPA it reflect the change in hall input.

    this is the patch wherein i could not get the data.

     gHall_GpioData = (~HAL_readGpio(halHandle, (GPIO_Number_e) GPIO_Number_18)
                & 0x1) << 2;   //CAP1->J10/J4_1->green
        gHall_GpioData += (~HAL_readGpio(halHandle, (GPIO_Number_e) GPIO_Number_7)
                & 0x1) << 1;   //CAP2->J10/J4_2->green&white
        gHall_GpioData += (~HAL_readGpio(halHandle, (GPIO_Number_e) GPIO_Number_6)
                & 0x1);        //CAP3->J10/J4_3->gray&white
    
        gHall_State = gHall_GpioData;


  • So the values in gHall_GpioData and gHall_state don't reflect what is actually in the registers? Are you able to step through the calls to the HAL_readGpio() function and see if it is returning the expected values?

    Whitney
  • Since GPADAT is showing the correct values, but gHall_State is not, your conversion becomes suspect.

    You are performing a bitwise NOT on the returned boolean, then a bitwise AND with 0x1. I have not tested your code, but I think that's what is causing your problems. You can try my code:

    uint16_t binaryHall = 0;
    binaryHall |= GPIO_read(obj->gpioHandle, HAL_GPIO_HALL_A) ? 0 : 1;
    binaryHall |= GPIO_read(obj->gpioHandle, HAL_GPIO_HALL_B) ? 0 : 2;
    binaryHall |= GPIO_read(obj->gpioHandle, HAL_GPIO_HALL_C) ? 0 : 4;
    

  • I tried moving the patch from the function defined to the main () which now reflects to the global variable gHall_GpioData.
    But I am still not sure why did it not work in the function I called.
  • Is your global variable defined as volatile?

  • Are you still looking for an answer for this? What optimization level were you using? As Rob asked, was your global variable volatile?

    Whitney