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.

[C6713] Using GPIO pins as a input.

Dear Friend

              I want to use GPIO pins as a input in TNS320C6713 dsk. I have followed all instructions to use this J1 port(GPIO).  First i have enabled GPIO port ( switch-4 is on in sw3 DIP). Using GPIO-(8-11) 4 pins, enable GPEN registers. I have sent four parallel binary inputs repeatedly (x0F, x0E, x0A, x0B) through GP(8-11) (pins 19, 21,22,23) and get the corresponding value through GPVAL registers simultaneously . But the obtain value are like is (see below)...

Normal 0 false false false EN-US X-NONE BN MicrosoftInternetExplorer4

----------------------------------

 

output: 3584, 2560, 2816, 3840, 3840, 3584, 2560, 3840, 3584, 2560, 2816, 3840, 3584, 2560, 2816, 3840, 3584, 2560, 2816, 3840, 3840, 3584, 2560, 2816,.... etc

My Program Code

main()
{
    int t=0,b=1;
    int *gpio_enable,*gpio_dir,*gpio_val;

    gpio_enable = (int*)0x01B00000;
    gpio_dir = (int*)0x01B00004;
    gpio_val = (int*)0x01B00008;

    *gpio_enable = 0x00000F00;
    *gpio_dir = 0x00000000;

t=0;
        while(1)
        {

        for(t=0;t<16;t++)
        {
        input[t]=*gpio_val;
        delay();
        }
        for(t=0;t<16;t++)
        printf("%d, ",input[t]);

        }

------------------------------------

My question is that above this input value , how can i get the actual input value (equivalent to x0F, x0E, x0A, x0B ).

When i sent one individual value 1 & 0 through GP8(19 pin), then show the value 3840 as for high input( ' 1' ) and 3584 as for low input ( '0' ).

I have tried a lots to understand this logic, but fail.

Kindly give me any consult or suggestion if any body have a idea.

If you have any other way to use GPIO pins as a input , kindly inform me.

Your kind help will be highly appreciated.

 

Regards

Gopal Sarkar

Scientist.