jmie Posted March 5, 2006 Report 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.
TK. Posted March 6, 2006 Report 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now