In my application, iam using 16 MKE04VTG4 controllers. Same firmware and Hardware for all.
All the health LEDs are sinking with another for some time around 2 minutes only. Later all Health LEDs are unable sink with one to another.
May I Know what is the reason.
Below is the code in all controllers for health LED.
void PIT_CH0_IRQHandler()
{
PIT->CHANNEL[0].TFLG = 0x01; // Disable Interrupt
PIT->CHANNEL[0].TCTRL = 0x00; // Disable timer & Stop timer
PIT->CHANNEL[0].TCTRL = 0x03; // Start Timer & Interrupt Enable
count_l++;
if(count_l >= LED_TOGGLE_VALUE)
{
flag = flag^1;
GPIO_PortToggle(kGPIO_PORTB, 0x20); // toggle led for every 500msec
count_l = RESET;
}
ADC_SetChannelConfig(ADC,&sADC_Config_1);
}
void pit_init()
{
pit_config.enableRunInDebug = false;
PIT_Init(PIT, &pit_config); // PIT PERIPHERAL RUNS ON BUS CLOCK, AS PER USER MANUAL
PIT->MCR = 0x00; // Enable clock for PIT
PIT->CHANNEL[0].LDVAL = 240000;//(BUS_CLOCK*(PIT_INT/1000)); // LOAD VALUE FOR EVERY 10MSEC INTERRUPT
PIT->CHANNEL[0].TCTRL = 0x03; // Start Timer & Interrupt Enable
NVIC_EnableIRQ(PIT_CH0_IRQn);
NVIC_SetPriority(PIT_CH0_IRQn,0);
}
It is also observed that PIT Interrupt is triggering below count down register becomes zero.