You dont have to change crystal, change code.
http://opengauge.googlecode.com/svn/...no/mpguino.cpp
cpp file has section where you comment 20mhz part out and 16mhz part in. Only few lines needs changing.
change this part...
Quote:
//use with 20mhz
#define cyclesperhour 4500
#define dispadj 800
#define dispadj2 1250
#define looptime 1250000ul/loopsPerSecond //1/2 second
#define myubbr (20000000/16/9600-1)
#define injhold (parms[injectorSettleTimeIdx]*5)/4
#define outhi(port,pin) PORT##port |= ( 1 << P##port##pin )
#define outlo(port,pin) PORT##port &= ~( 1 << P##port##pin )
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
//use with 16mhz, not tested
//#define cyclesperhour 3600
//#define dispadj 1000
//#define dispadj2 1250
//#define looptime 1000000ul/loopsPerSecond //1/2 second
//#define myubbr (16000000/16/9600-1)
//#define injhold parms[injectorSettleTimeIdx]
|
...to this:
Quote:
//use with 20mhz
//#define cyclesperhour 4500
//#define dispadj 800
//#define dispadj2 1250
//#define looptime 1250000ul/loopsPerSecond //1/2 second
//#define myubbr (20000000/16/9600-1)
//#define injhold (parms[injectorSettleTimeIdx]*5)/4
#define outhi(port,pin) PORT##port |= ( 1 << P##port##pin )
#define outlo(port,pin) PORT##port &= ~( 1 << P##port##pin )
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
//use with 16mhz, not tested
#define cyclesperhour 3600
#define dispadj 1000
#define dispadj2 1250
#define looptime 1000000ul/loopsPerSecond //1/2 second
#define myubbr (16000000/16/9600-1)
#define injhold parms[injectorSettleTimeIdx]
|
Other option is, that you use older version - it is arduino compatible withiout changes:
http://opengauge.googlecode.com/svn/...no/mpguino.pde
Meelis