Rev 1415 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1415 | Rev 1468 | ||
|---|---|---|---|
| Line 22... | Line 22... | ||
| 22 | /** |
22 | /** |
| 23 | * Initialize MCU. If the MCU is mega88, the internal clock frequency will be |
23 | * Initialize MCU. If the MCU is mega88, the internal clock frequency will be |
| 24 | * set to 8MHz. Interrupts must not be enabled when calling this function! |
24 | * set to 8MHz. Interrupts must not be enabled when calling this function! |
| 25 | */ |
25 | */ |
| 26 | void Mcu_Init() { |
26 | void Mcu_Init() { |
| 27 | #if defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) |
27 | #if defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) |
| 28 | // set the clock speed to 8MHz |
28 | // set the clock speed to 8MHz |
| 29 | // set the clock prescaler. First write CLKPCE to enable setting of clock the |
29 | // set the clock prescaler. First write CLKPCE to enable setting of clock the |
| 30 | // next four instructions. |
30 | // next four instructions. |
| 31 | CLKPR=(1<<CLKPCE); |
31 | CLKPR=(1<<CLKPCE); |
| 32 | #ifndef AVR_CLOCK_PRESC |
32 | #ifndef AVR_CLOCK_PRESC |