1. in main.c,
Code: Select all
// This function delays the specified number of 10 microseconds
// it is 'hardcoded' and is calibrated by adjusting DELAY_CNT
// in main.h Unless you are changing the crystal from 8mhz, dont
// mess with this.
void delay_ten_us(uint16_t us) {
uint8_t timer;
while (us != 0) {
// for 8MHz we want to delay 80 cycles per 10 microseconds
// this code is tweaked to give about that amount.
for (timer=0; timer <= DELAY_CNT; timer++) {
NOP;
NOP;
}
NOP;
us--;
}
}
2. in MAKEFILE,
Code: Select all
F_CPU = 8000000
Code: Select all
F_CPU = 16000000
Code: Select all
burn-fuse:
$(AVRDUDE) $(AVRDUDE_FLAGS) -B 250 -u -U lfuse:w:0xfd:m -U hfuse:w:0xdf:m
Code: Select all
burn-fuse:
$(AVRDUDE) $(AVRDUDE_FLAGS) -B 250 -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
In WinAVR, I recompiled these files, but I got some errors (I will post what errors I got later) and couldn't make hex file. I was wondering if there wass anyone tried to use 16MHz (I searched this forum and found one post, but there was no answer) resonator and tell me if there is any other settings or values I need to change.
By the way, in main.c, line 69, in the description for the pins, it says,
Code: Select all
pin 7 PB0 - visible LED, and also connects to programming circuitry
PB0 is the pin 5, isn't it?
Thanks.
Jinseok