EmbDev.net

Forum: ARM programming with GCC/GNU tools Clock Speed


von Jim K. (ancaritha)


Rate this post
useful
not useful
So I was wondering, all the the peripherals on the SAm7A3 are configured
to 48 MHz via the handy dandy Cstartup_SAM7.c init file.  I was
wondering, does this actually configure the main clock to run at 48 MHz,
or it is still running at the Oscillator crystal speed?

I'm wondering because my system seems to be running a lot more sluggish
than it should be.  For instance, I have an LCD display that should take
approximately 2.5 mS to update (I have a lot of no ops in there to get
the timing to work out properly), but it instead takes approximately 350
mS.  This is remarkably similar to if the clock speed was running at 3.6
MHz (the oscillator crystal) and not at the boosted 48 MHz.

I was wondering if anyone else noticed the system running slow than it
should be.


Note: I did turn on the processor clock with pPMC->PMC_SCER |=
AT91C_PMC_PCK;

von Jim K. (ancaritha)


Rate this post
useful
not useful
Viva la Oscilloscope and GDB Insight.

It turns out that when one of the programmers called a function to write
to the display, he thought the function updated only one line, but it
updated the whole thing, so we were running the LCD code about 6 times
more than we thought we were.    Hopefully this will improve over all
system performance.

Access time went from 350 mS to around 20 mS.  I can live with that much
easier :)

von Jim K. (ancaritha)


Rate this post
useful
not useful
So going along with this whole processor speed thread I started... is
there any way that I can find out the actual speed of the processor?

I know I can pipe out the slow clock, the PLL and the main clock.  The
slow clock is around 32k, the PLL is just a voltage that according to ye
old local EE guy will change between runs as it adjusts itself and may
be high, or low, so I can't really use that and the main clock is just
the external oscillator that I'm using (in this case, 3.6 MHz).

Is there anything that I can probe, or set up internally that will tell
me how fast the clock is going?  I could just set up a for loop of No
Ops or something, but I was hoping for something a little more accurate.
Any ideas?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.