1

I am using Atmel Studio 6.1 and ANDLoad to flash ATMega16 MCU. If I compile code with this function called, ANDLoad gives me "Error in Flash Hex File 359". 359 line is 3rd line from the end of hex file. If I call function with no code inside it works nice, but I has no point. Adding only one line of code gives me error again.

I call it like this:

start(maxSpeed, 0, speed_1); //function call

//CODE//

void start (uint8_t maxSpeeda, uint8_t dir,uint8_t speed){
uint8_t ii=0;

if (dir==1)
    setbit(PORTD,6);

else if (dir==0)
    clrbit(PORTD,6);

OCR1A = 0xFFFF;                             //set low frequency of PWM
TCCR1A |= ( (0<<COM1A1) | (1<<COM1A0) );    //PWM generator ON
tqOFF();                                    //Enable 100% torque


for (ii=0; ii<maxSpeeda; ii++){             //linear start of stepper motor     

    OCR1A = tab[ii];                        // Tab of 16-b OCR1A values for linear start
    _delay_ms(speed);                       
}

}

Do anyone has idea what am I doing wrong? Thank you. David

david.r
  • 39
  • 3
  • Perhaps your code is getting too big or some other limit is reached? In any case, without the code, details of the environment, and probably access to the tools it is *very* unlikely we can find out what is going on. – vonbrand Mar 09 '14 at 22:16
  • Only Error it gives is "Error in Flash Hex File 359" generated by programming software ANDLoad. Atmel Studio gives me no error. I also tried to use another programming interface and software, but HEX file is damaged and works incorrect. – david.r Mar 10 '14 at 23:11

1 Answers1

0

PROBLEM SOLVED! Function name "start" can not be use. Thank you to all.

david.r
  • 39
  • 3