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.

TMS570LS1227: Setting Pin Directions as Output at Halcogen

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Hi I am a newbie. 

I am trying to blink a LED. I used Halcogen example and i see its working. 

But i want to use Halcogen for setting hetPORT1 as output instead of  gioSetDirection(hetPORT1, 0xFFFFFFFF) command. 

What steps should I take in Halcogen to not use gioSetDirection command in code?

My code is here and its Halcogen example code. 

/* Include Files */

#include "sys_common.h"
#include "system.h"

/* USER CODE BEGIN (1) */
/* Include FreeRTOS scheduler files */
#include "FreeRTOS.h"
#include "os_task.h"

/* Include HET header file - types, definitions and function declarations for system driver */
#include "het.h"
#include "gio.h"

/* Define Task Handles */
xTaskHandle xTask1Handle;

/* Task1 */
void vTask1(void *pvParameters)
{
    for(;;)
    {
        /* Taggle HET[1] with timer tick */
        gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
        vTaskDelay(100);
    }   
}
/* USER CODE END */


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


void main(void)
{
/* USER CODE BEGIN (3) */
    
    /* Set high end timer GIO port hetPort pin direction to all output */
    gioSetDirection(hetPORT1, 0xFFFFFFFF);  // Don't want to use this command


    /* Create Task 1 */
    if (xTaskCreate(vTask1,"Task1", configMINIMAL_STACK_SIZE, NULL, 1, &xTask1Handle) != pdTRUE)
    {
        /* Task could not be created */
        while(1);
    }

    /* Start Scheduler */
    vTaskStartScheduler();

    /* Run forever */
    while(1);
/* USER CODE END */
}

  • Hi Gunce,

    Actually it is proper way to configure it because as you can see the datasheet

    the pin you are toggling doesn't has GIO functionality, it has only timer functionality. So we can't configure this pin through GIO module in HALCoGen.

    If you really want to do this from HELCoGen then you have to enable HET1 driver from HALCoGen and have to enable the below checkbox

    And also have to call the "hetInit" function after immidate main loop then it will configure that pin as output, at the same time this process is like wasting memory resource because we are including entire HET driver for to just configure direction of the pin and it consumes the flash memory. So please follow the same process you are using now.

    --

    Thanks,

    Jagadish.

  • Hi Jagadish,

    I was trying same things you posted and i couldn't work it then i realised i forgot to init the het module. 

    After that it worked. Thank you for your reply.