This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AT91SAM7S RTC speed


Hello!

>>>>> "Andrew" == Andrew Lunn <andrew@lunn.ch> writes:

    Andrew> I've also been using the AT91SAM7S and AT91SAM7X in real
    Andrew> projects and have not had problems with the timer. Please
    Andrew> could you explain what you see wrong?

I use following program as a test:

-----
/* test.c -- RTC speed test */

/*
 * Prints incrementing count value every 10 seconds.
 */

#include <cyg/hal/hal_arch.h>
#include <cyg/kernel/kapi.h>

#include <stdio.h>

#define TEST_PRIORITY 5


/* System data areas */
static cyg_thread test_memory;
static cyg_uint8 test_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
static cyg_handle_t test_thread;


static void test_task(cyg_addrword_t data)
{
  unsigned int count = 0;
  printf("Started\n");
  while (true)
    {
      printf("%i\n", count++);
      cyg_thread_delay(1000);
    }
}

void cyg_user_start(void)
{
  cyg_thread_create(TEST_PRIORITY, test_task, (cyg_addrword_t)0,
                    "Measurement", (void *)test_stack, CYGNUM_HAL_STACK_SIZE_TYPICAL,
                    &test_thread, &test_memory);
  cyg_thread_resume(test_thread);
  return;
}
-----

The system libraries are built with commands:

ecosconfig new at91sam7sek
ecosconfig tree
make

Since default system tick is 10 milliseconds, the 1000 ticks delay
must be 10 seconds. But, in fact, it appears to be 20 seconds without
patch. I've reproduced this result today with current Ecos snapshot
from CVS and it is pretty identical as on the target devices as on the
AT91SAM7S-EK development board. The main oscillator frequency in all
cases was standard: 18.432 MHz.

Best regards,
Igor.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]