Add support for ATMega163.

Add support for reading/writing ATMega163 lock and fuse bits.
Unfortunately, in looking at the specs for other ATMega parts, they
use entirely different instruction formats for these commands.  Thus,
these routines won't work for the ATMega103, for example.

Add support for sending raw command bytes via the interactive terminal
interface.  This allows one to execute any programming instruction on
the target device, whether or not avrprog supports it explicitly or
not.  Thus, one can use this feature to program fuse / lock bits, or
access any other feature of a current or future device that avrprog
does not know how to do.

Add in comments, an experimental instruction format in the
configuration file.  If this works out, it would allow supporting new
parts and non-orthoganal instructions across existing parts without
making avrprog code changes.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@99 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean
2001-11-19 17:44:24 +00:00
parent 76fb1330af
commit f1af5d3981
6 changed files with 338 additions and 91 deletions

14
avr.h
View File

@@ -42,6 +42,8 @@
*/
#define AVR_M_EEPROM 0
#define AVR_M_FLASH 1
#define AVR_M_FUSE 2
#define AVR_M_LOCK 3
#define AVR_MAXMEMTYPES 2 /* just flash and eeprom */
@@ -86,10 +88,20 @@ unsigned char avr_txrx(int fd, unsigned char byte);
int avr_cmd(int fd, unsigned char cmd[4], unsigned char res[4]);
unsigned char avr_read_calibration(int fd, AVRPART * p);
unsigned char avr_read_fuse(int fd, AVRPART * p, int high);
int avr_write_fuse(int fd, AVRPART * p, int high, unsigned char b);
unsigned char avr_read_lock(int fd, AVRPART * p);
int avr_write_lock(int fd, AVRPART * p, unsigned char b);
unsigned char avr_read_byte(int fd, AVRPART * p,
int memtype, unsigned long addr);
int avr_read(int fd, AVRPART * p, int memtype);
int avr_read(int fd, AVRPART * p, int memtype, int size);
int avr_write_bank(int fd, AVRPART * p, int memtype,
unsigned short bank);