When configuring the EDF kernel for an Erika Enterprise application, the user has the possibility to specify the tick length in the OIL file to allow the specification of a relative deadline using a temporal value. In particular, the user can specify a tick value as follows:
KERNEL_TYPE = EDF { TICK_TIME = "25 ns ";};
and then specify a relative deadline using a timing value as follows
TASK myTask1 {
REL_DEADLINE = "10 ms ";
};
The RT-Druid code generator will handle the the conversion between the relative deadline value in the corresponding timing value automatically. The important thing in this process is to correctly specify the TICK_TIME. In general, that value depends on the timing reference which is made available by the dsPIC (R) DSC. The current timing reference implemented in the EDF kernel is based on the value
of a 32 bit timer. Having a 32 bit timing reference helps implementing a long lifetime for the circular
timer, allowing the support of relatively long relative deadlines. The 32 bit timer is obtained by concatenating the two 16 bit timers TMR8 and TMR9 available on the dsPIC (R) DSC. The clock used for the timers is the system clock, with a tick time equal to 1 Fcy, where Fcy = Fosc2 . Fosc, the frequency of the oscillator, depends on its configuration which is typically done in the application by using appropriate macros shown below.
The following paragraphs describe two typical oscillator values which can be used, and the correspondent parameters which has to be put in the OIL file. The same settings are available in two template applications distributed with Erika Enterprise which work on the FLEX boards featuring a dsPIC (R) DSC model PIC33FJ256MC710. Finally, always remember that the EE_time_init function has to be called inside the main function before using any primitive of the EDF kernel.
|