Good morning from Munich, Germany!
I have an application which runs perfectly on a ATmega168 when downloaded via the Arduino IDE.
After successful compilation / linking for ATmega8, I have flashed it on a chip.
BUT, while the
** **setup()** **
starts to execute, it seems to hang in a
** **delay(5000);** **
call:
void setup()
{
int i;
lcd.begin(lcdNUM_COLS,lcdNUM_ROWS);
lcd.setCursor(0,0);
lcd.print(" WWCC - (c)PRMD ");
lcd.setCursor(0,1);
lcd.print("Version: JUN2011");
//
// Declare the digital I/O pins
//
pinMode(...);
//
// Wait until TS have settled
//
delay(5000);
//
// Read ADC channels 2-5 for setting the timers and temp thresholds
//
wwccTune(FALSE);
delay(5000);
// Read temperature sensors
sensorOld0 = analogRead(wwccTS0_PIN);
sensorSum0 = wwccNUM_SAMP * sensorOld0;
sensorIdx = 0;
for (i=0;i<wwccBUF_LEN;i++)
{
sensorAdc0[i] = sensorOld0;
}
}
The function wwccTune()
is expected to perform some lcd.print()
calls:
void wwccTune ( boolean t )
{
if (t)
{
// Read ADC channels
}
else
{
// Preset ADC values with constants
}
lcd.setCursor(0,0);
flt2strC(pLcdLineL,adc2deg(coldTemp));
*pLcdLineL = 'C';
lcd.print(pLcdLineL);
}
Do you know of any restriction for the ATmega8 wrt ATmega168?
The LCD works fine (at least I have my welcome banner properly displayed).
Here is the flash programming output from avrdude:
D:\Arduino\AVR>avrdude -b 19200 -P com4 -p m8 -c avrisp -F -U flash:w:wwcc.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.13s
avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "wwcc.hex"
avrdude: input file wwcc.hex auto detected as Intel Hex
avrdude: writing flash (6274 bytes):
Writing | ################################################## | 100% 12.64s
avrdude: 6274 bytes of flash written
avrdude: verifying flash memory against wwcc.hex:
avrdude: load data flash data from input file wwcc.hex:
avrdude: input file wwcc.hex auto detected as Intel Hex
avrdude: input file wwcc.hex contains 6274 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 11.19s
avrdude: verifying ...
avrdude: 6274 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Any hint would be most appreciated …!
Phil