Why RTEMS timeslice is not as configured.

Fernando Nicodemos fgnicodemos at ncb.ind.br
Wed Aug 14 19:35:16 UTC 2013


Guys,

Problem solved.
I forgot to configure the register in the right way, exactly with the
correct oscillator value. In this case our board use a 24MHz external
oscilator. ERC32 core and system runs at 12MHz with this oscillator. So the
function the configure this is:

#include <stdint.h>
#include "hardware.h"
#include <bsp.h>

void hardware_setup(void)
{

  CLOCK_SPEED =
12
; // <---- use the right ERC32 core clock value here
(half from external oscilator)

  /* approximately 1 us per countdown */
  ERC32_MEC.Real_Time_Clock_Scalar  = CLOCK_SPEED - 1;
  ERC32_MEC.Real_Time_Clock_Counter =
      rtems_configuration_get_microseconds_per_tick();

  ERC32_MEC_Set_Real_Time_Clock_Timer_Control(
      ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING |
        ERC32_MEC_TIMER_COUNTER_LOAD_SCALER |
            ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER
    );

    ERC32_MEC_Set_Real_Time_Clock_Timer_Control(
      ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING |
            ERC32_MEC_TIMER_COUNTER_RELOAD_AT_ZERO);

}


Thanks to all

Regards
>
>
> *Fernando G. Nicodemos*
> *Diretor de Pesquisa e Desenvolvimento
>
> ***®*NCB - Sistemas **Embarcados Ltda.*
> *23° 09’ 24.87”S**     45° 47’ 26.49”W*
> São José dos Campos - SP - Brasil
> t.:+55 (12) *3905.2243*                *
> www.ncb.ind.br*
>
> *AVISO:* Esta mensagem pode conter informações privilegiadas e seu
> conteúdo é confidencial. É endereçada somente para destinatários
> conhecidos. Se você não for um destinatário conhecido, não está autorizado
> a distribuir, divulgar, imprimir, copiar e se utilizar desta mensagem e seu
> conteúdo.
>
>
> 2013/8/14 Chris Johns <chrisj at rtems.org>
>
>> Fernando Nicodemos wrote:
>>
>>> Guys, problems solved.
>>>
>>> We forgot to change the right clock value in linkcomands.
>>> Our board works on 12MHz in the core.
>>>
>>>
>> Well done. It may pay to post to the list this.
>>
>> Chris
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20130814/6ccd383f/attachment.html>


More information about the users mailing list