[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avrdude-dev] ATMega8535 on avr910
From: |
Alex Shepherd |
Subject: |
RE: [avrdude-dev] ATMega8535 on avr910 |
Date: |
Wed, 13 Aug 2003 10:24:54 +1200 |
> Avrdude doesn't want to work with the updated firmware,
> serial_recv()
> says the programmer is not responding. Not sure what's up
> with that.
I had a look at this and found that there are two bits of code that are
getting in the way:
In avr910.c
/*
* For some reason, if we don't do this when writing to flash, the first
byte
* of flash is not programmed. I suspect that the board got out of sync
after
* the erase and sending another command gets us back in sync. -TRoth
*/
static void avr910_write_setup(PROGRAMMER * pgm, AVRPART * p, AVRMEM *
m)
{
if (strcmp(m->desc, "flash") == 0) {
avr910_send(pgm, "y", 1);
avr910_vfy_cmd_sent(pgm, "clear LED");
}
}
In AVR910_2313_v3.asm
;* V2.2c 03.06.07 (sjdavies) Changed the 'x' and 'y' commands
to make
;* them accept a parameter
('flushing' bugfix)
w5:
cpi u_data,0x78 ; 'x' Set LED (ignored)
brne w6
rcall getc ; ignore data byte
rjmp put_ret
;**** Clear LED ****
w6:
cpi u_data,0x79 ; 'y' Clear LED (ignored)
brne w7
rcall getc ; ignore data byte
rjmp put_ret
The problem seems to be that the avr910.c code is sending a 'y' command
and waiting for a response, while the 2313 code is expecting to receive
another byte value before it sends the response.
I changed the line:
avr910_send(pgm, "y", 1);
To
avr910_send(pgm, "y0", 2);
And it gets past that and completes but when I look at the flash it is
still all 0xFF and so it didn't program. However uisp and avrprog seem
to do a fine job.
Guess it does beg the question: why two programmers avrdude and uisp?
Maybe someone a bit more knowledgeable about the history of avr910 (in
its many formats) may be able to advise which way to go!
Alex