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.

RM48L952: RM48L952ZWT: Setting up a timer

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

RM48L952ZWT-FREE-RTOS. In my project, I also need several interval timers. The timer RTI is busy FREE_RTOS. Is it possible to use N2HET to form single intervals?
I tried, I did not succeed.
ScreenShot test program:

#define SCI_RX_4B_PAUSE_pwmTIMER pwm1

#define SCI_TX_1B_PAUSE_pwmTIMER pwm2

 void vTaskBlink(void *pvParameters)

{

// Block for 500ms.

const TickType_t xDelay = 500 / portTICK_PERIOD_MS;

  while (1) {

    gioToggleBit(hetPORT1, PIN_HET_31);   // Blink

        RunPwmHet1Timer(SCI_RX_4B_PAUSE_pwmTIMER, 100);

   vTaskDelay( xDelay );

  }

}

void appl_Main(void)

{

hetInit();

gioInit();

gioSetDirection(hetPORT1, 0xFFFFFFFF);

_enable_IRQ();

 

if (xTaskCreate(vTaskBlink, (const char *)"TaskBlink", configMINIMAL_STACK_SIZE, NULL, 1, NULL) != pdTRUE)

{

      while(1); // Task could not be created

}

vTaskStartScheduler();

while(1);

}

 

void RunPwmHet1Timer(uint32 pwm, float Interval_us)

{

hetSIGNAL_t HetSignal;

 pwmDisableNotification(hetREG1, pwm, pwmEND_OF_PERIOD);

 HetSignal.duty = 50;             // Duty cycle in % of the period (uint32)

HetSignal.period = Interval_us;   // Period in us (float64)

 pwmSetSignal(hetRAM1, pwm, HetSignal);

pwmStart(hetRAM1, pwm);

pwmEnableNotification(hetREG1, pwm, pwmEND_OF_PERIOD);

}

void StopPwmHet1Timer(uint32 pwm)

{

pwmDisableNotification(hetREG1, pwm, pwmEND_OF_BOTH);

pwmStop(hetRAM1, pwm);

}

 

void pwmNotification(hetBASE_t * hetREG,uint32 pwm, uint32 notification)

{

if (hetREG == hetREG1) {

   switch (pwm) {

     case SCI_RX_4B_PAUSE_pwmTIMER:

       if (notification == pwmEND_OF_PERIOD || notification == pwmEND_OF_BOTH) {

              StopPwmHet1Timer(SCI_RX_4B_PAUSE_pwmTIMER);

        break;

      case SCI_TX_1B_PAUSE_pwmTIMER:

        break;

      default:

       break;

   }                                  // switch (pwm) {

}                                     // if (hetREG == hetREG1) {

else if (hetREG == hetREG2) {

 }                                     // if (hetREG == hetREG2) {

}

 

  • Hello,

    The RTI module has 4 compare modules. 4 timers can be configured independently.
  • Unfortunately, the problem was not resolved. The project module rtiCompare0 is used by FreeRtos. I'm trying to use the rtiCompare3 module to organize a one-shot timer. However, if I do not mark the HALCoGen -> RM48L952 -> Driver Enable -> Enable RTI driver, then the CCS linker gives the following error:

    undefined             first referenced          

    symbol                   in file              

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

    rtiCompare3Interrupt   ./source/sys_vim.obj      

    rtiDisableNotification ./Application/appl_main.obj

    rtiEnableNotification ./Application/appl_main.obj

    rtiInit               ./Application/appl_main.obj

    rtiResetCounter       ./Application/appl_main.obj

    rtiStartCounter       ./Application/appl_main.obj

    error #10234-D: unresolved symbols remain

    error #10010: errors encountered during linking; "BMA_RTOS.out" not built

     If I check the HALCoGen -> RM48L952 -> Driver Enable -> Enable RTI driver, then the CCS linker gives the following error.

    error #10056: symbol "vPortPreemptiveTick" redefined: first defined in "./FreeRTOS/os_portasm.obj"; redefined in "./source/rti.obj"

    error #10010: errors encountered during linking; "BMA_RTOS.out" not built

    Is there any way around this?

    Sincerely, Talgat Burganov.

  • Hello,

    If you want to use the RTI, the RTI has to be enabled in HALCOGen. Otherwise you will get errors when compiling the project. The freeRTOS only uses 1 RTI compare, and HALCOGen disables the RTI configuration for freeRTOS example. You need enable compare 1/2/3 manually. I will check the freeRTOS project and let you know which file you need to modify in order to use other RTI compare 1/2/3.
  • prvSetupTimerInterrupt() is in os_port.c