TC277 STM configuration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DSRnathan
Level 3
Level 3
50 sign-ins 25 replies posted 25 sign-ins
Hello All,
I am have configured STM registers for toggling an LED for 100ms (10 Hz). When I am measuring the actual frequency of the LED toggle using the scope it outputs 5Hz(i.e 200 ms). Please can anyone share your thoughts about why there is difference between configured frequency and actual measured frequency.
The configuration for 100msec are as follows.

fSPB = 100Mhz ; fSTM = 100MHz

/* The System Timer Frequency is 100 MHz */
#define INTPRIO_STM0_STMIR0 (1)

#define CMP0_COMPARE_VALUE (0x1312Du)
#define MSIZE0 (17u)
#define MSTART0 (7u << 8u)
#define CMP0_TOS (0u)
#define CMP1_TOS (0u)
#define ICR_VALUE (0x1u)
#define OCS_SUS (18u << 24u)
#define SRC_SRE (1u << 10u)

void STM0_Init(void) {
/* The Periodic interval for STM0 is 0.10 Seconds */
STM0_CMP0.U = STM0_TIM0.U + CMP0_COMPARE_VALUE;
/* The Periodic interval for STM1 is 1.00 Seconds */
STM0_CMP1.U = STM0_TIM0.U + CMP1_COMPARE_VALUE;
/* STM Compare Match Control Register Value: 0x8130711 */
STM0_CMCON.U = MSTART1 | MSIZE1 | MSTART0 | MSIZE0;
/* the SRC0 Interrupt serviced by TriCore */
//IFX_INTERRUPT(STM0_ISR0, 0, INTPRIO_STM0_STMIR0);
SRC_STM0SR0.U = CMP0_TOS | SRC_SRE | ISR_PRIORITY_STM;
/* Configure the Interrupt Control Register of the STM */
STM0_ICR.U = ICR_VALUE;
}

void isrSTM(void)
{
/* Update the compare register value that will trigger the next interrupt and toggle the LED */
STM0_CMP0.U += CMP0_COMPARE_VALUE;
IfxPort_setPinState(LED, IfxPort_State_toggled);
}

Note:- I have also tested with Aurix development studio with their example "STM_Interupt_1_KIT_TC277_TFT" and I experience the same issue as mentioned above.

Kindly shed your thoughts.

Deepak
0 Likes
1 Reply
DSRnathan
Level 3
Level 3
50 sign-ins 25 replies posted 25 sign-ins
hello All,
The issue has been identified as the configuration is all right but in my application i am togling the LED every 10ms time interval.
Thank you.
0 Likes