summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2012-09-05 12:13:01 +0200
committerMichael Buesch <m@bues.ch>2012-09-05 12:13:01 +0200
commit9d478916d191cb1d71878be4682c737e4472e9d0 (patch)
treec5831ec937ab5fb2c98ae12d13f7ac9cbc68d537
parent48e0e325c2dc8e95b59882d6d49b6b7a159045bd (diff)
downloadtoprammer-9d478916d191cb1d71878be4682c737e4472e9d0.tar.xz
toprammer-9d478916d191cb1d71878be4682c737e4472e9d0.zip
atmega-common: Add support for 3 fuse bytes
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--libtoprammer/chips/atmega32dip40.py3
-rw-r--r--libtoprammer/chips/atmega88dip28.py3
-rw-r--r--libtoprammer/chips/atmega8dip28.py3
-rw-r--r--libtoprammer/chips/atmega_common.py13
-rw-r--r--libtoprammer/chips/attiny26dip20.py3
5 files changed, 19 insertions, 6 deletions
diff --git a/libtoprammer/chips/atmega32dip40.py b/libtoprammer/chips/atmega32dip40.py
index 486cec3..508ad23 100644
--- a/libtoprammer/chips/atmega32dip40.py
+++ b/libtoprammer/chips/atmega32dip40.py
@@ -34,7 +34,8 @@ class Chip_ATMega32DIP40(Chip_ATMega_common):
flashPageSize = 64,
flashPages = 256,
eepromPageSize = 4,
- eepromPages = 256)
+ eepromPages = 256,
+ fuseBytes = 2)
ChipDescription(
Chip_ATMega32DIP40,
diff --git a/libtoprammer/chips/atmega88dip28.py b/libtoprammer/chips/atmega88dip28.py
index aad444d..a1caafb 100644
--- a/libtoprammer/chips/atmega88dip28.py
+++ b/libtoprammer/chips/atmega88dip28.py
@@ -34,7 +34,8 @@ class Chip_ATMega88DIP28(Chip_ATMega_common):
flashPageSize = 32,
flashPages = 128,
eepromPageSize = 4,
- eepromPages = 128)
+ eepromPages = 128,
+ fuseBytes = 3)
ChipDescription(
Chip_ATMega88DIP28,
diff --git a/libtoprammer/chips/atmega8dip28.py b/libtoprammer/chips/atmega8dip28.py
index 6b680bb..cfc0fe7 100644
--- a/libtoprammer/chips/atmega8dip28.py
+++ b/libtoprammer/chips/atmega8dip28.py
@@ -34,7 +34,8 @@ class Chip_ATMega8DIP28(Chip_ATMega_common):
flashPageSize = 32,
flashPages = 128,
eepromPageSize = 4,
- eepromPages = 128)
+ eepromPages = 128,
+ fuseBytes = 2)
fuseDesc = (
BitDescription(0, "CKSEL0"),
diff --git a/libtoprammer/chips/atmega_common.py b/libtoprammer/chips/atmega_common.py
index 1609528..30ac588 100644
--- a/libtoprammer/chips/atmega_common.py
+++ b/libtoprammer/chips/atmega_common.py
@@ -39,7 +39,8 @@ class Chip_ATMega_common(Chip):
chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
signature,
flashPageSize, flashPages,
- eepromPageSize, eepromPages
+ eepromPageSize, eepromPages,
+ fuseBytes
):
Chip.__init__(self,
chipPackage = chipPackage,
@@ -51,6 +52,7 @@ class Chip_ATMega_common(Chip):
self.flashPages = flashPages # Nr of flash pages
self.eepromPageSize = eepromPageSize # EEPROM page size, in bytes
self.eepromPages = eepromPages # Nr of EEPROM pages
+ self.fuseBytes = fuseBytes # Nr of fuse bytes
def readSignature(self):
self.__enterPM()
@@ -227,7 +229,14 @@ class Chip_ATMega_common(Chip):
self.__readWordToStatusReg()
self.__setBS2(0)
data = self.top.cmdReadBufferReg()
- fuses = data[0] + data[3]
+ if self.fuseBytes == 2:
+ # fuseLow, fuseHigh
+ fuses = data[0] + data[3]
+ elif self.fuseBytes == 3:
+ # fuseLow, fuseHigh, fuseExt
+ fuses = data[0] + data[3] + data[2]
+ else
+ assert(0)
lock = data[1]
return (fuses, lock)
diff --git a/libtoprammer/chips/attiny26dip20.py b/libtoprammer/chips/attiny26dip20.py
index 0faaa63..f5df8db 100644
--- a/libtoprammer/chips/attiny26dip20.py
+++ b/libtoprammer/chips/attiny26dip20.py
@@ -34,7 +34,8 @@ class Chip_ATTiny26DIP20(Chip_ATMega_common):
flashPageSize = 16,
flashPages = 64,
eepromPageSize = 4,
- eepromPages = 32)
+ eepromPages = 32,
+ fuseBytes = 2)
ChipDescription(
Chip_ATTiny26DIP20,
bues.ch cgit interface