jmie Posted March 5, 2006 Report Share Posted March 5, 2006 Hello,I'm trying to periodicly call a function.The function itself is working well,but I did not get it to be called perodically.I'm not clear how to initialize the Timer with "MIOS_Timer_Set"If using MIOS_Timer_Set(1); make results:main.c:42: warning 112: function 'MIOS_Timer_Set' implicit declarationmain.c:42: error 101: too many parametersHow is the right syntax for MIOS_Timer_Set?And is void Init(void) __wparam { MIOS_Timer_Set(1); } the right place to put it?Thanks in advanceJuergen M. Quote Link to comment Share on other sites More sharing options...
TK. Posted March 6, 2006 Report Share Posted March 6, 2006 Hi Juergen,the purpose of the parameters are described in the MIOS function overview (which unfortunately only comes with assembly examples, this will be changed sooner or later)-> http://www.ucapps.de/mios_fun.html#MIOS_TIMER_InitSo, using small values is not recommented, because in this case the timer will propably more oftenly called then it could execute the appr. code. I would say, that periods < 100 uS should be prevented, periods > 500 uS should be prefered if the execution of the main program should not be stalled that much.An example for the timer usage can be found in the "analog box" application, here an excerpt: // initialize the timer - it should be invoked each mS MIOS_TIMER_Init(0, 10000); // 1 mS / 100 nS = 10000 cycles[/code]Yes, the timer should be initialized within Init(), but you are also allowed to change timer period from anywhere else if required (see clockbox -> dynamic adjustment of BPM)Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.