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/TMS320F28069: TMS320F28069

Part Number: TMS320F28069

Tool/software: Code Composer Studio

Hello,

I want to know how to read the value on a gpio pin. I tried to assign a variable to read the gpio pin but I'm not getting any o/p.

here's my code :

#include "DSP28x_Project.h"


int a;
void main(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO14 = 1;
EDIS;

a=GpioDataRegs.GPADAT.bit.GPIO14;
}

please help me with it.

  • Hi Kapil,

    That should work. Have you tried toggling to the GPIO with GpioDataRegs.GPATOGGLE.bit.GPIO14 and reading the value inbetween?

    a=GpioDataRegs.GPADAT.bit.GPIO14;
    GpioDataRegs.GPATOGGLE.bit.GPIO14 = 1;
    asm(" NOP");
    asm(" NOP");
    asm(" NOP");
    asm(" NOP");
    asm(" NOP");
    a=GpioDataRegs.GPADAT.bit.GPIO14;
    GpioDataRegs.GPATOGGLE.bit.GPIO14 = 1;

    etc..

    Regards,
    Kris