Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Interval timer

Altera_Forum
Honored Contributor II
1,630 Views

Is it necessary to have an interval timer in your sopc design for a microc/os-ii project to work? what would happen if you dont put an interval timer.. in my bsp it shows system clock timer as none. does that mean it will take the 50Mhz clock as the system timer?

0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
654 Views

No you absolutely need a system timer or the scheduler won't work. If it compiles, the OS will probably freeze before even starting.

0 Kudos
Altera_Forum
Honored Contributor II
654 Views

i see.. thanks :)

0 Kudos
Altera_Forum
Honored Contributor II
654 Views

i tried running it without a system clock and it works! as long as you dont use any delay or time related functions. you have to trick the compiler by putting  

the number of ticks per second in the header file even though theres no real tick :)
0 Kudos
Altera_Forum
Honored Contributor II
654 Views

I didn't look at the OS code in detail but I doubt the scheduler will work correctly without a timer. You may have a problem when you start running several threads simultaneously.

0 Kudos
Altera_Forum
Honored Contributor II
654 Views

/* ********************************************************************************************************* * PROCESS SYSTEM TICK * * Description: This function is used to signal to uC/OS-II the occurrence of a 'system tick' (also known * as a 'clock tick'). This function should be called by the ticker ISR but, can also be * called by a high priority task. * * Arguments : none * * Returns : none ********************************************************************************************************* */ void OSTimeTick (void)  

 

This is from os_core.c. uOS might work "without" a timer but then of course the timebase becomes "shaky" at best.  

The mentioned "high priority task" might also consume a lot of CPU to busy waits. 

I would recommend to use a real HW timer. 

 

karsten
0 Kudos
Reply