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.

Toggling GPIO pin on F28069 controlCARD

My objective is simple. I want to toggle the output of a GPIO pin. I am using GPIO31 and observing the LED on the board to check for toggle. I also have a logic analyzer on the side to see if the LED was blinking too fast to observe. So far, I have not been successful.

What I have tried:

I setup the GPIO configuration (note that I only care for GPIO31 at this point)

GPAQSEL2 = 0x00000000; // (pins 16 - 31) Select input qualification type for GPIO16 to GPIO31. The input qualification of each GPIO
                       // input is controlled by two bits as shown in Figure 1-66.
                       // 00 Synchronize to SYSCLKOUT only. Valid for both peripheral and GPIO pins

GPAMUX2 = 0x00000000; (bits need to be set to 00 for input/output use)

GPADIR = 0xF0000000; // F sets the pins 28, 29, 30, 31 high which makes them outputs. (0 signifies an input)

GPAPUD = 0x3FFFFFFF; // Configure the internal pullup resistor on the selected GPIO Port A pin. Each GPIO pin
                     // corresponds to one bit in this register. GPIO31 has pullup resistor disabled

Now to toggle the pin, I have inserted both GPASET = 0x80000000 and GPACLEAR = 0x80000000 in different parts of the program as it loops through. 

The result of all this is the LED stays high the whole time. As a reminder, I used the logic analyzer to ensure the LED was not blinking too fast. 

Any tips on what I am doing wrong? Thanks

  • Hi Adam,

    Did you check the value in GPADAT register via CCS memory watch window (or in register view) to see how writes to GPASET and GPACLEAR registers are chaning it?

    Also could you post the code which does writes to GPASET and GPACLEAR register.

    Regards,

    Vivek Singh

     

  • Hi Vivek,

    I checked the register view. Here are what the relevant registers are telling me (I have continuous refresh turned on, but no values seem to change)

    GPADIR   |   Unable to read

    GPAPUD |   Unable to read

    GPAQSEL2  |  Unable to read

    GPAMUX2  |   Unable to read

    GPADAT  | 0xFFFFF000

    GPASET  | 0x00000000

    GPACLEAR  | 0x00000000

    Those register values seem to be completely off.

    static INTERRUPT void cgMain()
    {
    // Initializations...
    
    GPASET = 0x80000000;
    
    // Lots of other code not related to GPIO31
    
    GPACLEAR = 0x80000000;
    
    }

  • Hi Adam, Did you try checking these regiaster values in CCS memory watch window?
    Regards,Vivek Singh