public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] How to optimize bit bang interface?
@ 2003-10-21 13:54 Steven Scholz
  0 siblings, 0 replies; only message in thread
From: Steven Scholz @ 2003-10-21 13:54 UTC (permalink / raw)
  To: u-boot

Hi there,

I am trying to configure an Altera FPGA using the so called "passive serial 
interface". Basicly it follows the scheme "clk low, data out, clock high".

For testing I wrote the loop

                 ts = get_timer (0);
                 while (1) {
                         if (get_timer (ts) > 10 * CFG_HZ)
                                 break;
                         /* Deassert the clock */
                         (*fn->clk) (FALSE, TRUE, cookie);
                         /* Assert the clock */
                         (*fn->clk) (TRUE, TRUE, cookie);
                 };

fn->clk() is the function that the common FPGA code uses:

int inline fpga_clk_fn(int assert_clk, int flush, int cookie)
{
         if (assert_clk)
                 *AT91C_PIOB_SODR = FPGA_DCLK;
         else
                 *AT91C_PIOB_CODR = FPGA_DCLK;
         return assert_clk;
}

I noticed that this is awfully slow. I get arounf 50kHz using an AT91RM9200 
running at 51MHz (core @ 171MHz).

Could someone give me a hint how to optimize stuff like this for speed?

Thanks a million,

-- 
Steven Scholz

imc Measurement & Control               imc Me?systeme GmbH
Voltastr. 5                             Voltastr. 5
13355 Berlin                            13355 Berlin
Germany                                 Deutschland
fon: +49 30 467090-0                    Tel: 030 / 467090-0
fax: +49 30 4631576                     fax: 030 / 4631576

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-21 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-21 13:54 [U-Boot-Users] How to optimize bit bang interface? Steven Scholz

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