My Mega8 is 16MHz. Ive got a 20MHz crystal laying around. Is there a way that I can have my Mega8 use that 20MHz crystal instead of its own internal 16MHz resonator?If yes, how do I go about setting this up?

And also, is there any sort of limit as to what Hz crystal I would be able to use? For instance if got lucky and found like a 1GHz Crystal , could I use that?

... And I guess more importantly, is there a real advantage to upping the processing speed? Im guessing that I would simply be able to read in sensor data faster and make a faster decision based on that and all that right?

Start on Page 23 of the ATmega 8 data sheet. This section shows how one can connect an external oscillator to the MCU.

I doub't if it'll work reliably. The key work here is reliability. You might be able to read I/O faster but are you reading the correct results? AFAIK, the ATMega 8 registers and fuse bits (CKSEL, OSCCAL, etc) doesn't those clock rates so timings might actually go awry, ie UART, SPI might go out of whack.

Logged

The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

My Mega8 is 16MHz. Ive got a 20MHz crystal laying around. Is there a way that I can have my Mega8 use that 20MHz crystal instead of its own internal 16MHz resonator?

Oh, it's only a 20% increase. I guess that it would work with some specimens and not with others.

Quote

If yes, how do I go about setting this up?

Like if it was 16MHz.

Quote

And also, is there any sort of limit as to what Hz crystal I would be able to use?

Yes

Quote

For instance if got lucky and found like a 1GHz Crystal , could I use that?

Finding a 1GHz X-tal wouldn't take luck, but rather a very powerfull improbability field For X-tal work on much less than half of that, a PLL with dividers has to be used, since it's impossible to grind an X-tal so thin that it would swing at that high frequencies.

Quote

... And I guess more importantly, is there a real advantage to upping the processing speed?

Any over-clocker would say yes. somewhat higher speed, but on the downside, anyone with half a deck would mumble "much higher temperatures and current consumption" as a very direct consequence.

Quote

Im guessing that I would simply be able to read in sensor data faster and make a faster decision based on that and all that right?

Read speed would depend on what your sensor can handle in quite a number of sensor apps. But you would get higher execution speed (in more than one meaning of that term )

If you wanna speed up, go with a faster processor, or to start with, optimize your algos.

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives