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/TMS320F28035: GPIO read and GPIO output

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi,

I want to read a GPIO input (GPIO14) in order to see the button status and write in GPIO out (GPIO15) the same status, I have the initial configuration:

void Gpio_select(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 0;
GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO14 = 0; //input
GpioCtrlRegs.GPADIR.bit.GPIO15 = 1; //output
EDIS;
}

My questions are: (1) What I need for read the status value for input GPIO as a interruption? in the main loop if I only have:

void main(void)
{
InitSysCtrl();
Gpio_select();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();

}

 

  • Hi Alexandro,

    You will want to look into the XINT feature of the device. This is an "external interrupt" which you can trigger on the input change. I would also recommend to download c2000ware and start from one of the simple examples there, such as the led blinking one.

    You can read more about XINT here (pg 103): www.ti.com/.../sprugl8c.pdf

    An example of reading the state of a GPIO is

    gpio_state = GpioDataRegs.GPADAT.bit.GPIO0


    Regards,
    Kris