Hi Ping,
thanks for your help.
Here's the function installing the timer:
static void install_timer_interrupt
(
void
)
{
LPM_REGISTRATION_STRUCT registration;
uint_32 dummy_handle;
/* Install the timer */
if (MQX_OK != _lpt_install (0, 30 * 1000000, LPT_FLAG_CLOCK_SOURCE_ERCLK32K, 2, timer_wakeup_isr, TRUE))
{
_io_printf ("\nError during installation of timer interrupt!\n");
_task_block();
}
LPTMR_MemMapPtr lpt_ptr = (LPTMR_MemMapPtr)_bsp_get_lpt_base_address (0);
lpt_ptr->CSR |= LPTMR_CSR_TFC_MASK;
/* Stop the timer */
_lpt_run (0, FALSE);
}
And this is the isr:
static void timer_wakeup_isr(pointer parameter){
set_minute_signal();
_lpt_clear_int ((uint_32)parameter);
}
Just sending a signal..
In the meantime i got the following information from support:
I run your code _lpt_install (0, 30 * 1000000, LPT_FLAG_CLOCK_SOURCE_ERCLK32K, 2, timer_wakeup_isr, TRUE); in TWR-K60N512 BSP MQX 4.0.1 and I get:
PSR = 0x1A means PRESCALE /16
PCS = Secondary External Ref Clk
CMR = 0xEFFF.
Now, assuming SIM_SOPT1[OSC32KSEL] selects 32.768 kHz RTC oscillator from XTAL32/EXTAL32 on board 32.768 kHz crystal, we get:
(0xEFFF+1)*16*1/32.768kHz = 30 sec so the computed values look just all right.
Thanks for your efford!
Tobias