summaryrefslogtreecommitdiffstats
path: root/libtoprammer/chips/microchip8
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2013-10-13 23:10:20 +0200
committerMichael Buesch <m@bues.ch>2013-10-13 23:10:20 +0200
commit3a0fe398cb944939099522e65634fd9979abd015 (patch)
treedd88e3c1315d505a78a6d5395387b079ed779c41 /libtoprammer/chips/microchip8
parent3cff9504b060c2bf1e04812392a3f1147eb3e5d4 (diff)
downloadtoprammer-3a0fe398cb944939099522e65634fd9979abd015.tar.xz
toprammer-3a0fe398cb944939099522e65634fd9979abd015.zip
Add generic support for parsing of ihex sections
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/chips/microchip8')
-rw-r--r--libtoprammer/chips/microchip8/microchip8_18_common.py14
-rw-r--r--libtoprammer/chips/microchip8/microchip8_singlePMarea.py16
-rw-r--r--libtoprammer/chips/microchip8/microchip8_splittedPMarea.py14
-rw-r--r--libtoprammer/chips/microchip8/pic12f629dip8.py3
-rw-r--r--libtoprammer/chips/microchip8/pic12f629sip6.py3
-rw-r--r--libtoprammer/chips/microchip8/pic16f630dip14.py1
-rw-r--r--libtoprammer/chips/microchip8/pic16f630sip6.py1
7 files changed, 34 insertions, 18 deletions
diff --git a/libtoprammer/chips/microchip8/microchip8_18_common.py b/libtoprammer/chips/microchip8/microchip8_18_common.py
index 3e743c9..8510ec9 100644
--- a/libtoprammer/chips/microchip8/microchip8_18_common.py
+++ b/libtoprammer/chips/microchip8/microchip8_18_common.py
@@ -70,7 +70,7 @@ class Chip_Microchip8_18_common(Chip):
deviceIDLength = 2
voltageVDD = 5
voltageVPP = 12
-
+
def __init__(self,
chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
signature,
@@ -92,9 +92,15 @@ class Chip_Microchip8_18_common(Chip):
self.isInPmMode = False
self.BufferedBytes = 0
self.Image = ""
- self.programMemoryByteAddressRange = [(0, self.flashPageSize)]
- self.configWordByteAddressRange = [(self.configWordAddr, self.configWordAddr + self.fuseBytes)]
- self.userIDLocationByteAddressRange = [(self.userIDLocationAddr, self.userIDLocationAddr + self.userIDLocationSize)]
+
+ def getIHexInterpreter(self):
+ inter = IHexInterpreter()
+ inter.progmemRanges = [ AddressRange(0, self.flashPageSize) ]
+ inter.fuseRanges = [ AddressRange(self.configWordAddr,
+ self.configWordAddr + self.fuseBytes) ]
+ inter.uilRanges = [ AddressRange(self.userIDLocationAddr,
+ self.userIDLocationAddr + self.userIDLocationSize) ]
+ return inter
def enterPM(self, force=False):
if self.isInPmMode and not force:
diff --git a/libtoprammer/chips/microchip8/microchip8_singlePMarea.py b/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
index bd720c0..fbe4f34 100644
--- a/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
+++ b/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
@@ -46,10 +46,18 @@ class microchip8_singlePMarea(Chip_Microchip8_common):
self.osccalAddr = self.flashPageSize - 1
self.userIDLocationAddr = self.flashPageSize
self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize
- self.programMemoryByteAddressRange = [(0, 2 * self.flashPageSize)]
- self.configWordByteAddressRange = [(2 * self.configWordAddr, 2 * self.configWordAddr + 1), (2 * 0xFFF, 2 * 0xFFF + 1)]
- self.userIDLocationByteAddressRange = [(2 * self.userIDLocationAddr, 2 * (self.userIDLocationAddr + self.userIDLocationSize) - 1)]
-
+
+ def getIHexInterpreter(self):
+ inter = IHexInterpreter()
+ inter.progmemRanges = [ AddressRange(0, 2 * self.flashPageSize) ]
+ inter.fuseRanges = [ AddressRange(2 * self.configWordAddr,
+ 2 * self.configWordAddr + 1),
+ AddressRange(2 * 0xFFF,
+ 2 * 0xFFF + 1) ]
+ inter.uilRanges = [ AddressRange(2 * self.userIDLocationAddr,
+ 2 * (self.userIDLocationAddr + self.userIDLocationSize) - 1) ]
+ return inter
+
def setPC(self, address):
while(self.PC != address):
self.incrementPC(1)
diff --git a/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py b/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py
index dd3902f..3e40f58 100644
--- a/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py
+++ b/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py
@@ -56,10 +56,16 @@ class microchip8_splittedPMarea(Chip_Microchip8_common):
self.userIDLocationAddr = self.logicalFlashProgramMemorySize
self.deviceIDAddr = self.logicalFlashProgramMemorySize + 0x06
self.configWordAddr = self.logicalFlashProgramMemorySize + 0x07
- self.programMemoryByteAddressRange = [(0, 2 * self.flashPageSize)]
- self.configWordByteAddressRange = [(2 * self.configWordAddr, 2 * self.configWordAddr + 1)]
- self.userIDLocationByteAddressRange = [(2 * self.userIDLocationAddr, 2 * (self.userIDLocationAddr + self.userIDLocationSize) - 1)]
-
+
+ def getIHexInterpreter(self):
+ inter = IHexInterpreter()
+ inter.progmemRanges = [ AddressRange(0, 2 * self.flashPageSize) ]
+ inter.fuseRanges = [ AddressRange(2 * self.configWordAddr,
+ 2 * self.configWordAddr + 1) ]
+ inter.uilRanges = [ AddressRange(2 * self.userIDLocationAddr,
+ 2 * (self.userIDLocationAddr + self.userIDLocationSize) - 1) ]
+ return inter
+
def incrementPC(self, count):
for address in range(0, count):
self.sendCommand(0, 0, 0, self.CMD_INCREMENT_ADDRESS)
diff --git a/libtoprammer/chips/microchip8/pic12f629dip8.py b/libtoprammer/chips/microchip8/pic12f629dip8.py
index efbb6c3..bce3939 100644
--- a/libtoprammer/chips/microchip8/pic12f629dip8.py
+++ b/libtoprammer/chips/microchip8/pic12f629dip8.py
@@ -49,8 +49,7 @@ class Chip_Pic12F629dip8(microchip8_splittedPMarea):
)
self.configWordAddr = 0x2007
self.osccalAddr = self.flashPageSize - 1
- # self.configWordByteAddressRange = self.configWordByteAddressRange.append((2*0xFFF, 2*0xFFF+1))
-
+
fuseDesc = (
BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
BitDescription(1, "FOSC[1]"),
diff --git a/libtoprammer/chips/microchip8/pic12f629sip6.py b/libtoprammer/chips/microchip8/pic12f629sip6.py
index 2777449..70a1298 100644
--- a/libtoprammer/chips/microchip8/pic12f629sip6.py
+++ b/libtoprammer/chips/microchip8/pic12f629sip6.py
@@ -49,8 +49,7 @@ class Chip_Pic12F629sip6(microchip8_splittedPMarea):
)
self.configWordAddr = 0x2007
self.osccalAddr = self.flashPageSize - 1
- # self.configWordByteAddressRange = self.configWordByteAddressRange.append((2*0xFFF, 2*0xFFF+1))
-
+
fuseDesc = (
BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
BitDescription(1, "FOSC[1]"),
diff --git a/libtoprammer/chips/microchip8/pic16f630dip14.py b/libtoprammer/chips/microchip8/pic16f630dip14.py
index 32f6c73..399b446 100644
--- a/libtoprammer/chips/microchip8/pic16f630dip14.py
+++ b/libtoprammer/chips/microchip8/pic16f630dip14.py
@@ -49,7 +49,6 @@ class Chip_Pic16F630dip14(microchip8_splittedPMarea):
)
self.configWordAddr = 0x2007
self.osccalAddr = self.flashPageSize - 1
- # self.configWordByteAddressRange = self.configWordByteAddressRange.append((2*0xFFF, 2*0xFFF+1))
fuseDesc = (
BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
diff --git a/libtoprammer/chips/microchip8/pic16f630sip6.py b/libtoprammer/chips/microchip8/pic16f630sip6.py
index 47d0c84..37406f8 100644
--- a/libtoprammer/chips/microchip8/pic16f630sip6.py
+++ b/libtoprammer/chips/microchip8/pic16f630sip6.py
@@ -49,7 +49,6 @@ class Chip_Pic16F630sip6(microchip8_splittedPMarea):
)
self.configWordAddr = 0x2007
self.osccalAddr = self.flashPageSize - 1
- # self.configWordByteAddressRange = self.configWordByteAddressRange.append((2*0xFFF, 2*0xFFF+1))
fuseDesc = (
BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
bues.ch cgit interface