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.

TMDX570LC43HDK: Push Button GIOA7

Part Number: TMDX570LC43HDK

Tool/software:

Hi,

İ can control push button status. Push button is GIO port A pin 7. But when i control port A pin 7, i dont appear push button values. I can see it on GIO portA pin 6.
It says 7 in the document and on the board.
What is the reason for this ? Is 0 ignored when preparing document ?

  • Hi Dobby,

    Can you please try with below code once:

    int main(void)
    {
    /* USER CODE BEGIN (3) */
    hetInit();
    gioInit();

    gioSetDirection(hetPORT1,
    (1 << 0) |
    (1 << 5) |
    (1 << 17) |
    (1 << 18) |
    (1 << 25) |
    (1 << 27) |
    (1 << 29) |
    (1 << 31));

    while(1){

    button = ((gioPORTA->DIN & (1 << 7)) >> 7);

    if(button == 0){
    gioSetPort(hetPORT1,
    (1 << 0) |
    (1 << 5) |
    (1 << 17) |
    (1 << 18) |
    (1 << 25) |
    (1 << 27) |
    (1 << 29) |
    (1 << 31));
    }

    else if(button == 1){
    gioSetPort(hetPORT1,
    (0 << 0) |
    (0 << 5) |
    (0 << 17) |
    (0 << 18) |
    (0 << 25) |
    (0 << 27) |
    (0 << 29) |
    (0 << 31));
    }

    }

    /* USER CODE END */


    }


    /* USER CODE BEGIN (4) */
    /* USER CODE END */

    --
    Thanks & regards,
    Jagadish.

  • Hi,

    I solved the problem as follows. But I did not understand why I was reading from pin 6 and
    why the values ​​0 2 came instead of 1 0.

     

    /* USER CODE BEGIN (3) */
    hetInit();
    gioInit();

    gioSetDirection(hetPORT1, 
    (1 << 0) |
    (1 << 5) |
    (1 << 17) |
    (1 << 18) |
    (1 << 25) |
    (1 << 27) |
    (1 << 29) |
    (1 << 31));

    while(1){

    button = gioPORTA->DIN >> 6;

    if(button == 0){
    gioSetPort(hetPORT1,
    (1 << 0) |
    (1 << 5) |
    (1 << 17) |
    (1 << 18) |
    (1 << 25) |
    (1 << 27) |
    (1 << 29) |
    (1 << 31));
    }

    else if(button == 2){
    gioSetPort(hetPORT1,
    (0 << 0) |
    (0 << 5) |
    (0 << 17) |
    (0 << 18) |
    (0 << 25) |
    (0 << 27) |
    (0 << 29) |
    (0 << 31));
    }

    }

    /* USER CODE END */

  • Hi Dobby,

    I solved the problem as follows. But I did not understand why I was reading from pin 6 and
    why the values ​​0 2 came instead of 1 0.

    GIOA7 means we need to shift 7 times not 6 times. Because the port pin numbers will start from A0

    So, to get GIOA7 status to the least significant bit we need to shift the register value 7 times instead of 6 times.

    --
    Thanks & regards,
    Jagadish.