From: Steven Scholz <steven.scholz@imc-berlin.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] How to optimize bit bang interface?
Date: Tue, 21 Oct 2003 15:54:49 +0200 [thread overview]
Message-ID: <3F953AA9.5070300@imc-berlin.de> (raw)
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
reply other threads:[~2003-10-21 13:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F953AA9.5070300@imc-berlin.de \
--to=steven.scholz@imc-berlin.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox