public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] U-Boot Timer Qualification
@ 2009-04-22 20:49 Jean-Christophe PLAGNIOL-VILLARD
  2009-04-22 21:08 ` Wolfgang Denk
  2009-04-27 19:42 ` Mike Frysinger
  0 siblings, 2 replies; 18+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-04-22 20:49 UTC (permalink / raw)
  To: u-boot

Hi all,

	For all Timer modification a minimun of qualification is mandatory
	as it will impact a lots of part of u-boot.

	So for this purpose I'll propose you to use one of this two approche
	to report the precition of your timer or update

	1) Clock generation Mesurement

	Tools needed: Scope or Frequency metter

	In this approch you will use a gpio to generate a 1Khz and at 1Mhz or
	it's maximun generated clock frequency

	before generate one of this clock you will need to known your GPIO and
	system latency. For this purpose you will generate a clock at your
	maximum speed as this algo

	set_gpio_as_output(gpio);

	while(1) {
		set_gpio_value(gpio, 1);
		set_gpio_value(gpio, 0);
	}

	after measure the clock (hg_clock) you will it's latency

	now you will try to generate the 1Khz clock
	to known the precision of your timer at 1ms

	while(1) {
		set_gpio_value(gpio, 1);
		udelay(1000);
		set_gpio_value(gpio, 0);
	}

	now measure the frequency of the clock

	the last step is now calculate your precision

	hg_clock = measured max speed generated clock

	ms_clock = measured 1Khz generated clock

	p = (1 / 1000 - (1 / hg_clock + 1 / ms_clock)) * 1000

	depending on max generated clock you can known your precision
	as 1us or less

	2) Watch mesurement

	measured with stop-watch on 100s delay

	x = measured time

	p = (100 - x) / 100


Best Regards,
J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-04-29 22:21 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-22 20:49 [U-Boot] U-Boot Timer Qualification Jean-Christophe PLAGNIOL-VILLARD
2009-04-22 21:08 ` Wolfgang Denk
2009-04-22 21:28   ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-22 22:18     ` Wolfgang Denk
2009-04-23  8:01       ` Ladislav Michl
2009-04-23 14:52         ` [U-Boot] IRC log?, was: " Dirk Behme
2009-04-27 19:28         ` [U-Boot] " Mike Frysinger
2009-04-28 10:08           ` Ladislav Michl
2009-04-28 12:48             ` Mike Frysinger
2009-04-28 13:41               ` Wolfgang Denk
2009-04-28 15:53                 ` Mike Frysinger
2009-04-28 15:11               ` Ladislav Michl
2009-04-28 17:47                 ` Wolfgang Denk
2009-04-29 16:48                   ` Dirk Behme
2009-04-29 18:00                     ` Wolfgang Denk
2009-04-29 19:26                   ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-29 22:21                     ` Wolfgang Denk
2009-04-27 19:42 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox