uint32_t TimerInterval = 10000; // 10 seconds /* By default, the PCLKSELx value is zero, thus, the PCLK for all the peripherals is 1/4 of the SystemFrequency. */ /* Bit 26~27 is for RIT_TIMER */ pclkdiv = (LPC_SC->PCLKSEL1 >> 26) & 0x03; switch (pclkdiv) { case 0x00: default: pclk = SystemCoreClock / 4; break; case 0x01: pclk = SystemCoreClock; break; case 0x02: pclk = SystemCoreClock / 2; break; case 0x03: pclk = SystemCoreClock / 8; break; } LPC_RIT->RICOMPVAL = (pclk / TimerInterval) - 1; |
uint32_t TimerInterval = 100; LPC_RIT->RICOMPVAL = pclk/TimerInterval; |
uint32_t TimerInterval = 100; LPC_RIT->RICOMPVAL = pclk/TimerInterval; |
uint32_t TimerInterval = 100; LPC_RIT->RICOMPVAL = pclk/TimerInterval; |
uint32_t TimerInterval = 10000; // 10 seconds /* By default, the PCLKSELx value is zero, thus, the PCLK for all the peripherals is 1/4 of the SystemFrequency. */ /* Bit 26~27 is for RIT_TIMER */ pclkdiv = (LPC_SC->PCLKSEL1 >> 26) & 0x03; switch (pclkdiv) { case 0x00: default: pclk = SystemCoreClock / 4; break; case 0x01: pclk = SystemCoreClock; break; case 0x02: pclk = SystemCoreClock / 2; break; case 0x03: pclk = SystemCoreClock / 8; break; } LPC_RIT->RICOMPVAL = (pclk / TimerInterval) - 1; |